0

I have multiple points with coordinates which represent the path on a map. Then I have multiple points, which represent for example restaurants. I'd like to get all the restaurants, which are near my path, like to 1 km. One of the solutions is that for each point I'll search for the restaurant in the circle of 1 km from that point in the MySQL database, but I'd like to know some other option.

4

2 回答 2

0

我会从路径创建一个多边形,代表感兴趣的区域,然后测试交叉点。

于 2013-04-20T10:11:01.910 回答
0

您可以进一步在路径上的每对相邻点之间放置线,然后计算从线到代表餐厅的每个点的最短距离。然后,您只需过滤掉距离大于 1 公里的餐馆。

对于线和点之间的距离计算,请查看此Wiki

于 2013-04-20T10:21:50.573 回答