GeocodeResourceManager control


In this topic


About the GeocodeResourceManager control


Use the GeocodeResourceManager control to add, remove, and set properties for data sources that provide geocoding capabilities. ArcGIS Server, ArcIMS and Bing Maps data sources can be utilized. The FindAddressTask control uses resources provided by the GeocodeResourceManager to geocode address or variable (for example, place name or landmark) inputs. The IGeocodeResource and IGeocodeFunctionality interfaces in the common application programming interface (API) enables you to work with a geocode service programmatically. 
Local (DCOM) connections are only supported for ArcGIS Server versions prior to 10.1.

Using the control

  1. To add the GeocodeResourceManager control, open or create a Web site in Visual Studio. Open a Web form in design mode, select the Toolbox panel, and expand the ArcGIS Web Controls tab. Drag and drop a GeocodeResourceManager on the Web form. See the following screen shot that shows the added control in Visual Studio:


The GeocodeResourceManager is only visible at design time.
  1. To add geocode resources to use in your Web application, click the control, open or navigate to the Properties window, and click the ellipsis button next to the ResourceItems property. The GeocodeResourceItem Collection Editor dialog box appears. See the following screen shot:


  2. On the GeocodeResourceItem Collection Editor dialog box, click the Add button to add a data source as a geocode resource to the GeocodeResourceManager control. A GeocodeResourceItem is added to the collection. GeocodeResourceItem has properties to modify the behavior of the resource, such as minimum candidate score, minimum match score, and whether to show or not show all match candidates. Candidate and match scores for an address are determined by the geocode service, not the Web Application Developer Framework (ADF). Each data source utilizes different, although related, methods for managing geocode parameters to calculate scores. 

    The following properties can be modified for a GeocodeResourceItem on the Collection Editor dialog box:
    • MinCandidateScore—A value between 0–100. When a geocode service searches for likely candidates in the reference data, it uses this threshold to filter the returned results. Locations that yield a score lower than this threshold are not returned. If the geocode service cannot find candidates for an address that you want to geocode, lower this setting to return candidates with lower scores. By default, this value is set to the value defined by the service.
    • MinMatchScore—A value between 0–100. The minimum match score lets you control how addresses match their most likely candidate in the reference data to be considered a match for the address. A perfect match yields a score of 100. A match score between 80 and 99 can generally be considered a good match. An address below the minimum match score is considered to have no match, but can still be a candidate depending on the MinCandidateScore value. By default, this value is defined by the service. If your application demands that addresses be located with a high level of confidence, set a higher minimum match score. If you want to maximize the number of addresses that can be matched and do not mind if some addresses are matched incorrectly, you can use a lower setting.  
    • ShowAllCandidates—Set to true or false. If set to true, all candidates with a score greater than the MinCandidateScore are returned. If set to false, only candidates with a score greater than the MinMatchScore are returned. By default, the value is set to false.
    • Name—Used to uniquely identify the resource in the Web application. Set the resource name to a descriptive value in your application. 
    • Definition—On the GeocodeResourceItem Collection Editor dialog box, the Definition property results in a set of dialog boxes to connect to a data source provider and create a geocode resource. When you click the ellipsis button for the Definition property, the following Geocode Resource Definition Editor dialog box appears:



      The following describes the fields on the preceding Geocode Resource Definition Editor dialog box:
      • Type—The type of data source and applicable properties. 
      • Data Source—Uniform resource locator (URL) to an ArcGIS Server service catalog or local machine name, and optional connection port. Some data sources support authentication. 
      • Identity—Defines the applicable runtime credentials to connect to the data source and utilize the resource. 
      • Resource—Defines the geocode service to use when working with the resource. The format of each property string is defined by the type of data source. 
