How can I extract the street type from a Location object. I am reverse geocoding Lat/Lon from NMEA data and want to get the speed or the RoadType. Can I get this without creating a route object and adding them as waypoints ?
Thanks![]()
This is a discussion on Speed Limit or Street Type within the MapPoint Desktop Discussion forums, part of the Map Forums category; How can I extract the street type from a Location object. I am reverse geocoding Lat/Lon from NMEA data and ...
How can I extract the street type from a Location object. I am reverse geocoding Lat/Lon from NMEA data and want to get the speed or the RoadType. Can I get this without creating a route object and adding them as waypoints ?
Thanks![]()
Hi,
I dont think you can
But how do you extract this information with a route object ?
rgds, Wilfried Mestdagh
www.mestdagh.biz
www.comfortsoftware.be
www.expertsoftware.be
MapPoint coding demo
MapPoint 2011 available, buy now
I am not sureBut how do you extract this information with a route object ?. I was browsing the help and saw this
objRoute.DriverProfile.Speed(geoRoadLimitedAccess) = 55
So I though there might be some way to do it using a Route object to get the geoRoadType. Mappoint has this information as it uses it in computing the time to travel. Its just a question if this is exposed as an API ?
I cannot believe MS would not expose such crucial data for most mapping needs.
Thanks
Hi,
You need exacly what I needed a while ago but I could not find itMaybe someone else knows it _if_ it is exposed in the API...
rgds, Wilfried Mestdagh
www.mestdagh.biz
www.comfortsoftware.be
www.expertsoftware.be
MapPoint coding demo
MapPoint 2011 available, buy now
I tried this trick but it does not work. The idea was to get the drive time and distance to a very close location and compute the speed. But the speed is too low. Either I am missing something or Mappoint takes into consideration turns and stops etc.
try
{
MapPoint.Location Loc;
Loc = MP.ActiveMap.GetLocation(32.897125,-117.119782,1.0);
MP.ActiveMap.ActiveRoute.Waypoints.Add(Loc,"Loc1") ;
MapPoint.FindResults FR = Loc.FindNearby(1.0);
object O = null;
//Get the farthest object
foreach(object L in FR)
{
O = L;
}
MP.ActiveMap.ActiveRoute.Waypoints.Add(O,"Loc2");
MP.ActiveMap.ActiveRoute.Calculate();
double d = MP.ActiveMap.ActiveRoute.Distance;
double t = MP.ActiveMap.ActiveRoute.DrivingTime ;
double t1 = t*24; //Same result if divide by geoOneHour
double s = d/t1;
MessageBox.Show("Distance = " + d.ToString() + "\r\nTime=" + t1.ToString() + "\r\nSpeed=" + s.ToString(),"Ave Speed" );
}
catch(Exception E)
{
MessageBox.Show(E.Message.ToString());
}
Can anyone shed some light on why the result is not correct ? The speed comes to around 4 MPH if get the nearest and about 12 for farthest.
Thanks
Hi Srini,
Great idea, but I think you right, wont work...or Mappoint takes into consideration turns and stops etc.
rgds, Wilfried Mestdagh
www.mestdagh.biz
www.comfortsoftware.be
www.expertsoftware.be
MapPoint coding demo
MapPoint 2011 available, buy now
There are currently 1 users browsing this thread. (0 members and 1 guests)