做“沿路线的兴趣点";在谷歌地图中 [英] doing "points of interest along a route" in google maps

查看:19
本文介绍了做“沿路线的兴趣点";在谷歌地图中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要允许旅行者使用谷歌地图来绘制路线,然后查询我的兴趣点数据库(比如麦当劳的位置),然后显示所有这些位置在一两英里内的路线他们将采取.问题是,我如何有效地获取从谷歌返回的行车路线"信息(本质上是一组纬度/经度对),并将其转换为 sql 查询以获取距离路线一定距离内的位置?

它不必非常精确,并且与路线的鸟儿飞翔"距离就可以了.我最关心的是它的效率是否合理.

在数据库中,基本上每个条目都有一个纬度和经度,但我可以根据需要更改数据库架构.

作为一个例子,这个网站做了我想做的事情(如果你给出一个起点和终点,它将显示你将要乘坐的高速公路附近的雪佛龙车站):
(来源:karmatics.com)

解决方案

看看这个

http://google-maps-utility-library-v3.googlecode.com/svn/tags/routeboxer/1.0/examples/routeboxer-v3.html

这是文档:http://google-maps-utility-library-v3.googlecode.com/svn/tags/routeboxer/1.0/docs/examples.html

您可以从 RouteBoxer 获取框坐标并将其发送到服务器端脚本进行处理

I need to allow travelers to use google maps to plot a route, and then query my database of points of interest (let's say, McDonald's locations) and then show all of these locations that are within a mile or two of the route they will be taking. The question is, how do I efficiently take the "driving directions" information that comes back from google (essentially an array of lat/long pairs), and turn that into an sql query to get locations that fall within a certain distance from the route?

It does not have to be super precise, and "as the bird flies" distances from the routes are just fine. I'm most concerned about it being reasonably efficient.

In the database, things are set up pretty basically with each entry having a latitude and longitude, but I can change the database schema as needed.

As an example, this site does what I want to do (if you give a starting point and ending point, it will show chevron stations that are near the highway you will be taking): http://www.chevron.com/products/stations/stationfinder/planyourroute.aspx


(source: karmatics.com)

解决方案

Check this out

http://google-maps-utility-library-v3.googlecode.com/svn/tags/routeboxer/1.0/examples/routeboxer-v3.html

Here's the documentation: http://google-maps-utility-library-v3.googlecode.com/svn/tags/routeboxer/1.0/docs/examples.html

You could get the box coordinates from RouteBoxer and send that to a serverside script for processing

这篇关于做“沿路线的兴趣点";在谷歌地图中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