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

Is a location inside a Route?

This is a discussion on Is a location inside a Route? within the MapPoint Desktop 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 ...

  1. #1
    giaarcix is offline Junior Member Yellow Belt
    Join Date
    May 2006
    Posts
    13

    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Ó

  2. #2
    giaarcix is offline Junior Member Yellow Belt
    Join Date
    May 2006
    Posts
    13

    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Ó

  3. #3
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    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.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to calculate distance between location and route ?
    By tontaegu in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 10-19-2005, 02:14 PM
  2. Route Direction Location Instruction
    By disweij in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 10-17-2005, 02:45 PM
  3. Map Route with other location
    By Anonymous in forum Bing Maps and MapPoint Web Service
    Replies: 1
    Last Post: 03-29-2005, 09:18 AM
  4. Map Route with other location
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 02-14-2005, 09:19 PM
  5. Getting multiple location on a route between 2 waypoint.
    By johnny in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 01-20-2003, 06:22 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