User Tools

Site Tools


public:api:rest:v3:geocoding

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

public:api:rest:v3:geocoding [2018/11/08 14:39] (current)
mikolaj.grajek created
Line 1: Line 1:
 +===== API /​rest/​v3/​geocoding =====
 +
 +
 +**URL**
 +<​code>​POST ​ https://​jakdojade.pl/​api/​rest/​v3/​geocoding</​code>​
 +
 +**BODY**
 +<​code>​
 +{
 +    "​houseNumber"​ : "numer domu", ​
 +    "​streetName":​ "nazwa ulicy",​
 +    "​cityName":​ "nazwa miasta",​
 +    "​municipalityName":​ "nazwa gminy",​
 +    "​countyName":​ "nazwa powiatu",​
 +    "​provinceName":​ "nazwa województwa"​
 +}
 +</​code>​
 +
 +**Response**
 +
 +
 +<uml>
 +GeocodingLocations o--"​0..n"​ GeocodedLocation
 +GeocodedLocation o--"​1..1"​ Location
 +
 +GeocodingLocations : Location[] geocodedLocations
 +
 +Location : String cityName
 +Location : String streetName
 +Location : String districtName
 +Location : String houseNumber
 +Location : String municipalityName
 +Location : String countyName
 +Location : String provinceName
 +Location : Coordinate coordinates
 +
 +GeocodedLocation : Location location
 +GeocodedLocation : String accuracyLevel
 +
 +
 +
 +Coordinate: double xLat
 +Coordinate: double yLon
 +</​uml>​
 +
 +Field "​accuracyLevel"​ has 3 values: ("​ADDRESS",​ "​STREET",​ "​CITY"​)
 +
 +With "​accuracyLevel"​="​ADDRESS":​ all fields "​location"​ contain data.
 +
 +With "​accuracyLevel"​="​STREET":​ "​location.houseNumber"​ is null .
 +
 +With "​accuracyLevel"​="​CITY":​ "​location.houseNumber"​ is null  and "​location.streetName"​ is null.
 +
 +**Example Request**
 +<code javascript>​
 +{
 + "​houseNumber"​ : "​16", ​
 + "​streetName":​ "​Hetmańska",​
 + "​cityName":​ "​Poznań", ​
 + "​municipalityName":​ "​Poznań", ​
 + "​countyName":​ "​Poznań", ​
 + "​provinceName":​ "​wielkopolskie"​
 +}
 +</​code>​
 +
 +As a curl command:
 +<code bash>
 +curl -X POST -H "​Content-Type:​ application/​json"​ -d '​{"​houseNumber"​ : "​16",​ "​streetName":​ "​Hetmańska","​cityName":​ "​Poznań",​ "​municipalityName":​ "​Poznań",​ "​countyName":​ "​Poznań",​ "​provinceName":​ "​wielkopolskie"​}'​ http://​172.16.0.121:​1080/​api/​rest/​v3/​geocoding
 +</​code>​
 +
 +**Example Response**
 +
 +<code javascript>​
 +{
 + "​geocodedLocations":​ [
 + {
 + "​location":​ {
 + "​houseNumber":​ "​16",​
 + "​streetName":​ "​Hetmańska",​
 + "​cityName":​ "​Poznań",​
 + "​districtName":​ "​Łazarz",​
 + "​municipalityName":​ "​Poznań",​
 + "​countyName":​ "​Poznań",​
 + "​provinceName":​ "​województwo wielkopolskie",​
 + "​coordinates":​ {
 + "​xLat":​ 16.888564,
 + "​yLon":​ 52.391899
 + }
 + },
 + "​accuracyLevel":​ "​ADDRESS"​
 + }
 + ]
 +}
 +</​code>​
  
public/api/rest/v3/geocoding.txt · Last modified: 2018/11/08 14:39 by mikolaj.grajek