Programming with StreetMap


About programming with StreetMap

Developers can use the StreetMap (SMRouter) application programming interface (API) to solve point-to-point routes using Smart Data Compression (SDC) street data. This includes ESRI Data & Maps data included with ArcGIS, as well as StreetMap Premium datasets. StreetMap objects are available in the ESRI.ArcGIS.DataSourcesFile namespace.
Included in the StreetMap API are objects to define the intermediate and final stops of the route, objects for adjusting the search parameters, a routing task solver object, as well as objects that provide details of the result path geometry and driving directions.
The first step when creating a route is to create the solver objects factory using SMRouterFactory. Call ISMRouterFactory.CreateRouter, passing in the path to your routing data to create an SMRouter object and return the ISMRouter interface.
To find a route, create an SMPointsCollection object and add your stops to this collection. This object is passed to ISMRouter.Solve, which builds the route and returns the ISMDirections interface that contains the resulting path geometry and driving directions texts.
You can control how the route is built using the following ISMRouter interface members:
  • Preferences—Changes the highways-local roads preference for the router.
  • NetAttributeName—Controls whether the quickest or shortest route will be built by the router.
  • Barriers—Used to disable routing network points.
  • TripPlanSettings—Configures time frames for driving and resting periods of the trip.
  • ReorderStops—Automatically optimizes the order of several stops (traveling salesperson problem).


See Also:

Sample: StreetMap routing




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):