The GeocodeFile task geocodes a zipped table or file of addresses and returns the geocoded results. It supports zipped CSV and XLS files and geodatabase table input. The task geocodes the entire file regardless of its size.
Note:
This method only exists in ArcGIS Enterprise. This API is not supported for ArcGIS Online.Request URL
https://<analysis-url>/GeocodeFile/submitJob
Request parameters
Parameter | Description |
---|---|
geocodeParameters (Required) | This includes parameters that help parse the file, the field lengths, and field mapping. This JSON is the output from AnalyzeGeocodeInput. It is important to inspect the field mapping and adjust it accordingly before submitting your job, otherwise the 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 and passing it in. Syntax values:
Example
|
geocodeServiceURL (Required) | The REST URL of the geocode service you want to geocode your addresses against. The URL must end in geocodeServer and allow batch requests. This can be a utility service or a locator that is anonymously accessible. The geocode service must be configured to allow batch geocoding. For more information, see Configuring batch geocoding. |
outputType (Required) | Specifies the file type to which the geocode results will be written. Values: csv | xls | gdb |
inputFile (Required) | The input file that contains addresses or places to geocode in a zipped CSV file, XLSX file, or zipped file geodatabase table. The file must already be uploaded to ArcGIS Server. Syntax
|
tableName (Optional) | The name of the table that contains the addresses or places to geocode in the inputFile. The table name of the input XLSX file or file geodatabase table. The sheet name of the zipped XLSX inputFile . If your input is a zipped XLSX file, enter the name of the sheet in tableName. If your input is a zipped file geodatabase table, enter the name of the table in the file geodatabase that you want to geocode. Use the name of the table if the inputFile is a XLSX file or file geodatabase table. Use the sheet name of the zipped XLSX inputFile. Use the name of the table with the locations to geocode in the file geodatabase Example
|
sourceCountry (Optional) | This parameter will limit geocoding to the country or countries specified. Specifying the country where the addresses or places are from in the inputFile will improve the accuracy of geocoding in most cases. If a field representing countries in the inputFile is mapped to the input Country field from the geocode service in field_mapping, the country value from the inputFile will override the sourceCountry parameter. This is limited to the specified country or countries, and when no sourceCountry is specified, geocoding is performed against all supported countries of the locator. You can specify the input value as either two-character or three-character country codes in a comma-separated list. See the Supported Country Codes column for the input value to use. Note:Not all geocode services support sourceCountry. Example
|
category (Optional) | Limits the types of places the geocode service searches, which eliminates false positive matches and potentially speeds up the search process. When no category is used, geocoding is performed against all supported categories. In general, you can use the parameter for the following:
Note:Not all geocode services support category. See the ArcGIS REST API web help for details about category filtering. Example
|
outputFields (Optional) | Specifies which geocode service output fields are returned in the geocode results. The parameter options are the following:
Example
|
headerRowsToSkip (Optional) | Describes the first row containing data to be geocoded in the file or table. The default value is 1 since the first row contains the field headers. Example
|
outputName (Optional) | If provided, the task will create a feature service of the results. You define the name of the service. If an outputName value is not provided, the task will return a feature collection. Syntax: Syntax: |
context (Optional) | The Context parameter contains the following additional settings that affect task operation:
Syntax:
|
locatorParameters (Optional) | This parameter takes a dictionary that can contain any or all of the following optional geocoding parameters:
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.
Syntax
{
"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:
https://<analysis-url>/GeocodeFile/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:https://<analysis-url>/GeocodeFile/jobs/<jobId>/results/<output parameter name>?token=<your token>&f=json
Parameter | Description |
---|---|
geocodeResult |
geocodeResult can be a zipped CSV file, XLS file, or file geodatabase with the geocoded results. The result has properties for parameter name, data type, and value. The value contains the URL to download the zipped geocoded results.
|
geocodingStatistics | geocodingStatistics output JSON includes statistics about the batch geocoding job. The result has properties for parameter name, data type, and value. The value contains the JSON of percentages for matched, unmatched, and tied records in the batch geocoding job. It may also contain "Dropped Records", an additional list of ObjectIDs for the records that were unable to be processed.
|