4.1.2.3 Performing Reverse Geocoding

You can reverse geocode the dataset created in the earlier section using the following request.

HTTP PUT Request

curl -k -X PUT "https://localhost:4040/spatialstudio/oauth/v1/enrichment/reversegeocode/5c3b3a6d98eab545a0f9bd66e3d07886?datasourceid= <MY_CONN_ID>&roadsonly=true&lat=LAT&lon=LON" \
 --header "Authorization: Bearer <MY_TOKEN>" \
 --header "Content-Type: application/json" \
 --data '{
  "street": "STREET",
  "housenumber": "HOUSE_NUMBER",
  "settlement": "SETTLEMENT",
  "municipality": "MUNICIPALITY",
  "region": "REGION",
  "postalcode": "POSTAL_CODE",
  "country": "COUNTRY"
}'

The preceding request uses the coordinate columns (LAT and LON) and also the --data {key:value, …} option that specifies which address-related columns must be created and populated. In this sample request, all the attributes are created. value determines the resulting column name.

The resulting task_id of the reverse-geocoding task running in the background is returned in the response.

Response

{
   "task_id" : "a2743564e066153f4a14ac29000727b1"
}