ArcGIS Server Route Finder


Purpose
This application finds the route between a given origin and destination. This application uses the web service endpoints of ArcGIS Server services. It uses a geocode service endpoint to geocode the address, a network analyst extension endpoint to solve the route, and a map server endpoint to display the route.

How to use

See How to use ArcGIS samples for help on running the sample. 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.

ArcGIS Server Route Finder
  1. Create and start a ArcGIS server map service called SanFrancisco with network analyst capability enabled. Use the map document SanFrancisco.mxd under [developerkit10_install_location]\java\samples\data\SanFrancisco
  2. Create and start a ArcGIS Server geocode service called sfostreets. Use the locator at [developerKit10_install_location]\java\samples\data\SanFrancisco\SanFrancisco.gdb
  3. There are two ways to build the sample. You can either use ArcGIS Ant or Eclipse plugin. To use Ant, at command line, browse to %AGSDEVKITJAVA%\java\samples\ags_route_finder, type arcgisant build, follow the command prompt to finish the build. There will be a directory called build under the sample root folder, inside there will be a war file. Deploy the war file into Tomcat.
  4. The other way to build the sample is to use Eclipse. Open Eclipse, File - New Project - ESRI Templates - Web ADF Samples.
  5. Choose the Route Finder sample.
  6. Provide a map server endpoint URL. The ArcGIS Server webservice endpoint would http://[host]:8399/arcgis/services/sfo/MapServer <br />
  7. Provide a geoceode server endpoint URL. The ArcGIS Server web service endpoint would be http://[host]:8399/arcgis/services/sfostreets/GeocodeServer <br />
  8. The web application for the sample will be created under the folder called build.
  9. Deploy the web application in any supported servlet engine or application server.
  10. After deployment access the sample by typing the URL (e.g. http://[host]:[port]/[samplename]) in a web browser. The default sample name is ags_route_finder
  11. Type in an origin, for example, 200 Ashbury St 94117, and destination address, for example, 312 Garces Dr 94132, and click on the button "Find Route" The locations are geocode, and the directions displays as text and as graphic on the map.


Download the files for Java
map.jsp The page with a map, overview and toc controls
faces-config.xml Configuration file that describes the resources and functionalities for the application




Development licensing Deployment licensing
Server Server