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

## Finding Streets by coordinates

This is a discussion on Finding Streets by coordinates within the Development forums, part of the MapPoint Desktop Discussion category; Dear specialists, I have coordinates (wsg84) and want to get the Adress (Town, Street and so on). How is it ...

1. Junior Member White Belt
Join Date
Oct 2007
Posts
3

## Finding Streets by coordinates

Dear specialists,
I have coordinates (wsg84) and want to get the Adress (Town, Street and so on). How is it possible with MapPoint? I know how to get a location object. But how can I find out Town, Street from this object?

Any help is welcome
Best regards
Peter

2. ## Re: Finding Streets by coordinates

Hi Peter,

Look up the ObjectFromPoint method.

Mike Mattys

3. Junior Member White Belt
Join Date
Oct 2007
Posts
3

## Re: Finding Streets by coordinates

Hi Mike,
Thank you for quick answer and the Tip. I will try to use it and then we will see what will happen.

Best regards
Peter

4. Junior Member White Belt
Join Date
Apr 2004
Posts
10

## Re: Finding Streets by coordinates

Note that ObjectsFromPoint takes screen coordinates, not latitudes and longitudes.

The process you might want to follow is:

- Form a Location with your desired lat/lon
- Move to that location
- Find the screen X,Y coordinates for that location
- Call ObjectsFromPoint for that X,Y.

In C++, you might call the following code. This is mostly from my head and hasn't been tested. Your class names may also differ slightly.

Code:
```CString GetStreetName(double dLat, double dLon, double dAlt)
{
CMPMap thisMap;
CMPLocation locTest;
CMPLocation locTemp;
CMPFindResults mpFindResults;
long lXPos;
long lYPos;
CString strResult = _T(""); // default
int nFound;
VARIANT vItem;

thisMap = m_mapMain.GetActiveMap();
locTest = thisMap.GetLocation(dLat, dLon, dAlt);
locTest.GoTo();
lXPos = thisMap.LocationToX(locTest);
lYPos = thisMap.LocationToY(locTest);

if ((lXPos != -1) && (lYPos != -1)) {
mpFindResults = thisMap.ObjectsFromPoint(lXPos, lYPos);

nFound = mpFindResults.GetCount();

if (nFound > 0) {
locTemp = mpFindResults.GetItem(&vItem);

if (saddrLocation.m_lpDispatch != NULL) {
}
}
}

return strResult;
}```
Cheers,

Dave
Last edited by 208_Fireball; 02-04-2008 at 07:44 PM.

5. Junior Member White Belt
Join Date
Oct 2007
Posts
3

## Re: Finding Streets by coordinates

Hi Dave,
THank you. What you wrote is exectly what I do (in VB6). Is there a possibility to get the same result without displaing the chart? That means that I want to have a small software with input of the coordinates and output the adresse (city, street and so on) and no chart is shown.

Best regards
Peter

6. Senior Member Black Belt
Join Date
Nov 2004
Location
Belgium
Posts
2,433

## Re: Finding Streets by coordinates

Hi,

Yes, you can set the active map's Visible to false. it also will speed up.

##### Users Browsing this Thread

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

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•