Documentation

Reverse

Find the places nearest to a point.

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.
layerslistbothvenue, address.
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=48.8584&point.lon=2.2945&size=1'
{
  "features": [
    {
      "geometry": {
        "coordinates": [
          2.2944247,
          48.8583885
        ],
        "type": "Point"
      },
      "properties": {
        "country": "France",
        "country_code": "FR",
        "county": "Paris",
        "distance": 0.006,
        "gid": "geolith:venue:679858559648361093",
        "id": "679858559648361093",
        "importance": 0.512499988079071,
        "label": "Paris, France Eu, Paris, Île-de-France, France",
        "layer": "venue",
        "locality": "Paris",
        "name": "Paris, France Eu",
        "region": "Île-de-France",
        "source": "geolith"
      },
      "type": "Feature"
    }
  ],
  "geocoding": {
    "attribution": "https://search.geolith.app/attribution",
    "engine": {
      "name": "geolith-search",
      "version": "0.1.0"
    },
    "query": {
      "boundary.circle.radius": 1.0,
      "point.lat": 48.8584,
      "point.lon": 2.2945,
      "size": 1
    },
    "version": "0.2"
  },
  "type": "FeatureCollection"
}

See Reverse geocoding for how the nearest places are found.