Geocode service GetAddressFields method
Fields used to define address information submitted to a geocode service.
GetAddressFields()
Return Value
A Fields object containing one of more Field objects. Each field is an input field for the geocode service.
Remarks
Every geocode service defines one or more address fields - which are input fields used by a client to submit address information to be geocoded. Each field maintains a set of important properties, some of which are included in the table below:
Property name |
Description |
---|---|
Name |
Input field name defined by the geocode service. This is used by the client to submit the appropriate address information to the correct input field. |
AliasName |
A descriptive name for the input field. This may be used by a client to provide more intuitive information regarding the field content. |
Required |
Determines if the address information must be provided for this field during a geocode operation. If not required, the geocoding operation will proceed but the match score may be adversely affected. |
Type |
The data type expected for the field. In most cases, the data type will be a string. |
Defines address information associated with inputs to the FindAddressCandidates(), GeocodeAddress(), and GeocodeAddresses() methods.
Examples
C#
GeocodeService_GeocodeServer geocodeservice = new GeocodeService_GeocodeServer();
geocodeservice.Url = "http://localhost:6080/arcgis/services/GeocodeService/GeocodeServer";
Fields addressfields = geocodeservice.GetAddressFields();
foreach (Field addressfield in addressfields.FieldArray)
{
// Input field name
System.Diagnostics.Debug.WriteLine("Name: " + addressfield.Name);
// Descriptive name
System.Diagnostics.Debug.WriteLine("Alias Name: " + addressfield.AliasName);
// Is required?
System.Diagnostics.Debug.WriteLine("Required: " + addressfield.Required.ToString());
// Data type
System.Diagnostics.Debug.WriteLine("Type: " + addressfield.Type.ToString());
}
VB.NET
Dim geocodeservice As GeocodeService_GeocodeServer = New GeocodeService_GeocodeServer()
geocodeservice.Url = "http://localhost:6080/arcgis/services/GeocodeService/GeocodeServer"
Dim addressfields As Fields = geocodeservice.GetAddressFields()
Dim addressfield As Field
For Each addressfield In addressfields.FieldArray
' Input field name
System.Diagnostics.Debug.WriteLine("Name: " + addressfield.Name)
' Descriptive name
System.Diagnostics.Debug.WriteLine("Alias Name: " + addressfield.AliasName)
' Is required?
System.Diagnostics.Debug.WriteLine("Required: " + addressfield.Required.ToString())
' Data type
System.Diagnostics.Debug.WriteLine("Type: " + addressfield.Type.ToString())
Next
Java
String serviceURL = "http://localhost:6080/arcgis/services/GeocodeService/GeocodeServer";
GeocodeServerBindingStub geocodeService = new GeocodeServerBindingStub(serviceURL);
//Test GetAddressFields
Fields addressFields = geocodeService.getAddressFields();
Set<String> setOfAddressFields = new HashSet<String>();
System.out.println("Address Field Names...");
for (Field addressField : addressFields.getFieldArray()) {
System.out.println(addressField.getName());
setOfAddressFields.add(addressField.getName());
}