Geocode service GetCandidateFields method

Gets fields contained in a list of candidates returned from geocoding an address using the FindAddressCandidates method.

GetCandidateFields(PropertySet PropMods)

Parameter

Description

PropMods

Modifications to the geocode service (locator) properties.

Use GetLocatorProperties() to return default locator properties.

Return Value

A Fields object containing one of more Field objects, each representing information about a match candidate.

Remarks

The fields returned from this method include the match fields defined for the specific address style for the geocode service and a set of common fields available for most geocode services. The address style fields are specific to the style being used by the geocode service and may differ from style to style. The common fields will remain consistent. If enabled on a geocode service, they can include the fields listed in the table below. Note that most address styles will return the Shape, Status, and Score fields at a minimum.

Field name

Description

Pct_along

For geocode services that use line geometry as reference data (e.g. streets), this value represents the percentage along the matched feature at which the matched address is located.

Ref_ID

The ObjectID of the matched feature.

Score

A number between 0 and 100 indicating the score of the matched feature. A score of 100 represents an exact match.

Shape

Geometry of the matched address.

Side

For geocode services that can match addresses to a particular side of a street, this value represents the side of the street on which the address matches the matched feature. A value of "L" indicates the left side of the street, and a value of "R" indicates the right side of the street.

Status

A string value that indicates whether the address was matched ("M"), unmatched ("U"), or had two or more candidates tied with the best score ("T").

X

The X coordinate of the matched address.

Y

The Y coordinate of the matched address.

Match_addr

The address matched in the reference data.

Match_type

A code showing how an address was matched. You can group the results based on this attribute to show how the addresses were matched or use the grouping to select records for rematching.

Addr_type

The type of address that was geocoded (Address, Intersection, Coordinates, SpatialOperator, or MGRS).

ResultID

Unique integer id of the matched feature assigned by the geocode service. Included in the record set returned from a call to the GeocodeAddresses() method. The first row (match) returned is assigned a value of 0 and the value for each subsequent row is incremented by 1 (e.g. 0,1,2...).

Examples

C#

GeocodeService_GeocodeServer geocodeservice = new GeocodeService_GeocodeServer();

geocodeservice.Url = "http://localhost:6080/arcgis/services/GeocodeService/GeocodeServer";

 

PropertySet propertymods = geocodeservice.GetLocatorProperties();

 

Fields candidatefields = geocodeservice.GetCandidateFields(propertymods);

foreach (Field candidatefield in candidatefields.FieldArray)

{

      // Descriptive name

      System.Diagnostics.Debug.WriteLine("Alias Name: " + candidatefield.AliasName);

      // Input field name

      System.Diagnostics.Debug.WriteLine("Name: " + candidatefield.Name);

      // Is required?

      System.Diagnostics.Debug.WriteLine("Required: " + candidatefield.Required.ToString());

      // Data type

      System.Diagnostics.Debug.WriteLine("Type: " + candidatefield.Type.ToString());

}

VB.NET

Dim geocodeservice As GeocodeService_GeocodeServer = New GeocodeService_GeocodeServer()

geocodeservice.Url = "http://localhost:6080/arcgis/services/GeocodeService/GeocodeServer"

 

Dim propertymods As PropertySet = geocodeservice.GetLocatorProperties()

Dim candidatefields As Fields = geocodeservice.GetCandidateFields(propertymods)

Dim candidatefield As Field

 

For Each candidatefield In candidatefields.FieldArray

      ' Descriptive name

      System.Diagnostics.Debug.WriteLine("Alias Name: " + candidatefield.AliasName)

      ' Input field name

      System.Diagnostics.Debug.WriteLine("Name: " + candidatefield.Name)

      ' Is required?

      System.Diagnostics.Debug.WriteLine("Required: " + candidatefield.Required.ToString())

      ' Data type

      System.Diagnostics.Debug.WriteLine("Type: " + candidatefield.Type.ToString())

Next

Java

String serviceURL = "http://localhost:6080/arcgis/services/GeocodeService/GeocodeServer";

GeocodeServerBindingStub geocodeService = new GeocodeServerBindingStub(serviceURL);

 

//Test GetCandidateFields

PropertySet propertyMods = geocodeService.getLocatorProperties();

Fields candidateFields = geocodeService.getCandidateFields(propertyMods);

Set<String> setOfCandidateFields = new HashSet<String>();

 

System.out.println("Candidate Field Names...");

 

for (Field candidateField : candidateFields.getFieldArray()) {

      System.out.println(candidateField.getName());

      setOfCandidateFields.add(candidateField.getName());

}

11/8/2016