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
Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Getting street from latitude/longitude?

This is a discussion on Getting street from latitude/longitude? within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi Markus, Originally Posted by MD2000 I don't understand when and from where the Execute method is being called Sorry ...

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


    Quote Originally Posted by MD2000
    I don't understand when and from where the Execute method is being called
    Sorry that I was not complete. To create / call the you can do following:

    Code:
                int resolution = 5;
                int maxRadius = 40;
                MPPosInCircle posInCircle = new MPPosInCircle(resolution, maxRadius);
                posInCircle.OnPosition += PosInCirclePosition;
                posInCircle.Execute(Lat, Lon);
    So first check if you are on a street. If you are not you can create the class and run it. Note that it may be better (depending on your application) that the class is created beforehand and stay during lifetime of the program. For this reason the Execute method is separate.

    Working with event handler is in this case the same as sequential programming, however later it can be nececary to fire the event handler by posting messages or do it in separate thread. This way the program can pump messages while it is looping, but at this moment the application where I use this is running without UI so that's something for later (maybe soon).

  2. #12
    MD2000 is offline Member Yellow Belt
    Join Date
    Feb 2005
    Posts
    32
    Hello,
    when doing sequential programming, do I need this line:
    Code:
                posInCircle.OnPosition += PosInCirclePosition;
    If yes, how do I create the PosInCirclePosition object?


    After running the execute method, where are the new lat/lon values stored?

    Bye,

    MD

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

    you have to write an event handler. he += insert the event handler to the component. When this is done it will be fired evry time it is needed. I have not the time for example at moment (sorry).

    please dont hesitate to ask again !

  4. #14
    MD2000 is offline Member Yellow Belt
    Join Date
    Feb 2005
    Posts
    32
    Hi,
    I got it running now. Thanks a lot for your support!
    I have some questions:

    map.ObjectsFromPoint(map.LocationToX(loc), map.LocationToY(loc))
    returns a FindResults collection.
    1. Is this collection sorted in any way?
    2. How can I sort out this collection, so that I get only streets without other points of interest?


    Bye,

    MD

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

    Very simple, it only need some imagination,for example:

    Code:
                FindResults StreetResults = MP.ActiveMap.ObjectsFromPoint(MP.ActiveMap.LocationToX(Loc), MP.ActiveMap.LocationToY(Loc));
                foreach (object o in StreetResults) {
                    Location L = o as Location;
                    if (L != null && L.StreetAddress != null)
                        Console.WriteLine("we have a street address");
                }

  6. #16
    mschoudhary is offline Junior Member White Belt
    Join Date
    Dec 2008
    Posts
    1

    Re: Getting street from latitude/longitude?

    Hi Everyone,

    I also trying to create a applicaiton which will create fence or circle based on latitude and longitude .

    Can you tell me how i can do it?

    i have create class file which is defined by you but i dont know what about this event handler , is it something useful which we need to define to draw circle?



    Quote Originally Posted by MD2000 View Post
    Hello,
    when doing sequential programming, do I need this line:
    Code:
                posInCircle.OnPosition += PosInCirclePosition;
    If yes, how do I create the PosInCirclePosition object?


    After running the execute method, where are the new lat/lon values stored?

    Bye,

    MD

Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to get latitude and longitude
    By ma2005pp in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 09-28-2005, 02:57 AM
  2. Latitude and Longitude
    By virgilar in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 03-21-2005, 02:01 PM
  3. Latitude and Longitude
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 11-25-2003, 01:52 PM
  4. NMEA latitude/longitude and mappoint latitude/longitude
    By muurman in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 11-22-2003, 05:42 AM
  5. VB6 - Latitude and longitude of a pushpin ???
    By Vincent BENNER in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 11-12-2002, 07:03 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