- URL:https://<geoanalytics-url>/GeocodeLocations
- Version Introduced:10.6
Description
The GeocodeLocations operation geocodes a table from a big data file share. The task uses a geocode utility service configured with your portal. If you do not have a geocode utility service configured, talk to your administrator. Learn more about configuring a locator service.
When preparing to use the GeocodeLocations operation, be sure to review Best practices for geocoding with GeoAnalytics.
Request parameters
Parameter | Details |
---|---|
inputLayer (Required) | The tabular input that will be geocoded. Syntax: As described in Feature input, this parameter can be one of the following:
REST Examples
|
geocodeParameters (Required) | This includes parameters that help parse the input data as well as the field lengths and a field mapping. This JSON is the output from the AnalyzeGeocodeInput tool available on your server designated to geocode. It is important to inspect the field mapping closely and adjust them accordingly before submitting your job, otherwise your geocoding results may not be accurate. It is recommended that you use the output from AnalyzeGeocodeInput and modify the field mapping instead of constructing this JSON by hand. REST Examples
|
geocodeServiceURL (Required) | The REST URL of the geocode service that you want to geocode your addresses against. The URL must end in geocodeServer and allow batch requests. The geocode service must be configured to allow for batch geocoding. For more information, see Configuring batch geocoding REST Examples
|
sourceCountry (Optional) | Enter a sourceCountry if all of your data is from the same country. Some geocoding services do not support sourceCountry, and the available options depend on your geocode service. REST Examples
|
category (Optional) | Enter a category for more precise geocoding results, if applicable. Some geocoding services do not support category, and the available options depend on your geocode service. REST Examples
|
includeAttributes (Optional) | A Boolean value to return the output fields from the geocoding service in the results. To output all available outputFields, set this value to true. Setting the value to false will return your original data with geocode coordinates. Some geocoding services do not support outputFields, and the available options depend on your geocode service. REST Examples
|
locatorParameters (Optional) | Additional parameters specified to your locator. |
outputName (Required) | The task will create a feature service of the results. You define the name of the service. REST Examples
|
context (Optional) | Context contains additional settings that affect task execution. For this task, there are three settings:
|
f | The response format. The default response format is html. Values: html | json |
Example usage
Below is a sample request URL for GeocodeLocations:
https://hostname.domain.com/webadaptor/rest/services/System/GeoAnalyticsTools/GPServer/GeocodeLocations/submitJob?inputLayer={"url": "https://myportal.domain.com/server/rest/services/Hosted/hurricaneTrack/FeatureServer/0", "filter": "Month = 'September'"}&geocodeParameters={"field_info": "[('ObjectID', 'TEXT', 255), ('SingleLine', 'TEXT', 255), ('Address', 'TEXT', 255), ('Region', 'TEXT', 255), ('Postal', 'TEXT', 255), ('PostalExt', 'TEXT', 255), ('Country', 'TEXT', 255), ('Source', 'TEXT', 255)]", "column_names": "", "file_type": "csv", "column_delimiter": ",", "text_qualifier": "", "field_mapping": "[['ObjectID', 'OBJECTID'], ['SingleLine', 'SingleLine'], ['Address', 'Address'], ['Region', 'Region'], ['Postal', 'Postal'], ['PostalExt', 'PostalExt'], ['Country', ''], ['Source', '']]", "header_row_exists": true}&geocodeServiceURL={"url": "https://mymachine.mydomain.com/server/rest/services/my_locator/GeocodeServer"}&outputName=myOutput&f=json
Response
When you submit a request, the service assigns a unique job ID for the transaction.
{
"jobId": "<unique job identifier>",
"jobStatus": "<job status>"
}
After the initial request is submitted, you can use jobId to periodically check the status of the job and messages as described in Check job status. Once the job has successfully completed, use jobId to retrieve the results. To track the status, you can make a request of the following form:
https://<analysis url>/GeocodeLocations/jobs/<jobId>
Access results
When the status of the job request is esriJobSucceeded, you can access the results of the analysis by making a request of the following form:
https://<analysis-url>/GeocodeLocations/jobs/<jobId>/results/output?token=<your token>&f=json
Response | Description |
---|---|
output |
output is a point layer. Features that failed to find a geocode match will not have any coordinates.
The result has properties for parameter name, data type, and value. The contents of value depend on the outputName parameter provided in the initial request. The value contains the URL of the feature service layer. See Feature output for more information about how the result layer is accessed. |