Community of MapPoint and Virtual Earth Users and Developers
This is a discussion on How to retrieve nearest city from longitudes and latitud within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hello I have an application over Visual C++ and i need to find the nearest city to an geografic point ...
| |||||||
| Today's Posts | Twitter Feed | Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| How to retrieve nearest city from longitudes and latitud I have an application over Visual C++ and i need to find the nearest city to an geografic point (latitud , longuitud ) . I have the following code but is crashing in the GetStreetAddress() function. Does anyone have any idea ?? Code: CLocation loc,streetLoc;
CFindResults streetResults;
CStreetAddress callejero;
loc = mapa.GetLocation(lat, lon, 0);
loc.GoTo();
streetResults = mapa.ObjectsFromPoint(mapa.LocationToX(loc), mapa.LocationToY(loc));
int numResult=streetResults.GetCount();
int i=1;
while ( i <=numResult)
{
VARIANT idx;
VariantInit( &idx );
V_VT(&idx) = VT_I4;
V_I4(&idx) = 1;
streetLoc=streetResults.GetItem( &idx );
szLocalidad=streetLoc.GetLocation().GetName();
callejero=streetLoc.GetStreetAddress();
i++;
}
|
| |||
|
Hi, "Crashing" does not mean muthc. Put you code into an exeption blockand reply with the exact error you have. This way we can help more.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
|
Hi, I dont think there is a GetStreetAddress method in a Location object. I think what you are looking for is the StreetAddress property, so: Code: callejero = streetLoc.StreetAddress;
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| Tags |
| city, latitud, longitudes, nearest, retrieve |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to retrieve complete address from longitudes and latitud | Learner | MapPoint 2006/2009 Discussion | 14 | 01-04-2007 08:40 AM |
| Is it possible to calculate latitud/longitud through address | Learner | MapPoint 2006/2009 Discussion | 1 | 03-08-2006 12:15 PM |
| MapPoint can't import near-zero longitudes? | random | MapPoint 2006/2009 Discussion | 6 | 08-25-2004 09:03 AM |
| nearest city of a point | Anonymous | MapPoint 2006/2009 Discussion | 0 | 04-07-2003 06:46 AM |
| How to find nearest city? | Petr Brant | MapPoint 2006/2009 Discussion | 3 | 08-23-2002 01:49 PM |
Bodrum Holiday
Check out the picturesque towns on your Bodrum holiday... Book through UlookUbook!