apoc.spatial.reverseGeocode

Details

Syntax

apoc.spatial.reverseGeocode(latitude, longitude [, quotaException, config ]) :: (location, data, latitude, longitude, description)

Description

Returns a textual address from the given geographic location (latitude, longitude) using a geocoding service (default: OpenStreetMap). This procedure returns at most one result.

Input arguments

Name

Type

Description

latitude

FLOAT

The latitude of the location.

longitude

FLOAT

The longitude of the location.

quotaException

BOOLEAN

Whether or not to throw an exception when the maximum request quota is reached. The default is: false.

config

MAP

{ provider = 'osm' :: STRING, url :: STRING, reverseUrl: :: STRING, key :: STRING }. The default is: {}.

Return arguments

Name

Type

Description

location

MAP

A detailed map of information on the found location.

data

MAP

A map of returned data from the given provider.

latitude

FLOAT

The latitude of the found location.

longitude

FLOAT

The longitude of the found location.

description

STRING

A description of the found location.

Usage Examples

CALL apoc.spatial.reverseGeocode(51.5074, 0.1277);
Results
location data latitude longitude description

{description: "Crossway, London Borough of Bexley, London, Greater London, England, SE28 8NH, United Kingdom", latitude: 51.50743369498096, longitud e: 0.1274535888695359}

{country: "United Kingdom", country_code: "gb", road: "Crossway", city: "London", state_district: "Greater London", postcode: "SE28 8NH", state: "England", city_district: "London Borough of Bexley"}

51.50743369498096

0.1274535888695359

"Crossway, London Borough of Bexl ey, London, Greater London, England, SE28 8NH, United Kingdom"