|
|
Finding the segment that references points in Geometry
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 3 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 very
windy, in which case, the geometry would contain many points.
To get back the start and end points of a particular segment:
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:
for (int i = route.parts[segmentNum]; i < route.parts[segmentNum+1];
i++)
Point p = route.points[i];
Data sources and credits 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.
Segment envelopes, total envelope and route geometry are always projection "4326" (GCS), regardless of your input RouteStop coordinate system.
If the route geometry has more than 10,000 points, it needs to be generalized using the precision parameter in RouteOptions. Otherwise, an error is returned.
The RouteOptions object has a parameter, precision, which 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. The larger the number, 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", which means no generalization. It is not used when a map image is included with the route.
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, Portugese, Spanish, and Swedish.