Welcome to MapForums!

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Extracting Coordinates of a Route

This is a discussion on Extracting Coordinates of a Route within the MapForums Plus Downloads forums, part of the MapForums Plus category; This is a new tool which lets you extract the approximate coordinates of a route object. If does this by ...

1. Extracting Coordinates of a Route

This is a new tool which lets you extract the approximate coordinates of a route object.

If does this by adding a rest stop every 1 minute and programmatically setting all the speeds to 1 mile per hour, and then looping over all the directions and writing out their coordinates which approximates the coordinates of the route.

I say the the coordinates of the directions approximate the coordinates of the route, because they don't capture every turn, and where there are turns or curves, they do not necessary always fall exactly on the route.

In any case, it would be good enough for many visualization purposes.

This was originally developed based on ideas posted and discussed by Mattys Consulting, blue jay, Wilfried, and Winwaed in this thread: How to get GPS coordinates by interval on the route in mappoint

Instructions

When you open the Excel file, be sure to Enable Macros or Options | Enable this content -- depending on your version of Excel, the screenshot below it from Excel 2007.

Next -- click Sample Data to generate a sample route between Chicago and St. Louis, then click Begin to set the routing parameters (slow speeds and lots of rest stops) and write out the coordinates of the route.

You could then save the spreadsheet import all the lat/lon's back up top of the route (you can use the named range "Sequence") to see how well the extracted direction coordinate match the route.

One improvement I can see just looking at the screenshot above is to make Interstates and Toll Roads "preferred" as otherwise with all speeds set to 1 mph, it always takes the shortest network path often on local roads which would not make sense for a city-to-city trip. Alternatively you could set the interstate and highways speeds to 2 mph.

Have fun and let me know if you see any other ways to make improvements or if you have any requests!

Eric
Last edited by Eric Frost; 05-04-2011 at 02:50 PM.

2. Junior Member White Belt
Join Date
May 2011
Posts
3

Re: Extracting Coordinates of a Route

This is my first post and have a question on the extracting coordinates of a route application.

I attempted to us the app but am getting an compile error. The message is "method or data member not found". I am using MapPoint 2006, if that makes any differentce. I follow the instructions and have open instance of MapPoint with a route already calculated. By "calcaulated" i take it to mean that i have one map point as my beginning and another map point at the ending of my route. I then get the directions. i then hit the "begin" button in the Ecell application. That is when the error message appears. What am I going wrong?

Thanks, Don Burgess

3. Re: Extracting Coordinates of a Route

Is there a particular line or something that it highlights when it hangs up?

I only tested with MapPoint 2011, and it's possible there's some new property or method I'm using that didn't exist with MapPoint 2006.

They added a lot with the release of the MapPoint 2010 version.

Eric

4. Re: Extracting Coordinates of a Route

Do you want to post your PTM file as a zip attachment? I can test.

5. Junior Member White Belt
Join Date
May 2011
Posts
3

Re: Extracting Coordinates of a Route

Actually, there was a line in the code that hung up. the line with the word "zoom" was messing it up. I just deleted that line and the app worked just fine.

Don

6. Re: Extracting Coordinates of a Route

Ah yeah, the .ZoomTo method of the route object was added with MapPoint 2010.. previously the .ZoomTo method only worked with the DataSet object or DataSets collection.

The list below is from the MapPoint 2010 Help file --

Methods
The new methods for Microsoft MapPoint 2010 are:
• ImportGPX (Application and MappointControl objects)
• ExportGPX (Application and MappointControl objects)
• Reverse (Route object)
• UpdateConstruction (Route object)
• ZoomTo (Route object)
• BasicRenderingOnly (Map object)
• DefaultRendering (Map object)
• ShowInOnlineMap (Map object)
• SendToMobile (Map object)
• ExportToExcel (SelectedArea object)
Last edited by Eric Frost; 05-09-2011 at 08:09 AM.

7. Junior Member White Belt
Join Date
May 2011
Posts
3

Re: Extracting Coordinates of a Route

Eric,

I used the extraction excel file to obtain GPS points along a route and the program work great. However, I would like to obtain coordinates at equal intervals along the route, if possible. Do you know of a program that does that? I can force the current program to approximate want i want but that entails adding way points along the route which takes a long time.

Thanks,

Don Burgess

8. Re: Extracting Coordinates of a Route

Equal intervals -- it's not doing that? It should be stopping every minute for a rest stop and the speeds for all roads are set to 1 mph, so I would think they are fairly equal intervals? I guess not if you are asking. I remember noticing this when I was doing screenshots, but didn't measure the extent.

In any case, unfortunately I'm not sure what can be done. Anyone else have ideas?

Eric

9. Re: Extracting Coordinates of a Route

I did this a few years ago for a company requiring stops every x-amount of feet for the purpose of picking up handicapped/seniors nearby their homes.

The program worked well, but there were shortfalls going around clover-leaf highway-exits and such.

Anyway, I would be willing to work on it again to adapt to your needs
(ie; it is custom development and I do not make source code available.)

10. Re: Extracting Coordinates of a Route

Michael, did you post this in the wrong thread? This was from last May

Eric

Page 1 of 2 12 Last