tags:

views:

478

answers:

2

I've got a list of points, and a route that an external provider has generated through those points.

I would like to generate a route using those same point with my own road network.

Then I want to be able to detect if there is any significant difference between the two routes.

One suggestion is that for the 2 routes, we find out what road segments they travel across, and compare the list of road segments?

Is this a valid approach? How do we go about getting the list of road segments given a route?

I am using ArcGis server 9.3 with Java 5 and Oracle 10g. I am using the ST functions and NetworkAnalyst via the java api.

Thanks.

A: 

I've just implemented something similar in my application. I have a list of lat/long coordinates from a GPS device and needed to create a route based on this data.

I started by matching each GPS position with a node in my street network. I then removed 'consecutively duplicate' nodes to filter out those consecutive positions that are at the same node. Then, I started 'walking' through my street network, starting at the first node. I checked the first node and second node and checked for a common street segment. If I found one, great. If not, I create a shortest path between the 2 nodes and use those roads instead. I continue doing this until I've examined all the nodes. At the end of this process, I have a list of road segments that the vehicle traveled and the order in which they were traveled, too.

Unfortunately, I'm using a different map, different programming language, and different database. As such, sharing the code won't be helpful to you at all. Hopefully the process I described above will be enough help for you to accomplish your task.

G Mastros
+1  A: 

Calculate the route using your points and road network. Then buffer the resulting route into a polygon (the buffer radius should be your "tolerance"). Then clip the external route using your polygon. If the resulting polyline is non-empty, then there is a deviation outside of your tolerance.

This method does not acount for any "significant" deviations such as backtracking, U-Turns, or taking a nearby parallel road.

Alternatively, you can compare the resulting "directions" and check for deviations there--particuarly using street names. This saves you from checking every road segment. If you have any deviations in road names, then check the individual road segments of each section.

James Schek