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

I was wondering if there was any direct method to ....

This is a discussion on I was wondering if there was any direct method to .... within the MapPoint Desktop Discussion forums, part of the Map Forums category; I was wondering if there was any direct method to do reverse geocoding. I have a lat/long and need to ...

  1. #1
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137
    I was wondering if there was any direct method to do reverse geocoding. I have a lat/long and need to get a block address from it, but i haven't been able to find a clear way of doing this. Is there any code out there to show me what I need to do?

  2. #2
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137
    The snippet below (meant to be used with MapPoint 2002) demonstrates a way
    how it can done.
    It creates a location using given lat and lon, and uses the
    ObjectsFromPoint method of the map object to retrieve a FindResults
    collection. It then outputs the name of the first (and usually best) hit:

    <form><textarea wrap="off" readonly="true" name="code"
    style="BORDER-BOTTOM:
    gray 1px inset; BORDER-LEFT: gray 1px inset; BORDER-RIGHT: gray 1px inset;
    BORDER-TOP: gray 1px inset; OVERFLOW: auto; WIDTH: 100%" rows="26"
    cols="40">
    Option Explicit

    Dim oMpApp As MapPoint.Application

    Private Sub Command1_Click()
    ' Attach to running instance of MapPoint
    Set oMpApp = GetObject(, "MapPoint.Application")

    ' Retrieve the active map
    Dim oMap As MapPoint.Map
    Set oMap = oMpApp.ActiveMap

    Dim oLoc As MapPoint.Location
    Set oLoc = oMap.GetLocation(40.778, -124.1827, 1)
    oLoc.GoTo
    ' Altitude of 1 and Goto important - better
    ' results from ObjectsFromPoint

    Dim Rs As MapPoint.FindResults

    Set Rs = oMap.ObjectsFromPoint( _
    oMap.LocationToX(oLoc), _
    oMap.LocationToY(oLoc))
    MsgBox Rs.Item(1).Name
    End Sub
    </textarea></form>

    More details and another sample can be found in the documentation of the
    FindResults object - you'll probably want to check results quality,
    retrieve alternative hits , and retrieve additional info about the found
    locations. Note that this is not guaranteed to get you a street address.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Direct Mailing Adresses
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 05-28-2003, 01:45 PM
  2. Is it possible to get a direct HANDLE to the Map? ....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 06-19-2002, 09:05 AM
  3. I am wondering if anyone has built a COM add-in ap....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 05-13-2002, 08:55 AM
  4. Hello, I'm wondering if there is a way to include....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 09-04-2001, 11:52 AM
  5. My company was wondering what is the accuracy of y....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 05-11-2001, 12:30 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