Search docs

Reverse

Find the places nearest to a point.

By · Updated

GET /v1/reverse returns up to size places within a radius of a point, nearest first. Each result has its distance in kilometres.

Parameters

ParameterTypeDefaultMeaning
point.latnumber −90–90requiredLatitude of the point.
point.lonnumber −180–180requiredLongitude of the point.
boundary.circle.radiusnumber, > 0 and ≤ 1001Search radius in kilometres.
sizeinteger 1–4010Number of results.
layerslistallvenue, address, street, locality, county, region, country.
boundary.countrylistevery countryISO 3166-1 alpha-2 codes.

focus.point.lat and focus.point.lon are accepted but have no effect here.

Example

curl 'http://localhost:4000/v1/reverse?point.lat=18.5195&point.lon=73.8553&size=2'
{
  "bbox": [
    73.85535,
    18.51957,
    73.8553518,
    18.5195709
  ],
  "features": [
    {
      "geometry": {
        "coordinates": [
          73.85535,
          18.51957
        ],
        "type": "Point"
      },
      "properties": {
        "country": "India",
        "country_code": "IN",
        "county": "Pune",
        "distance": 0.009,
        "gid": "geolith:venue:3810173583912348177",
        "id": "3810173583912348177",
        "importance": 0.34360000491142273,
        "label": "Mahindra Automotive, Pune, Maharashtra, India",
        "layer": "venue",
        "locality": "Pune",
        "name": "Mahindra Automotive",
        "region": "Maharashtra",
        "source": "geolith"
      },
      "type": "Feature"
    },
    {
      "geometry": {
        "coordinates": [
          73.8553518,
          18.5195709
        ],
        "type": "Point"
      },
      "properties": {
        "country": "India",
        "country_code": "IN",
        "county": "Pune",
        "distance": 0.01,
        "gid": "geolith:venue:17375909595434777",
        "id": "17375909595434777",
        "importance": 0.8500000238418579,
        "label": "Pathkind Labs, Pune, Maharashtra, India",
        "layer": "venue",
        "locality": "Pune",
        "name": "Pathkind Labs",
        "region": "Maharashtra",
        "source": "geolith"
      },
      "type": "Feature"
    }
  ],
  "geocoding": {
    "attribution": "https://console.geolith.app/attribution",
    "engine": {
      "name": "geolith-search",
      "version": "0.1.0"
    },
    "query": {
      "boundary.circle.radius": 1.0,
      "point.lat": 18.5195,
      "point.lon": 73.8553,
      "size": 2
    },
    "version": "0.2"
  },
  "type": "FeatureCollection"
}

The response is trimmed to two features.

See Reverse geocoding for how the nearest places are found.