MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Finding Streets by coordinates

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


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion > Development

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-02-2008
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 02-02-2008
Senior Member
Blue Belt
 
Join Date: Dec 2002
Posts: 249
Re: Finding Streets by coordinates

Hi Peter,

Look up the ObjectFromPoint method.

Mike Mattys
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 02-03-2008
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 02-04-2008
Junior Member
White Belt
 
Join Date: Apr 2004
Posts: 10
Send a message via ICQ to 208_Fireball
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 02-05-2008
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 02-05-2008
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,122
Re: Finding Streets by coordinates

Hi,

Yes, you can set the active map's Visible to false. it also will speed up.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
coordinates, finding, streets


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Finding populations donnagreek MapPoint 2006/2009 Discussion 2 08-28-2008 11:02 PM
MapPoint, Pocket Streets, Streets and Trips chpw MapPoint 2006/2009 Discussion 3 01-04-2006 10:54 AM
thick streets vs. spindly streets - how? Anonymous MapPoint Web Service and Virtual Earth 1 03-08-2005 07:32 AM
MapPoint web-service: THICK streets vs. spindly streets Anonymous MapPoint 2006/2009 Discussion 0 03-07-2005 12:32 PM
How to find Streets reverse out of coordinates Anonymous MapPoint 2006/2009 Discussion 1 03-18-2004 12:09 PM


All times are GMT -5. The time now is 04:53 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


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