MapPoint Forums

MapForums

Community of MapPoint and Virtual Earth Users and Developers




Check out if GPS pos is on a Route

This is a discussion on Check out if GPS pos is on a Route within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hello there! First thank you for this great forum, i searched through it but couldn't find exactly what i am ...


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

Today's Posts Twitter Feed 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 11-14-2005
Junior Member
White Belt
 
Join Date: Nov 2005
Posts: 7
Send a message via ICQ to kristijan
Check out if GPS pos is on a Route

Hello there!

First thank you for this great forum, i searched through it but couldn't find exactly what i am looking for.

I have a problem, i don't exactly know how to solve.
I have a route going from A to B.
I get an GPS coordinate.
How do i check if the GPS position is on the Route between A and B ?

Thank you for any suggestions !
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 11-15-2005
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,177
Hi,

The only way to know this is to draw a polygon around the route. The poligon has to be wider than the route because there could be traffic deviations.
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 11-17-2005
Junior Member
White Belt
 
Join Date: Nov 2005
Posts: 7
Send a message via ICQ to kristijan
mhm

thank you for your response.
this sounds very difficult. I think i don't quite understand, how do i draw the polygon ? Am i able to move along the route, which is calculatet and displayed in Mappoint. Do i draw the polygon then in mappoint ?



Might there be any hope that in mappoint 2006 this would be better ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 11-17-2005
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,177
Hi,

Sorry that I was so unclear. First let mappoint calculate the route for the vehicle. Then you can draw a polygon around the route. For each point in the polygon you draw you have to save the coordinates. This you can do in a beforeClick event handler.

To actual see if each GPS position of the car is within the polygon has nothing to do with mappoint anymore. Your program has to calculate it. It can be done following way:

Reduce the polygon to a triangle by replacing 2 successive sides by 1 new side, then calculate if the residual riangle contains the point. If not then calculate on the next triangle etc...

Not very easy done but not a big problem tough.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 11-17-2005
calv1ns's Avatar
Member
Green Belt
 
Join Date: Mar 2005
Posts: 91
Hey Wil

Hey Wil

I'm not getting what you mean too... do you have a bit of code or pseudo code that gives us a better idea... It seems your solution is brilliant but I'm not sure the majority of us are understanding it.

Ciao,
__________________
Calv1ns
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 11-17-2005
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,177
Hi,

I guess you right. If I read my explanation then I dont understeand eahter

This it is difficult because I dont know all the naming of figures etc. I try to make some drawings to explain what I mean, because even with some pseudocode it will be difficult, and it is really not so difficult, I have done sutch things several times.

I'll keep in touch
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 11-17-2005
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,177
Hi,

Whell I made a little drawing to explain what I mean. See http://www.mestdagh.biz/mp/polygon.gif

The top drawing is the polygon where the vehicle is maybe in or maybe not. How to check this simple. See second drawing.

we connect 2 sides (starting at random place), eg the red one, and by connecting we only have a triangle. Since we have not a matematical figure it is mutch more simple to calculate if vehicle is in it or not. If it is not in then we connect next point, the green one, if not in then the blue, etc...

if we are at the end then we have red alert: vehicle is not where it should be.

Is this more clear ?

Maybe this is stuff for a little article, but then better explaned and with some code samples
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 12-01-2005
calv1ns's Avatar
Member
Green Belt
 
Join Date: Mar 2005
Posts: 91
HI Wil

Sorry I missed your response on this item. Must of slipped through somehow.

It appears the link to the gif file is no longer available?

So Yes likey more clear - but No I didn't get a chance to look at it...

Can you verfify the link?

Thanks,
Ciao,
__________________
Calv1ns
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9 (permalink)  
Old 12-02-2005
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,177
Hi,

The link is still valid, it works here. It redirect to this: http://users.pandora.be/sonal.nv/mp/polygon.gif
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10 (permalink)  
Old 12-02-2005
Winwaed's Avatar
Mapping-Tools.com
Black Belt
 
Join Date: Feb 2004
Posts: 1,142
Blog Entries: 22
Another approach to point-in-polygon calculations is outlined in Sedgwick's "Algorithms" (I see this is now a multi-volume work: I only have the 1 volume edition).

Basically, you project a 'ray' from your point to inifinity. Count the number of times it crosses the polygon edge. If this is odd, then the point must be in the polygon. If it is even, then the point must be outside the polygon.
I've implemented it for cartesian coordinates, and the maths becomes pretty simple if your ray is parallel to one of the axes.


Richard
__________________
Winwaed Software Technology LLC
http://www.winwaed.com
See http://www.mapping-tools.com for MapPoint Tools
See the Geoweb Guru for online mapping
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
check, gps, pos, 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
Sanity Check Please......Pushpin help EdB MapPoint 2006/2009 Discussion 2 02-22-2005 07:44 AM
Is there way to check if you're on a road Omair MapPoint 2006/2009 Discussion 1 01-05-2005 06:56 AM
need to check accuracy of MP2004 jaharris67 MapPoint 2006/2009 Discussion 0 09-15-2004 11:28 PM
GPS position check Anonymous MapPoint 2006/2009 Discussion 14 01-19-2004 01:00 AM
How to check if an address is valid? amanuel MapPoint 2006/2009 Discussion 2 08-29-2002 09:42 PM


All times are GMT -5. The time now is 02:47 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 RC2
MP2K Magazine
Visitor Map

Taba Heights Holiday
Visit Egypt with your Taba Heights holiday. Book through UlookUbook and save!



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