Hello to everyone there!
I have been developing a website which uses the Google Map. I have successfully implemented all the maps, able to get driving directions etc.
But for the last few days I m working on an issue that made my head spinning around.
The problem is described below-
While getting driving directions from source to location, I have to fetch some location information from our database and I want to display only those location which lies either on the route or around 30 miles of the route obtained.
I don't find any method, through which I can check if a particular GPS coordinate lies on the route (i.e. between the source and destination).
Does anyone have worked on manipulation of GPS data?
Thanks in advance.
Please help me out of this problem.
Ram
2 replies to this topic
#1
Posted 10 July 2011 - 11:06 PM
|
|
|
#2
Posted 12 July 2011 - 10:46 AM
In your database, if you record the lat and lng of the locations, you can simply see if they are "close" based on your on math of these numbers. I'm not sure how to equate miles to that, I don't even think it's possible, but you can get a decent enough result.. or even 10 nearest items.
Remember in order to get distance from where you are and all you have are 2 points, you can use a math equation: A^2 + B^2 = C^2
This gets the "real" distance from one point to another.
Remember in order to get distance from where you are and all you have are 2 points, you can use a math equation: A^2 + B^2 = C^2
This gets the "real" distance from one point to another.
#3
Posted 16 July 2011 - 12:20 PM
Ahh maths,
If you want to check for locations near the route you could spread points along the route take their lat/long and then perform a query for the results with similar lat/long.
If you want to check for locations near the route you could spread points along the route take their lat/long and then perform a query for the results with similar lat/long.
Please, write clearly with proper structure. Double spacing makes the text feel un-jointed, Capitalizing Every Word Means People Stop Before Every Word Sub-Consciously Which Is A Pain In The Backside, and use code tags! (The right most styling box).
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account

Back to top










