Jump to content

Geocoding and Google Map API

- - - - -

  • Please log in to reply
2 replies to this topic

#1
ramkumar

ramkumar

    Newbie

  • Members
  • Pip
  • 1 posts
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
BlaineSch

BlaineSch

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,448 posts
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.

#3
bbqroast

bbqroast

    Codecall Addict

  • Members
  • PipPipPipPipPipPipPip
  • 554 posts
  • Location:/etc/passwd
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.
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