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 am a first time database developer working on an....

This is a discussion on I am a first time database developer working on an.... within the MapPoint Desktop Discussion forums, part of the Map Forums category; I am a first time database developer working on an Access database. I have a list of 200,000 customer records ...

  1. #1
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137
    I am a first time database developer working on an Access database. I have a list of 200,000 customer records that have Latitude and Longitude coordinates (formatted in decimals, like: 40.72323 = Latitude and -73.99569 = longitude). I know the coordinates of 700 points of sale and I know the closest point of sale and the "crow flies distance" to that closest point of sale. I would like to add to my table of customers the drive distance to the closest point of sale. Thus I have a table: [cust_ID], [CLOSEST_POS_ID], [customer_latitude], [customer_longitude], [closest_POS_latitude] and [closest_POS_longitude], [drive_distance]. I would like to be able to do an update query that would populate the [drive_distance] field with the actual drive distance. Thus far, in my fledgling developer career, I have not "connected" with another program (please be specific). Thanks for your help.

  2. #2
    Walt Cygan is offline Senior Member Green Belt
    Join Date
    Aug 2002
    Posts
    124
    In a VB form, add the MapPoint ActiveX control, and call it "MapPointCtl".



    Then do something like:

    <pre>
    Dim objLocS As MapPointCtl.Location
    Dim objLocF As MapPointCtl.Location
    Dim objMap As MapPointCtl.Map
    Dim objRoute as MapPointCtl.Route

    Set objMap = ctlMapPoint.ActiveMap
    Set objRoute = objMap.ActiveRoute

    '...get dblLatS and dblLatF for the starting and ending points
    'from your database
    Set objLocS = objMap.GetLocation(dblLatS, dblLonS)
    Set objLocF = objMap.GetLocation(dblLatF, dblLonF)

    'Add Waypoints
    objRoute.Waypoints.Add objLocS
    objRoute.Waypoints.Add objLocF
    objRoute.Calculate

    'Get the distance
    dblDriveDistance = objRoute.Distance
    </pre>



    I haven't tested this so it may need some tweaking, but this should
    generally work. Be advised it will take a little bit of time to calculate
    200,000 routes.



    - Walt Cygan

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. MSDN MapPoint Developer Center
    By Anonymous in forum News and Announcements
    Replies: 2
    Last Post: 02-10-2009, 08:18 AM
  2. Job Offer: Mappoint / Dot Net Developer Needed ASAP
    By sbrewer in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 02-20-2006, 08:10 PM
  3. MapPoint Developer for Web Service
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 10-31-2004, 03:58 PM
  4. --VB DEVELOPER-- The method QueryAllRecords of a d....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 05-27-2002, 07:50 AM
  5. As a developer of emergency services mission criti....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 07-31-2001, 04:22 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