Speed Limit or Street Type

Srini
08-23-2005, 08:58 AM
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 :roll:

Wilfried
08-23-2005, 09:04 AM
Hi,

I dont think you can :(
But how do you extract this information with a route object ?

Srini
08-23-2005, 09:22 AM
But how do you extract this information with a route object ?
I am not sure :? . 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 :oops: . 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

Wilfried
08-23-2005, 11:39 AM
Hi,

You need exacly what I needed a while ago but I could not find it :( Maybe someone else knows it _if_ it is exposed in the API...

Srini
08-24-2005, 09:44 AM
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

Wilfried
08-24-2005, 01:39 PM
Hi Srini,

or Mappoint takes into consideration turns and stops etc.

Great idea, but I think you right, wont work...

 
Web mp2kmag.com
mapforums.com