MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Is a location inside a Route?

This is a discussion on Is a location inside a Route? within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; This is my problem: I have got an object Route, let's say from Milan to Rome. I have to control ...


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 07-31-2006
Junior Member
Yellow Belt
 
Join Date: May 2006
Posts: 12
Send a message via ICQ to giaarcix Send a message via MSN to giaarcix
Is a location inside a Route?

This is my problem: I have got an object Route, let's say from Milan to Rome. I have to control if a location is or not inside this route.
Is there a simple way to do this?
If this is not possible I have another question: is there a way to build a text file of coordinates that specifie a route?
Thank you,
Giacomo from Italy
__________________
Bisogna sognare, insistere, ripetere, finchè il sogno si trasformi in realtà
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 08-01-2006
Junior Member
Yellow Belt
 
Join Date: May 2006
Posts: 12
Send a message via ICQ to giaarcix Send a message via MSN to giaarcix
Response to myself.. in case someone else is interested!

This is the very simple way that solved my problem: I build a route in another function, and then I check if a location with coordinates (lat,lon) is inside that route with this code:

Dim min As Integer
Dim objMap As MapPointctl.Map
Dim objLoc As MapPointctl.Location
Me.MappointControl1.NewMap geoMapEurope
Set objMap = MappointControl1.ActiveMap
Set objLoc = objMap.GetLocation(lat, lon)
Set objroute = objMap.ActiveRoute
min = 1000

For Each Direction In objroute.Directions
If Direction.DistanceTo(objLoc) < min Then
min = Direction.DistanceTo(objLoc)
end if
Next

MsgBox "Distance: " + Str(min) + " km"
__________________
Bisogna sognare, insistere, ripetere, finchè il sogno si trasformi in realtà
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 08-01-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,122
Hi,

Thank you for sharing. This is a very good idea. Only when there are very long autoroutes in the calculated route it can be a problem.
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
inside, location, route


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
How to calculate distance between location and route ? tontaegu MapPoint 2006/2009 Discussion 1 10-19-2005 02:14 PM
Route Direction Location Instruction disweij MapPoint 2006/2009 Discussion 3 10-17-2005 02:45 PM
Map Route with other location Anonymous MapPoint Web Service and Virtual Earth 1 03-29-2005 09:18 AM
Map Route with other location Anonymous MapPoint 2006/2009 Discussion 0 02-14-2005 09:19 PM
Getting multiple location on a route between 2 waypoint. johnny MapPoint 2006/2009 Discussion 2 01-20-2003 06:22 AM


All times are GMT -5. The time now is 10:28 AM.


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 55