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 9 of 9

Has anyone got street address with MapPoint Euro 2004?

This is a discussion on Has anyone got street address with MapPoint Euro 2004? within the MapPoint Desktop 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 ...

  1. #1
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    Has anyone got street address with MapPoint Euro 2004?

    Has anyone got street address in Munich as the result of FindNearby?

    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.

  2. #2
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    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.

  3. #3
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137
    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

  4. #4
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    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;
                                    }
                                }
                            }
                        }
                    }
                }
    So I have that beer now

  5. #5
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137
    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

  6. #6
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Hi,

    I just don't see where you use the Lat and Lon after calling
    pos.CalcPos(Loc, out Lat, out Lon);
    Euh I dont use it. I'm pretty sure I was not drunk !

  7. #7
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137
    Aahh, just one beer

    I tried to use your code, however it doesn't work for me, but switch to UK or Ireland, works just fine.

    ANyway, you deserved THAT beer and I am continuing my experiment

  8. #8
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137
    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.

  9. #9
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    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

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Get Street Adrress doesn't work on MapPoint 2004 Europe
    By Van in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 01-20-2005, 03:14 PM
  2. Getting 'second' street address
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 05-06-2004, 10:31 AM
  3. Mappoint 2002 euro VBA
    By plank in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 10-07-2003, 06:29 AM
  4. MapPoint 2004 Map-/Street-Datas
    By Fisherman´s Friend in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 09-25-2003, 08:32 AM
  5. Is MapPoint 2004 Euro version available yet?
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 09-19-2003, 10:30 AM

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 86 87 88 89 90 91 92 93 94 95 96