Geocode service GetResultFields method
Fields contained in the results of a geocode operation using the GeocodeAddress() and GeocodeAddresses() methods.
GetResultFields(PropertySet PropMods)
Parameter |
Description |
---|---|
PropMods |
Modifications to the geocode service properties. Use GetLocatorProperties() to return default locator properties. |
Return Value
A Fields object containing one of more Field objects, each representing information about a geocoded address. Both intersection and non-intersection addresses will return the same result fields.
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...). |
The PropMods parameter is a PropertySet containing the geocode service properties used when locating an address. These properties are returned by the GetLocatorProperties() method. Only a few locator properties will modify the result fields collection. If a property is true, the result fields will be included in a geocode result. If false, the fields will not be included. The locator properties and corresponding result fields are listed below:
Locator property name |
Result field(s) |
---|---|
WriteXYCoordFields |
X, Y |
WriteStandardizedAddressField (Applies to Pre-ArcGIS 10 locators only) |
Stan_addr |
WriteReferenceIDField |
Ref_ID |
WritePercentAlongField |
Pct_along |
To modify locator properties, modify the properties in the PropertySet returned by the GetLocatorProperties() method and pass the modified object as the PropMods parameter. The PropertySet only needs to contain properties that are different than the default properties for the geocode service. If you do not need to modify any of the default properties returned used by the geocode service, the PropMods parameter can be null or you can pass the unmodified PropertySet returned by the GetLocatorProperties() method.
Examples
C#
GeocodeService_GeocodeServer geocodeservice = new GeocodeService_GeocodeServer();
geocodeservice.Url = "http://localhost:6080/arcgis/services/GeocodeService/GeocodeServer";
PropertySet propertymods = geocodeservice.GetLocatorProperties();
Fields candidatefields = geocodeservice.GetResultFields(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.GetResultFields(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 GetResultFields
PropertySet propertyMods3 = geocodeService.getLocatorProperties();
Fields resultFields = geocodeService.getResultFields(propertyMods3);
Set<String> setOfResultFields = new HashSet<String>();
System.out.println("Result Fields...");
for (Field candidateField : resultFields.getFieldArray()) {
System.out.println(candidateField.getName());
setOfResultFields.add(candidateField.getName());
}