Geocoding API: Reverse Geocode Service JSON POST Request & Response - geo_addressing_sdk - 5.0

Geo Addressing SDK Developer Guide

Product type
Software
Portfolio
Locate
Product family
Geo Addressing
Product
Geo Addressing SDK
Version
5.0
Language
English
Product name
Geo Addressing SDK
Title
Geo Addressing SDK Developer Guide
Copyright
2023
First publish date
2007
Last updated
2024-10-17
Published on
2024-10-17T16:12:58.390251

JSON POST Request

Using the Geocoding API, the following is an example of a JSON POST request for the Reverse Geocode Service.

POST http://myserver:8080/Geocode/rest/GeocodeService/reverseGeocode.json?
{
   "preferences": {
      "returnAllCandidateInfo": false,
      "fallbackToGeographic": true,
      "fallbackToPostal": true,
      "maxReturnedCandidates": 1,
      "distance": 100,
      "streetOffset": 7,
      "cornerOffset": 7,
      "matchMode": "UNSPECIFIED",
      "clientLocale": "en-US",
      "clientCoordSysName": "epsg:4326",
      "distanceUnits": "METER",
      "streetOffsetUnits": "METER",
      "cornerOffsetUnits": "METER",
      "mustMatchFields": {
         "matchOnAddressNumber": false,
         "matchOnPostCode1": false,
         "matchOnPostCode2": false,
         "matchOnAreaName1": false,
         "matchOnAreaName2": false,
         "matchOnAreaName3": false,
         "matchOnAreaName4": false,
         "matchOnAllStreetFields": false,
         "matchOnStreetName": false,
         "matchOnStreetType": false,
         "matchOnStreetDirectional": false,
         "matchOnPlaceName": false,
         "matchOnInputFields": false
      },
      "returnFieldsDescriptor": {
         "returnAllCustomFields": false,
         "returnMatchDescriptor": false,
         "returnStreetAddressFields": false,
         "returnUnitInformation": false,
         "returnedCustomFieldKeys": []
      },
      "customPreferences": {},
      "preferredDictionaryOrders": []
   },
   "points": [
      {
         "country": "FRA",
         "geometry": {
            "type": "point",
            "coordinates": [
               2.294449,
               48.85838
            ],
            "crs": {
               "type": "name",
               "properties": {
                  "name": "EPSG:4326"
               }
            }
         }
      }
   ]
}          
POST http://myserver:8080/rest/GlobalGeocode/reverseGeocode.json?
{
   "preferences": {
      "returnAllCandidateInfo": false,
      "fallbackToGeographic": true,
      "fallbackToPostal": true,
      "maxReturnedCandidates": 1,
      "distance": 100,
      "streetOffset": 7,
      "cornerOffset": 7,
      "matchMode": "UNSPECIFIED",
      "clientLocale": "en-US",
      "clientCoordSysName": "epsg:4326",
      "distanceUnits": "METER",
      "streetOffsetUnits": "METER",
      "cornerOffsetUnits": "METER",
      "mustMatchFields": {
         "matchOnAddressNumber": false,
         "matchOnPostCode1": false,
         ...
         
         "matchOnStreetName": false,
         "matchOnStreetType": false,
         "matchOnStreetDirectional": false,
         "matchOnPlaceName": false,
         "matchOnInputFields": false
      },
      "returnFieldsDescriptor": {
         "returnAllCustomFields": false,
         "returnMatchDescriptor": false,
         "returnStreetAddressFields": false,
         "returnUnitInformation": false,
         "returnedCustomFieldKeys": []
      },
      "customPreferences": {},
      "preferredDictionaryOrders": []
   },
   "points": [
      {
         "country": "FRA",
         "geometry": {
            "type": "point",
            "coordinates": [
               2.294449,
               48.85838
            ],
            "crs": {
               "type": "name",
               "properties": {
                  "name": "EPSG:4326"
               }
            }
         }
      }
   ]
}          

JSON Response

The following shows the JSON response returned by the previous request.

{
   "responses": [
      {
         "totalPossibleCandidates": 2,
         "totalMatches": 2,
         "candidates": [
            {
               "precisionLevel": 2,
               "formattedStreetAddress": "avenue Anatole France",
               "formattedLocationAddress": "75007 Paris",
               "identifier": null,
               "precisionCode": "RS4A",
               "sourceDictionary": "1",
               "matching": null,
               "geometry": {
                  "type": "Point",
                  "coordinates": [
                     2.2948623,
                     48.858486
                  ],
                  "crs": {
                     "type": "name",
                     "properties": {
                        "name": "epsg:4326"
                     }
                  }
               },
               "address": {
                  "mainAddressLine": "avenue Anatole France",
                  "addressLastLine": "75007 Paris",
                  "placeName": "",
                  "areaName1": "Ile-de-France",
                  "areaName2": "Paris",
                  "areaName3": "Paris",
                  "areaName4": "7e Arrondissement Paris",
                  "postCode1": "75007",
                  "postCode2": "",
                  "country": "FRA",
                  "addressNumber": "",
                  "streetName": "Anatole France",
                  "unitType": null,
                  "unitValue": null,
                  "customFields": {
                     "REVERSE_GEOCODE_DISTANCE_UNIT": "METER",
                     "REVERSE_GEOCODE_DISTANCE": "23.3"
                  }
               },
               "ranges": []
            },
            {
               "precisionLevel": 2,
               "formattedStreetAddress": "parc du Champ de Mars",
               "formattedLocationAddress": "75007 Paris",
               "identifier": null,
               "precisionCode": "RS4A",
               "sourceDictionary": "1",
               "matching": null,
               "geometry": {
                  "type": "Point",
                  "coordinates": [
                     2.2948623,
                     48.858486
                  ],
                  "crs": {
                     "type": "name",
                     "properties": {
                        "name": "epsg:4326"
                     }
                  }
               },
               "address": {
                  "mainAddressLine": "parc du Champ de Mars",
                  "addressLastLine": "75007 Paris",
                  "placeName": "",
                  "areaName1": "Ile-de-France",
                  "areaName2": "Paris",
                  "areaName3": "Paris",
                  "areaName4": "7e Arrondissement Paris",
                  "postCode1": "75007",
                  "postCode2": "",
                  "country": "FRA",
                  "addressNumber": "",
                  "streetName": "du Champ de Mars",
                  "unitType": null,
                  "unitValue": null,
                  "customFields": {
                     "REVERSE_GEOCODE_DISTANCE_UNIT": "METER",
                     "REVERSE_GEOCODE_DISTANCE": "23.3"
                  }
               },
               "ranges": []
            }
         ]
      }
   ]
}