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
Results 1 to 9 of 9

Directions from Lat/Long

This is a discussion on Directions from Lat/Long within the MapPoint Desktop Discussion forums, part of the Map Forums category; I am having a problem getting directions between two locations created with only Lat/Long. I don't care if the locations ...

  1. #1
    revelashon is offline Junior Member Yellow Belt
    Join Date
    Jun 2006
    Posts
    14

    Directions from Lat/Long

    I am having a problem getting directions between two locations created with only Lat/Long. I don't care if the locations do not have addresses. The problem is that for certain starting points, the directions end up like this: "DAY1: Depart from Eastern GMT5 Head South on loacal roads Turn Left on local road....". It spends a few days traveling on local roads before it finds a street, and that street is nowhere near the starting point. In the MapPoint application, I tried creating the same route and it is alway able to find a street in one step: "Head South on local roads Turn right on Main St. ..." I've tried playing with the altitude parameter of getLocation(lat, long, alt) and there is no one altitude that works consistently for all coordinates.

    Does every coordinate have a different ideal altitude?
    How would I know that the route planner got lost on local roads?

  2. #2
    revelashon is offline Junior Member Yellow Belt
    Join Date
    Jun 2006
    Posts
    14
    I found this post:
    http://www.mp2kmag.com/mappoint/disc...ght=directions

    I wonder if my problem has something to do with my preferred roads settings. I'll try it next time I have a chance. Until then can someone please offer some input.

  3. #3
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Hi,

    You have to set altitude to 1 as in the example. This is for most of the MP geo things to have some accuratie.

  4. #4
    revelashon is offline Junior Member Yellow Belt
    Join Date
    Jun 2006
    Posts
    14
    I've tried with the altitude set to 1 and I get the same results. Here is exaclty what some of the directions look like:
    DAY 1
    Depart Eastern (GMT - 5) on Local road(s) (West)
    Turn RIGHT (North) onto Local road(s)
    Bear LEFT (North) onto Local road(s)
    Turn LEFT (West) onto Local road(s)
    Turn LEFT (South) onto Local road(s)
    Turn RIGHT (North) onto Local road(s)
    Turn RIGHT (North-West) onto Local road(s)
    Turn LEFT (South) onto Local road(s)
    Bear LEFT (South) onto Local road(s)
    Bear LEFT (South-West) onto Local road(s)
    Turn RIGHT (West) onto Local road(s)
    Trips that should only take a few minutes are being scheduled over the course of serveral days. Furthermore, as I had mentioned earlier, in the MapPoint 2004 application's route planner, identical data yeilds proper directions.

  5. #5
    revelashon is offline Junior Member Yellow Belt
    Join Date
    Jun 2006
    Posts
    14
    I made the application visible so I could see the routes for myself and found out that it is starting the routes from the center of "Eastern GMT 5" rather than the location that I specified. I will continue to investigate.

  6. #6
    revelashon is offline Junior Member Yellow Belt
    Join Date
    Jun 2006
    Posts
    14
    I found the problem:
    The ObjectsFromPoint method is returning the center of Eastern GMT 5 as the closest object. This only happens when there aren't any addresses nearby.
    What I did to fix the problem:
    Since I do not require an address for my start point (vehicle GPS location), I simply used the getLocation method on the start point. In my original build this was how it was done, but then I required an address for the end point and that is how I lost track of the requirement for the start point. Everything is fine now.

  7. #7
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Hi,

    Good that it is solved. But I do not understeand how (my English is not my native language). Can you elaborate more please ?

  8. #8
    revelashon is offline Junior Member Yellow Belt
    Join Date
    Jun 2006
    Posts
    14
    Following is the flawed code:
    Code:
    1: location = map.GetLocation(latitude, longitude, altitude);
    2: location.goTo();
    3: results = map.ObjectsFromPoint(map.locationToX(location), map.locationToY(location));
    4: foreach(object sample in results)
    5: {
    6:     if(sample is Location)
    7:     {
    8:           if(!findAddress || sample.StreetAddress != null)
    9:                return sample;
    10:      }
    11: }
    Followed by another method for finding the address if that one failed. The problem occured on line #3. Sometimes MapPoint will return the center of a timezone as the closest object. I think this may be what Gilles Kohl refered to as "'so close, but yet so far' syndrome" in "Reverse Geocoding, Another Method". I changed the code so something similar to the following:
    Code:
    1: location = map.GetLocation(latitude, longitude, altitude);
    2: location.goTo();
    3: results = map.ObjectsFromPoint(map.locationToX(location), map.locationToY(location));
    4: if(findAddress)
    5: {
    6:      foreach(object sample in results)
    7:      {
    8:          if(sample is Location)
    9:          {
    10:               if(sample.StreetAddress != null)
    11:                     return sample;
    12:         }
    13:     }
    14: }
    15: return location;
    Now the original location is returned if no address can be found. Keep this in mind. This code will not find an address for all points, rather in a "don't care" situation it will try to find an address. Should it fail, the name of the location will be the GPS coordinates that it was created from.

  9. #9
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Directions Formatting
    By EdB in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 08-15-2005, 11:27 AM
  2. MapPoint and Bad Directions ---
    By SheilaSheila in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 01-24-2005, 12:42 PM
  3. driving directions
    By impala454 in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 12-11-2004, 10:49 AM
  4. Bug with Waypoints in Directions
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 07-21-2003, 04:02 PM
  5. Location of directions
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 04-14-2003, 03:06 AM

Tags for this Thread

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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81