apoc.spatial.geocodeOnce

Details

Syntax

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

Description

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

Input arguments

Name

Type

Description

location

STRING

The location to search for.

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.geocodeOnce('21 rue Paul Bellamy 44000 NANTES FRANCE')
Results
location data latitude longitude description

{description: "21, Rue Paul Bellamy, Talensac - Pont Morand, Hauts-Pavés - Saint-Félix, Nantes, Loire-Atlantique, Pays de la Loire, France métropolitaine, 44000, France", latitude: 47.2221667, longitude: -1.5566625}

{osm_type: "node", osm_id: 1730317979, licence: "Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright", boundingbox: ["47.2221167", "47.2222167", "-1.5567125", "-1.5566125"], importance: 0.721, lon: "-1.5566625", display_name: "21, Rue Paul Bellamy, Talensac - Pont Morand, Hauts-Pavés - Saint-Félix, Nantes, Loire-Atlantique, Pays de la Loire, France métropolitaine, 44000, France", type: "house", class: "place", place_id: 17843897, lat: "47.2221667"}

47.2221667

-1.5566625

"21, Rue Paul Bellamy, Talensac - Pont Morand, Hauts-Pavés - Saint-Félix, Nantes, Loire-Atlantique, Pays de la Loire, France métropolitaine, 44000, France"