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
Results 1 to 6 of 6

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. #1
    dambrowsky is offline Junior Member White Belt
    Join Date
    Oct 2007
    Posts
    3

    Red face 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. #2
    Mattys Consulting's Avatar
    Mattys Consulting is offline Senior Member Black Belt
    Join Date
    Dec 2002
    Posts
    1,040

    Re: Finding Streets by coordinates

    Hi Peter,

    Look up the ObjectFromPoint method.

    Mike Mattys

  3. #3
    dambrowsky is offline 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. #4
    208_Fireball is offline 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;
    	CMPStreetAddress saddrLocation;
    	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);
    
    			saddrLocation = locTemp.GetStreetAddress();
    
    			if (saddrLocation.m_lpDispatch != NULL) {
    				strResult = saddrLocation.GetValue();
    			}
    		}
    	}
    
    	return strResult;
    }
    Cheers,

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

  5. #5
    dambrowsky is offline 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. #6
    Wilfried is offline 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.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Finding populations
    By donnagreek in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 02-20-2009, 10:48 AM
  2. MapPoint, Pocket Streets, Streets and Trips
    By chpw in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 01-04-2006, 10:54 AM
  3. thick streets vs. spindly streets - how?
    By Anonymous in forum Bing Maps and MapPoint Web Service
    Replies: 1
    Last Post: 03-08-2005, 07:32 AM
  4. MapPoint web-service: THICK streets vs. spindly streets
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 03-07-2005, 12:32 PM
  5. How to find Streets reverse out of coordinates
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 03-18-2004, 12:09 PM

Tags for this Thread

Posting Permissions

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


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 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85