Community of MapPoint and Virtual Earth Users and Developers
This is a discussion on Has anyone got street address with MapPoint Euro 2004? within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Has anyone got street address in Munich as the result of FindNearby? Of course, FindNearby returns FindResults and from FindResults ...
| |||||||
| Today's Posts | Twitter Feed | Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Has anyone got street address with MapPoint Euro 2004? Of course, FindNearby returns FindResults and from FindResults you can get Location by calling FindResults.GetItem(index). Location object returns StreetAddress object and then finally you suppose to GetStreet from StreetAddress. The FindNearby in Munich returns many restaurants, hotels, but for each one I could not get any street name, they all blank. |
| |||
|
Hi, This is correct. FindNearby gives you "points of interest" so not street adresses. You find some articles on this site to help you on the way, do a search on 'findnearby'. I do it with a vector where I move in a circle with every time a little radius incrrement and same disctance on circumfence of circle. Tell me if you need it.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
|
Hi Wilfried, "Tell me if you need it." Yes, I need it. "point of interests" supposed to give us the location objects, then in each of location objects, we would get StreetAddress. All of this works fine, except when I call GetStreet() I get nothing. I just wonder if you can try a little code to see if you can get any street address from "point of interests" (in Munich or Paris). If you can not, then you and I have same problem, we would stop and drink a beer. If you successful, the give me your code and you drink the beer. Thanks |
| |||
|
Hi, I did a small experiment. It seems that lots of the points of interest return values in the street addres like phone numbers etc. Some of the points of interest seems to be or to have a real street address. But the ones that dont have a null string in the Postal code and City. So there we can make a distinguis. What I do here, if there is no valid streetadress I find the lat/long from the location and do an ObjectsFromPoint. The results contain in the experiments I did always a valid streetaddress. For the pos.CalcPos method you find example on this site. Do a search after "CalcPos" and you get it This is the code of the working experiment: Code: double Lat;
double Lon;
Map M = MP.ActiveMap;
Location Loc = M.GetLocation(51, 4, 1);
Pushpin PP = M.AddPushpin(Loc, "");
FindResults Results = PP.Location.FindNearby(10);
foreach (object o in Results) {
if (o is Pushpin) {
PP = (Pushpin)o;
Console.WriteLine("Pushpin");
}
else if (o is Location) {
Loc = (Location)o;
if (Loc.StreetAddress != null) {
if (Loc.StreetAddress.PostalCode != "" && Loc.StreetAddress.City != "") {
Console.WriteLine("We have an address");
Console.WriteLine("street " + Loc.StreetAddress.Street);
Console.WriteLine("postcode " + Loc.StreetAddress.PostalCode);
Console.WriteLine("city " + Loc.StreetAddress.City);
Console.WriteLine("---");
}
else {
pos.CalcPos(Loc, out Lat, out Lon);
FindResults Streets = M.ObjectsFromPoint(M.LocationToX(Loc), M.LocationToY(Loc));
foreach (object O in Streets) {
Location StreetLoc = O as Location;
if (StreetLoc != null && StreetLoc.StreetAddress != null) {
Console.WriteLine("Found " + StreetLoc.StreetAddress.Value);
break;
}
}
}
}
}
}
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
|
Hi Wilfried, You can have a beer now, for your experiment. If you can explain to me the next question, then you can have THAT beer I just don't see where you use the Lat and Lon after calling pos.CalcPos(Loc, out Lat, out Lon); Perhaps you missed some code when you pasted to this forum. Thanks |
| |||
|
Hi, Quote:
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
|
Hello Wilfried, What I meant it didn't work for me is that, even your code sometimes find a street address for a point of interests, but the address is not the same as you would click on the map itself. So the call to M.ObjectsFromPoint(M.LocationToX(Loc), M.LocationToY(Loc)); may just find the street address nearby that point of interest. I wonder how Microsoft does it. |
| |||
|
Hi, To be honest I did not check the results with the results while clicking on the map. I think it has to do with the altidude. FindNearby zoom to the whole nearby area. I found this article on this site, maybe this is interesting: http://www.mp2kmag.com/a45--reverse.....mappoint.html
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| Tags |
| 2004, address, euro, mappoint, street |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Get Street Adrress doesn't work on MapPoint 2004 Europe | Van | MapPoint 2006/2009 Discussion | 3 | 01-20-2005 02:14 PM |
| Getting 'second' street address | Anonymous | MapPoint 2006/2009 Discussion | 1 | 05-06-2004 09:31 AM |
| Mappoint 2002 euro VBA | plank | MapPoint 2006/2009 Discussion | 3 | 10-07-2003 05:29 AM |
| MapPoint 2004 Map-/Street-Datas | Fisherman´s Friend | MapPoint 2006/2009 Discussion | 0 | 09-25-2003 07:32 AM |
| Is MapPoint 2004 Euro version available yet? | Anonymous | MapPoint 2006/2009 Discussion | 2 | 09-19-2003 09:30 AM |
Luxor Holiday
Book your Luxor holiday through UlookUbook and visit this destination stooped in history.