|
|
|||
|
|
Finding the segment that references points in Geometry objects
The route is sent back as a Geometry
object, which includes the following attributes:
parts: integer[]
points: SimplePoint[]
The parts array points to the beginning of each part in the points array.
If, for example, you had a route with three parts and 100 points, the
parts array could look like {0,25,70}. This would mean that points 0–24 make up
the first segment, 25–69
make up the second, and 70–99
make up the third, with each segment containing several points. The segment
starts at a particular turn (e.g., getting onto the highway) and ends
at another turn (e.g., getting off the highway). The road in between could
be curvy, in which case, the geometry would contain many points.
To get back the start point and endpoint of a particular segment (Java example):
Point startPoint = route.points[route.parts[segmentNum]];
Point endPoint = route.points[route.parts[segmentNum+1] - 1];
To get all points within a segment, iterate through all points (Java example):
for (int i = route.parts[segmentNum]; i < route.parts[segmentNum+1];
i ++){
Point p = route.points[i];
}
Data sources for route and map
Route Finder requires one data source for the route and one for the map. These do not have to be the same data source. For making a map of the route, you can use any data source available for Map Image Web Service. If you send a route data source but no map data source and request a map, Route Finder uses the route data source for the map.
A route map, turn-by-turn maps, and/or route icons cost additional credits to the credit charge for the route.
Segment envelopes, total envelope and route geometry are always projection "4326" (GCS), regardless of your input RouteStop coordinate system.
The RouteOptions object has a parameter, precision, that sets the shape generalization of the route. The larger the value, the more generalized the shape (and the faster the response time). There is no upper limit. If a map is requested from the Map Image Web Service, precision is ignored and the route is generalized to the resolution of the map. The parameter specifies the minimum distance (usually in decimal degrees) between the vertices on the route, for example, 0.001 and 0.000000001 are reasonable values. The larger the number (higher precision/more generalization), the fewer points are used to draw the route. You could, for example, set precision to the pixel size in decimal degrees of your map. That would give you a route that had a maximum of one point per pixel and a relatively fast drawing time. The default value for precision is "0.0", which means no generalization. It is not used when a map image is included with the route.
If the route geometry has more than 10,000 points, it needs to be generalized using RouteOption.precision. Otherwise, an error is returned.
Route Finder Web Service currently supports ferry as well as road networks. The ferry schedule (i.e., waiting for an available ferry) is not factored into drive time.
Below is a list of the routing terminology used in Route Finder.
|
< 1 minute |
End of day |
mile(s) |
Straight |
|
0 minute |
Enter |
miles |
Take |
|
and go |
Go |
minute |
Take ramp in direction |
|
Arrive |
go |
minute(s) |
take ramp in direction |
|
Arrive at |
Go back |
minutes |
Take ramp to |
|
At exit |
hour |
North |
take ramp to |
|
Bear |
hour(s) |
North East |
Take roundabout and proceed |
|
Continue |
hours |
North West |
to |
|
Day |
in direction |
on |
Total travel time |
|
day(s) |
kilometer |
Rest break for |
Turn |
|
Depart |
kilometer(s) |
right |
unnamed ferry |
|
Drive |
kilometers |
South |
West |
|
Driving distance |
left |
South East |
|
|
Driving time |
Make sharp |
South West |
|
|
East |
mile |
Stay on |
|
Route Finder supports Danish, Dutch, English, French, German, Italian, Norwegian, Portuguese, Spanish, and Swedish.
Route stop locations must be within one-fifth mile of a routable street segment or Route Finder returns an error (2011).
ArcWeb:TC.Traffic.US is currently the valid data source for the parameter RouteFinderOptions:trafficDataSource. You can create custom route barriers by populating the parameter RouteOptions.routeBarriers[] with points. To use custom barriers, leave RouteFinderOptions:avoidTraffic=false and RouteFinderOptions:trafficDataSource=null. See Building spatial query services for more information on creating custom spatial query data sources.
NOTE: The route barriers must be exactly on the route.
RouteFinderOptions.trafficSeverity values come from the data source ArcWeb:TC.Traffic.US.
Route optimization, set through the parameter RouteOptions.optimizeStops, solves the traveling salesperson problem (TSP) of the optimal order of your midroute points. Typically, TSP routing has the same start point and endpoint (in other words, the route is round-trip and not point-to-point), but this does not need to be the case for Route Finder to optimize your route. The start point and endpoint of a route are not factored in to the optimization formula.
There is no limit to the number of route stops you can enter in your request. However, you may notice a decrease in performance (or even an error) if you send in a large number of stops.
Visit the Feedback page to give comments or suggestions about the ArcWeb Developer's Guide.