ArcIMS Geocoding


Purpose
This sample demonstrates how to use the ArcIMS application programming interface (API) that is included with the Web Application Developer Framework (ADF) to geocode an address using an ArcIMS image service. Web ADF controls and the Common API are not used in this sample.

How to use

Data has been provided for your use with this sample. It can be found at <Your ArcGIS Developer Kit Install directory>/Samples/data/SanFrancisco.
If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.

At design time
  1. Verify that the Web ADF for the .NET Framework is installed and functioning properly. For information on installing and configuring the Web ADF, consult the installation guide.
  2. Create a map service. This sample requires the SanFrancisco image map service running on an ArcIMS server. Use the SanFrancisco.axl file in <ArcGIS install location>\DeveloperKit10.0\Samples\data\SanFrancisco.
  3. Enable geocoding on the streets layer in the map service. In this sample, the geocode properties have been set in the map configuration file, and the geocoding index files have been generated by default. If you're working with data in a different location, edit the .axl file and change the location defined by the SHAPEWORKSPACE. Recreate the geocode index as well. See the ArcIMS help system for more information.
  4. In Windows Explorer, navigate to <ArcGIS install location<\DeveloperKit10.0\Samples\ServerNET. This folder contains ArcIMS_Geocoding CSharp and VBNet folders.
  5. Open the folder of the language you're going to use—CSharp or VBNet— and copy the ArcIMS_Geocoding_<language> folder to c:\inetpub\wwwroot. The <language> variable can be either CSharp or VBNet.
  6. Open the IIS Manager from Control Panel > Administrative Tools > Internet Information Services (IIS) Manager or Internet Information Services.
  7. In the console tree view on the left, navigate to Local Computer > Web Sites > Default Web Site, expand Default Web Site. right-click the ArcIMS_Geocoding_<language> folder, and click Properties. The Properties dialog box opens.
  8. Click the Directory tab, click the Create button in the Application Settings section, then click OK to close the Properties dialog box.
  9. Start Microsoft Visual Studio 2008 or 2010 and open the ArcIMS_Geocoding_<language><vs_version> solution (for example, ArcIMS_Geocoding_CSharp2008.sln) located in c:\inetpub\wwwroot\ArcIMS_Geocoding_<language>.
  10. In Solution Explorer, right-click Default.aspx and select Set As Start Page.
  11. Open the code file for the default .aspx file (for example, Default.aspx.cs), and change the appservername variable to the name of the machine on which the ArcIMS application server is running.
  12. Set the ArcIMS application server port to 5300, the service name to SanFrancisco, and the geocode layer name to streets. If these values are different, edit the member variables in the code file.
  13. Save the project.
  14. Click the Debug drop-down menu and click Start Debugging.

At run time
  1. Browse to the viewer uniform resource locator (URL) (for example, http://localhost/ArcIMS_Geocoding_CSharp).
  2. Type an address in the Address and ZIP Code text boxes. For example, Address: 1750 Washington St, ZIP Code: 94109.
  3. Select the number of match candidates and minimum score, and click the Geocode button. The match candidates appear in the table below the map, and the map contains a graphic (green star) for each candidate.
  4. Click the Clear Results button to clear the table and map.

ArcIMS_Geocoding_CSharp\Default.aspx Contains the Web user interface to interact with server-side code.
ArcIMS_Geocoding_CSharp\Default.aspx.cs References the ArcIMS API classes and functionality.
Download the C# files
ArcIMS_Geocoding_VBNet\Default.aspx Contains the Web user interface to interact with server-side code.
ArcIMS_Geocoding_VBNet\Default.aspx.vb References the ArcIMS API classes and functionality.
Download the VB.NET files

Download the files for all languages