Batch Geocode
![]() |
The Batch Geocode task geocodes a table or file of addresses and returns the geocoded results. It supports CSV, XLS or table input. The task geocodes the entire file regardless of size.
Request URL
http://<analysis url>/BatchGeocode/submitJob
Request parameters
Parameter | Description |
---|---|
geocodeParameters (Required) | This includes parameters that help parse the file, as well the field lengths and a field mapping. This JSON is the output from AnalyzeGeocodeInput. It is important to inspect the field mapping closely and adjust it accordingly before submitting your job, otherwise your geocoding results may not be accurate. It is recommended to use the output from AnalyzeGeocodeInput and modify the field mapping instead of constructing this JSON by hand and passing it in. Values
Example: {"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 | Enter 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. This could be a utility service or a geocoder that is anonymously accessible. The geocoding service must be configured to allow for batch geocoding. For more information, see: Configuring batch geocoding |
outputType | Enter the format of the expected geocoding results. Values: csv | xls | Feature Collection | Feature Service |
inputTable | Syntax: The input table specification must include the following:
Note that if the table is a hosted table on the same portal, serviceToken is not required. Example: {"url":"<table_url>","serviceToken":"<token>"} |
inputFileItem |
Syntax: The input file should be a portal item. Input the itemid of the item in the portal. The format of the item in the portal can be one of the following:
Example: {"itemid":"<itemid_of_file>"} |
sourceCountry | Enter a sourceCountry if all of your data is from the same country. Example: US |
category | Enter a category for more precise geocoding results if applicable. Note that some geocoding services do not support category. Example: POI |
outputFields | Enter the output fields from the geocoding service that you want returned in the results, separated by commas. To output all available outputFields, leave this parameter blank. Example: score,match_addr,x,y |
headerRowsToSkip | Describes on which row your data begins in your file or table. The default is 1 (since the first row contains the headers). The default is 1. Example: 1 |
outputName | If provided, the task will create a feature service of the results. You define the name of the service. If outputName is not supplied, the task will return a feature collection. Syntax:
|
context | context contains additional settings that affect task execution. Batch Geocode has the following two settings:
Syntax:
|
f | The response format. The default response format is html. Values: html | 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 Checking job status. Once the job has successfully completed, use jobId to retrieve the results. To track the status, you can make a request in the following form:
http://<analysis url>/BatchGeocode/jobs/<jobId>
Access results
When the status of the job request is esriJobSucceded, you can access the results of the analysis by making a request in the following form:
http://<analysis url>/BatchGeocode/jobs/<jobId>/results/<output parameter name>?token=<your token>&f=json
Parameter | Description |
---|---|
geocodeResult |
geocodeResult can be a feature collection JSON, or it contains the itemId of the geocoding job. itemId is either a feature service or a file, depending on the desired outputType. Request example:
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.
See Feature Output for more information about how the result layer or collection is accessed. |