MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




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 2006/2009 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 ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-14-2002
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 03-14-2002
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
database, developer, time, working


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
MSDN MapPoint Developer Center Anonymous News and Announcements 1 08-08-2008 07:41 PM
Job Offer: Mappoint / Dot Net Developer Needed ASAP sbrewer MapPoint 2006/2009 Discussion 0 02-20-2006 09:10 PM
MapPoint Developer for Web Service Anonymous MapPoint 2006/2009 Discussion 0 10-31-2004 04:58 PM
--VB DEVELOPER-- The method QueryAllRecords of a d.... Anonymous MapPoint 2006/2009 Discussion 4 05-27-2002 08:50 AM
As a developer of emergency services mission criti.... Anonymous MapPoint 2006/2009 Discussion 1 07-31-2001 05:22 PM


All times are GMT -5. The time now is 08:09 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


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