The minimum distance from the route of each POI must be determined and be checked if it is less then the given maximum distance. To find the minimum the distance of the Poi to each vertex of the route polyline has to be calculated. That means a lot of calculations. In my script RouteCngLpgFinder, which searches for CNG or LPG refueling stations near the route, the calculations were reduced by: 1. check, if the bounds of the polyline contains the POI 2. the route is divided in sections with bounds extended by the given maximum distance. 3. Check, if the bounds of one section contains the POI 4. If yes, find the minimum distance of the POI to the section's polyline.
For RouteCngLpgFinder a route may consist of about 10.000 points. The number of POIs is about 12.000. You may find this script at: http://routecngfinder.sourceforge.net/ Regards, Bost On Jul 4, 9:56 am, sgiddings <[email protected]> wrote: > Hello, > > Can anyone please advise me with this scenario. > I have a mySql database of POI points within a local region. > > When a user requests an itinerary, I would like to be able to show the > relevant POI markers which are within a given distance of the > itinerary - eg: 25 miles from any given point on the itinerary. > > I have seen that it is possible to obtain all the LatLng points from > within the DirectionsRoute::route array. > > Could I then pass this as a LINESTRING object to an SQL SELECT query ? > Would anyone have a working example of the best way to do this ? > > Hope someone can help me with this. -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
