The query includes a pair of coordinates as input, the service returns one or several possible responses (depending on the maximum number of responses desired), including the address, the post code, the town, the country, and the distance between the result and the start point (coordinates indicated as input).
{ "url":"https://api.geoconcept.com/EU/GCW/geoconcept-web/api/lbs/reverseGeocoding/v4.json", "type":"GET", "params": { "locations": { "sample":"14.411633,50.086454;-0.127515,51.503264;13.377888,52.516224;21.014335,52.225451" }, "srs": { "sample":"epsg:4326" }, "maxDistance": { "sample":"1000" }, "maxDistanceBetweenCandidates": { "sample":"100" }, "maxCandidates": { "sample":"2" }, "fields": { "sample":"Postcode left; Postcode right" } } }
Input
parameter | description | optional | default |
---|---|---|---|
srs |
projection (EPSG code such as epsg:4326 or wgs84) |
yes |
|
locations |
Coordinates for points separated by “,”. Pair of XY coordinates are separated by “;”. |
no |
|
maxDistance |
maximum search distance to find neighbouring streets at the reverse geocoding start point |
yes |
1000 |
maxCandidates |
maximum number of result addresses in the response |
yes |
1 |
maxDistanceBetweenCandidates |
Maximum distance (in meters) between each candidate. |
yes |
100 |
fields |
List of fields to include in the response, separated by a ; character |
yes |
[] |
Output
Reminder for the coordinates of the start point of the search(reverseGeocodingV4Response)
property | type | min/max | description |
---|---|---|---|
location |
string |
0/1 |
X,Y coordinates for the start point for the reverse geocoding |
srs |
string |
0/1 |
projection (EPSG code such as epsg:4326 or wgs84) |
addresses |
0/unlimited |
list of (candidate) addresses returned |
Candidates returned (addresses)
property | type | min/max | description |
---|---|---|---|
addressLine |
string |
0/1 |
street found |
postCode |
string |
0/1 |
post code found |
city |
string |
0/1 |
town associated with the candidate returned |
country |
string |
0/1 |
country associated to the candidate returned |
distanceMetersToLocation |
double |
1/1 |
Distance (in meters) between the candidate returned and the start point |
coordinates |
string |
1/1 |
Coordinates of the address |
streetSide |
string |
"right" or "left" |
|
fieldsValues |
string |
values for the requested fields on the street found |
Example of a correct reverse geocoding (status is OK)
{ "status": "OK", "reverseGeocodingResults":[ { "location": "14.411633,50.086454", "addresses":[ { "addressLine": "KARLŮV MOST", "postCode": "118 00", "city": "PRAHA 1", "country": "Česko", "distanceMetersToLocation": 0.61, "coordinates": "14.411635,50.086459", "streetSide": "Left", "fieldsValues":["118 00", "118 00"] }, { "addressLine": "KARLŮV MOST", "postCode": "118 00", "city": "PRAHA 1", "country": "Česko", "distanceMetersToLocation": 40.46, "coordinates": "14.41108,50.08653", "streetSide": "Left", "fieldsValues":["118 00", "118 00"] } ] }, { "location": "-0.127515,51.503264", "addresses":[ { "addressLine": "9 DOWNING STREET", "postCode": "SW1A 2", "city": "SW1", "country": "England", "distanceMetersToLocation": 6.24, "coordinates": "-0.127521,51.503208", "streetSide": "Right", "fieldsValues":["SW1A 2", "SW1A 2"] }, { "addressLine": "10 DOWNING STREET", "postCode": "SW1A 2", "city": "SW1", "country": "England", "distanceMetersToLocation": 7.11, "coordinates": "-0.12757,51.50321", "streetSide": "Right", "fieldsValues":["SW1A 2", "SW1A 2"] } ] }, { "location": "13.377888,52.516224", "addresses":[ { "addressLine": "PARISER PLATZ", "postCode": "10117", "city": "MITTE", "country": "Deutschland", "distanceMetersToLocation": 8.04, "coordinates": "13.377873,52.516296", "streetSide": "Right", "fieldsValues":["10117", "10117"] }, { "addressLine": "PARISER PLATZ", "postCode": "10117", "city": "MITTE", "country": "Deutschland", "distanceMetersToLocation": 9.46, "coordinates": "13.3778,52.51629", "streetSide": "Right", "fieldsValues":["10117", "10117"] } ] }, { "location": "21.014335,52.225451", "addresses":[ { "addressLine": "ULICA MARSZAŁKOWSKA", "postCode": "00-683", "city": "ŚRÓDMIEŚCIE", "country": "Polska", "distanceMetersToLocation": 8.3, "coordinates": "21.014221,52.225425", "streetSide": "Right", "fieldsValues":["00-683", "00-683"] }, { "addressLine": "ULICA MARSZAŁKOWSKA", "postCode": "00-545", "city": "ŚRÓDMIEŚCIE", "country": "Polska", "distanceMetersToLocation": 9.92, "coordinates": "21.014471,52.225482", "streetSide": "Left", "fieldsValues":["00-545", "00-545"] } ] } ], "fieldsNames":[ "Postcode left", "Postcode right" ] }
Case of a query that does not snap (status is ERROR)
An error append : (500) Internal Server Error ServiceException: Error in reverse geocoding computation Error in smartrouting Failed to execute ReverseGeocode com.geoconcept.smartrouting.SmartRoutingNativeException: failed to connect { 14.411633, 50.086454, 0.000000 } failed to connect { 14.411633, 50.086454, 0.000000 }
- 1. How is the maximum distance interpreted?
- 2. What is the role of the maxCandidates parameter?
- 3. What is the significance of the maxDistanceBetweenCandidates parameter?