MapPoint Forums

MapForums

Community of MapPoint and Virtual Earth Users and Developers




Directions from Lat/Long

This is a discussion on Directions from Lat/Long within the MapPoint 2006/2009 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 ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Today's Posts Twitter Feed Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-03-2006
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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 06-03-2006
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 06-04-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,177
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 06-05-2006
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:
Quote:
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 06-05-2006
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 06-05-2006
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 06-05-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,177
Hi,

Good that it is solved. But I do not understeand how (my English is not my native language). Can you elaborate more please ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 06-05-2006
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9 (permalink)  
Old 06-06-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,177
Hi,

Thanks for feedback
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
directions, lat or long


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
Directions Formatting EdB MapPoint 2006/2009 Discussion 0 08-15-2005 10:27 AM
MapPoint and Bad Directions --- SheilaSheila MapPoint 2006/2009 Discussion 2 01-24-2005 11:42 AM
driving directions impala454 MapPoint 2006/2009 Discussion 1 12-11-2004 09:49 AM
Bug with Waypoints in Directions Anonymous MapPoint 2006/2009 Discussion 3 07-21-2003 03:02 PM
Location of directions Anonymous MapPoint 2006/2009 Discussion 1 04-14-2003 02:06 AM


All times are GMT -5. The time now is 01:56 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 RC2
MP2K Magazine
Visitor Map

Thassos Holidays
Visit an unspoilt and beautiful Greek island with Thassos holidays available through UlookUbook.



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