PDA

View Full Version : Extract counties traversed from route



dpopken
09-06-2011, 03:53 PM
I have a client who would like to extract a list of counties visited, and ideally, county sojourn times from a route. I know that a county can be extracted from a point, but is there a way to get that from a route? (e.g. chop up the route into points)

Thanks

Eric Frost
09-06-2011, 04:45 PM
Hi Doug,

Yes, in fact I discuss this in a recent newsletter, see Extracting Coordinates from a Route --

MapForums Downloads Section Including Many MapPoint Utilities Including "Extract Coordinates of a Route" (http://www.mp2kmag.com/update/mappoint.newsletter/2011-05-05/)

Same newsletter in which your articles were published... now I know no one reads the newsletters, lol.

Obviously for counties you wouldn't need so many points (speed limit, etc. to maximize # of points), but if you want to make sure you capture counties of which you only go through a portion or straight through on an interstate, you might set the rest stop parameter to something low or lower....

Since you're a valued contributor, I upgraded your account so you can access the attachments in the Downloads section.

hope this helps!

Eric

P.S. If anyone wants to contribute something (interesting content for our readers) I'd be happy to upgrade your account as well :-)




.

dpopken
09-08-2011, 12:36 PM
Thanks Eric,

That saved me some time fumbling around for an approach. Given a "dir" element in your objRoute.Directions, I am converting to a point and then using objMap.ObjectsFromPoint(X, Y) to get a set of objects that I filter to get counties. Turns out it is possible to get more than 1 county object returned. I am selecting the closest one distance wise. MapPoint has some other anomalies to handle. You can flip back and forth between counties within a very short road interval, even though the map shows all of these occurring within 1 county, so I am tossing out counties that show a traversal of less than 1 mile. Keeps life interesting.