Analyze Geocode Input

The Analyze Geocode Input task takes in a geocode input (either a table or file of addresses) and returns an output JSON that includes a suggested field mapping. It supports CSV, XLS or table input. The task generates a suggested field mapping based on the input fields and the geocoding service candidate fields and returns it in a geocodeParameters JSON. This geocodeParameters JSON output is the first input to the BatchGeocode tool. The output geocodeParameters JSON also includes field info (name, length, and type) as well as additional information that helps BatchGeocode parse the input file or table.

Request URL

http://<analysis url>/AnalyzeGeocodeInput/submitJob

Request parameters

Parameter

Description

geocodeServiceURL

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

inputTable

Syntax: The input table specification must include the following:

  • A URL to an input table
  • A service token to access the table

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 in one of the following formats:

  • CSV
  • Microsoft Excel spreadsheet

Example: {"itemid":"<itemid of file>"}

columnNames

Instead of providing an inputTable or inputFileItem, columnNames can also be provided. columnNames is required if there is no header row in the inputTable or inputFileItem. columnNames should be separated by commas.

Example: address,city,state,zip

inputFileParameters

Enter a JSON that contains information about how to parse the file. If you are using inputTable instead of inputFileItem as input, this parameter can be left blank. Any of the values in the JSON can also be left blank ("") if they do not apply to the file.

Values:

  • fileType—Enter CSV or XLS for the file format of inputFileItem.
  • headerRowExists—Enter true if your file has a header row, false otherwise.
  • columnDelimiter—Enter SPACE, TAB, COMMA, PIPE, or SEMICOLON.
  • textQualifier—Enter either SINGLE_QUOTE or DOUBLE_QUOTE.

Example: {"fileType":"xlsx","headerRowExists":"true","columnDelimiter":"","textQualifier":""}

locale

Enter the 2-letter ("en") or 4-letter ("ar-il") specific locale if geocodeInput is in a language other than English. For more information about localization and specific language codes, see localization.

context

Context contains additional settings that affect task execution. Analyze Geocode Input has the following two settings:

  • Extent (extent)—A bounding box that defines the analysis area. Only those points in inputLayer that intersect the bounding box are analyzed.
  • Output Spatial Reference (outSR)—The output features are projected into the output spatial reference.

Syntax:
{
"extent" : {extent}
"outSR" : {spatial reference}
}

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:

http://<analysis url>/AnalyzeGeocodeInput/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>/AnalyzeGeocodeInput/jobs/<jobId>/results/<output parameter name>?token=<your token>&f=json

Parameter

Description

geocodeParameters

geocodeParameters is a JSON that contains information about the file, field info, and a suggested field mapping.

Request example:
{"url": 
"http://<analysis url>/AnalyzeGeocodeInput/jobs/<jobId>/results/geocodeParameters"}

The result contains the geocodeParameters JSON, which is the first input into the BatchGeocode tool

  • {
     "paramName": "geocodeParameters",
     "dataType": "GPString",
     "value": {
      "field_info": "[('ObjectID', 'TEXT', 255), ('Address', 'TEXT', 255)]",
      "column_names": "",
      "file_type": "xlsx",
      "column_delimiter": "",
      "text_qualifier": "",
      "field_mapping": "[['ObjectID', 'OBJECTID'], ['Address', 'Address']]",
      "header_row_exists": true
     }
    }
    

10/6/2017