The following are the available data source types:
    • ArcGIS Server Local—Connecting to an ArcGIS Server Local data source requires the machine name (connection host) on which the server object manager (SOM) is running. When clicked, the Additional GIS Servers button enables configuration of a fail-over or round-robin connection for the resource. For more information, see Using the connection library

      Once the data source is defined, the ArcGIS Resource Definition Editor dialog box appears with a list of available geocode services. See the following screen shots:



      On the preceding Geocode Resource Definition Editor dialog box, the Identity property is unavailable and cannot be set. At design time, the identity of the user running Visual Studio is used to connect to an ArcGIS Server local data source. At runtime, that identity is established by the Web application. Only one identity can be used to define access to all ArcGIS Server local data sources in a single Web application. This identity can be explicitly defined when building the Web ADF application in Visual Studio by right-clicking the Web project in the Solution Explorer, then selecting Add ArcGIS Identity. The ArcGIS Identity dialog box appears.

      On the Add ArcGIS Identity dialog box, type the identity credentials that will be used to access ArcGIS Server local resources at runtime. This information is added to the web.config file within a standard ASP.NET identity tag. If the "Encrypt identity in web.config" check box is selected, the identity tag will be encrypted; otherwise, the user name and password will be stored as clear text.

      See the following screen shots that show the Add ArcGIS Identity option in Visual Studio's Solution Explorer and the resulting Add ArcGIS Identity dialog box:


    • ArcGIS Server Internet—Requires typing the partial URL to the ArcGIS Manager collection of services. This URL includes the Web server host name, ArcGIS instance, and "services" folder name. This general URL provides a list of ArcGIS Server Web Services to choose from.

      If authentication is enabled for an ArcGIS Server Web service, provide a user name and password to gain access to the Web services. ArcGIS Server Web services use basic authentication; therefore, the user name and password are Base64 encoded and included in the Hypertext Transfer Protocol (HTTP) request to the Web server. Since this is inherently insecure, confirm that your Web site provides a secure channel for communication—namely, it has enabled Secure Sockets Layer (SSL) encryption accessible through a Hypertext Transfer Protocol Secure (HTTPS) connection. This sufficiently encrypts the transmission of identity credentials for basic authentication.       

      Once the data source and identity are entered, the Resource property contains a list of available geocode services. The identity determines the available services. If no identity is specified, the remote Web server assigns an identity (often an anonymous user account). See the following screen shots:


    • ArcIMS—Has the following options for connecting to services:
      • TCP—If the Web ADF application has direct access to the ArcIMS application server, you can create a Transmission Control Protocol (TCP) connection. Specify the host name of the machine on which the ArcIMS application server is running and the connection port (default, 5300). TCP connections do not use authentication; therefore, the identity credentials are not used. 
      • HTTP—If the Web ADF application has access to a Web server that exposes the ArcIMS Servlet Connector, you can create a HTTP connection. Specify the Web server host name, and the Web ADF determines if an appropriate endpoint is available. You can also specify a full path to the endpoint. By default, the Servlet Connector path is /servlet/com.esri.esrimap.Esrimap. If authentication is enabled, type the applicable information in the ArcIMS Identity Editor dialog box.

        On the ArcIMS Data Source Definition Editor dialog box, click the Additional IMS Servers button to configure a fail-over or round-robin connection for the resource. 

        Once the connection properties are set, use the ArcIMS Geocode Resource Definition Editor dialog box to select an image service that has geocoding enabled. To enable geocoding on an ArcIMS image service, configure at least one layer in the service for geocoding. Once the service is selected, choose the layer in the service that will be utilized in the Web ADF as a geocode resource. See the following screen shots:



 
    • Bing Maps—The Microsoft Live Services software development kit (SDK) hosts a Bing Maps (formerly known as Virtual Earth) geocode service for address and place matching. Bing Maps has the following service environments—staging and production. 

      The staging environment supports development and testing use of Bing Maps services and are free of charge. The production environment has optimized services to support deployed applications and requires a license fee; therefore, each service needs a Bing Maps account ID. For information on how to get existing account information or to create an account, see Working with data sources.

      When adding a Bing Maps resource item, type the account ID and password on the Bing Maps Identity Editor dialog box.

      Since there is only one Bing Maps geocode service, you can only select between the staging and production environments on the Resource Definition Editor dialog box. If you have not received a license to use the Bing Maps production environment, select the "Use staging server" check box. See the following screen shots:

  1. To utilize the resources in the GeocodeResourceManager, add a FindAddressTask control. The FindAddressTask control works with one geocode resource at a time. You can also utilize geocode resources programmatically via geocode functionalities. Composite geocoding is also possible using the Web ADF, but requires custom programming. Composite geocoding combines and utilizes a set of geocoding services for a single address matching process. The geocoding services are assigned a priority where if the first service (highest priority) does not provide an adequate match, the next service is used. The process continues until a successful match is returned or all geocode services are unable to return a candidate.
Microsoft Bing Maps API Terms of Use specifies that all Bing Maps Geocode services results must be displayed on a Bing Maps basemap.
Remember, there are specific restrictions when using Bing Maps geocoding:
  • Geocodes may not be stored for any purpose except caching for performance.
  • Geocodes may not be displayed on any map other than a Bing Map.
For more information on the Bing Maps Terms of Use when using Esri products, see the Microsoft Bing Maps Services Terms of Use.

Members

The following table shows a list of properties related to the GeocodeResourceManager control. For more reference information, see the GeocodeResourceManager control in the library reference section.
Property name
Type
Description
ResourceItems
GISResourceItemCollection
GeocodeResourceItem collection managed by this control.


See Also:

Using the connection library
Working with data sources
Web ADF controls
Customizing the Web Mapping Application




To use the code in this topic, reference the following assemblies in your Visual Studio project. In the code files, you will need using (C#) or Imports (VB .NET) directives for the corresponding namespaces (given in parenthesis below if different from the assembly name):
  • ESRI.ArcGIS.ADF.Web.UI.WebControls.dll