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

ActiveX MapPointControl: How to find county from City, State

This is a discussion on ActiveX MapPointControl: How to find county from City, State within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi, Thanks for feedback. It will benefit others...

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

  2. #12
    ppmyers is offline Junior Member White Belt
    Join Date
    Aug 2006
    Location
    Topeka, KS
    Posts
    5

    Thanks Uncle

    I've been working on fetching the county for two days, but couldn't figure out how to access that geoFieldRegion2.

    Your code has saved me a lot of work.

    Paul

  3. #13
    KevinPublic is offline Junior Member White Belt
    Join Date
    Sep 2006
    Posts
    1
    Hi, Jaz! I attempted to use the pseudocode you wrote here. Unfortunately, depending upon which city/state combination I use, the county winds up in a different sub of the result array. Sometimes, the county is in .Item(9). Sometimes, it's .Item(4).

    Does anyone have any explanation as to why this is happening?

  4. #14
    ppmyers is offline Junior Member White Belt
    Join Date
    Aug 2006
    Location
    Topeka, KS
    Posts
    5

    Snippet

    Kevin,
    Here's a snippet that I derived from Jaz's pcode:

    PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim cou AsString
    Dim typ AsInteger
    Dim ptr AsInteger
    Dim oRes As MapPoint.FindResults
    Dim myLoc As MapPoint.Location
    Dim col AsNew Collection

    ForEach myLoc In oFindresults

    myLoc.GoTo()

    oRes = oMap.ObjectsFromPoint(oMap.LocationToX(myLoc), oMap.LocationToY(myLoc))

    For ptr = 1 To oRes.Count
    If oRes.Item(ptr).type = 17 Then
    typ = oRes.Item(ptr).type
    cou = oRes.Item(ptr).name
    col.Add(oRes.Item(ptr).name)
    col.Add(oRes)
    EndIf
    Next

    Next

    EndSub

    I use this code to find intersections where auto accidents happen by "on road" and "at road", then build a collection of all of the locations that are in the county where I know the accident happened. Our data entry people then skip from location to location until they get to the right one (within the right county), then use a little mouse routine to record the accident's latitude and longitude.

    I tried to get rid of most of the junk that wouldn't matter to you.

    Again, thanks to Jaz whose code saved my sanity.

    Paul

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 do you find the territory for a given city and state
    By UncleJaz in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 04-05-2006, 11:50 AM
  2. Lat Long for County and State
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 01-24-2005, 07:20 PM
  3. find city name & state name on mouse move event
    By Atul22 in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 10-15-2004, 05:28 AM
  4. Validating City/State Names
    By jbendiner in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 08-06-2004, 03:33 PM
  5. How do I map county data? Do I put state and count....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 07-08-1999, 07:16 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