Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

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

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Page 1 of 2 12 LastLast
Results 1 to 10 of 13
Like Tree1Likes

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. #1
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4

    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

    Download and unzip the attachment below.

    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
    Attached Files Attached Files
    Last edited by Eric Frost; 05-04-2011 at 03:50 PM.
    ~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
    ~~
    ~ Upgrade to Get Access to the MapForums Downloads ~

  2. #2
    DBurgess is offline 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. #3
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4

    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
    ~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
    ~~
    ~ Upgrade to Get Access to the MapForums Downloads ~

  4. #4
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4

    Re: Extracting Coordinates of a Route

    Do you want to post your PTM file as a zip attachment? I can test.
    ~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
    ~~
    ~ Upgrade to Get Access to the MapForums Downloads ~

  5. #5
    DBurgess is offline 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.

    Thanks for the reply.

    Don

  6. #6
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4

    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 09:09 AM.
    ~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
    ~~
    ~ Upgrade to Get Access to the MapForums Downloads ~

  7. #7
    DBurgess is offline 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. #8
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4

    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
    ~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
    ~~
    ~ Upgrade to Get Access to the MapForums Downloads ~

  9. #9
    Mattys Consulting's Avatar
    Mattys Consulting is offline Senior Member Black Belt
    Join Date
    Dec 2002
    Posts
    1,040

    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.)
    Michael R Mattys
    Business Process Developers
    www.mattysconsulting.com

  10. #10
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4

    Re: Extracting Coordinates of a Route

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

    Eric
    ~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
    ~~
    ~ Upgrade to Get Access to the MapForums Downloads ~

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to get GPS coordinates by interval on the route in mappoint
    By blue jay in forum MapPoint Desktop Discussion
    Replies: 8
    Last Post: 01-21-2011, 09:16 AM
  2. Extracting street names from route Instruction
    By Curt in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 06-28-2010, 03:24 AM
  3. Route Display of GPS Coordinates
    By steve.clark@multipart.com in forum Development
    Replies: 0
    Last Post: 12-05-2007, 07:14 PM
  4. Extracting GPS coordinates from MapPoint
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 03-28-2005, 01:44 AM
  5. Extracting the route sequence
    By ivtch in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 03-11-2003, 04:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36