doupo5178 2015-10-28 07:47
浏览 29
已采纳

如何在不使用Google地图的情况下将当前纬度和经度与折线相匹配

I have been working on Google Maps API for a Project which is fully based on Google Maps.

What am doing is :- Storing all the encoded Polyline in database for a particular route. Now i have current position(Latitude and Longitude) for user in database.

Now i want to match if any route Polyline from database is passing from the point of user position or does current user position comes in between any of the polyline with certain amount of range.

I have gone through lots of sites with different ideas but seems nothing is working in my way. Please help me out with this.

This link seems to be helpful, where do i need to pass polyline here. And i want the position of current user should me matched if it lies in between the polyline/ with some specified range.

But they are using Polygon , do i need to convert Polyline to Polygon? http://www.codeproject.com/Articles/62482/A-Simple-Geo-Fencing-Using-Polygon-Method

  • 写回答

1条回答 默认 最新

  • douwei7501 2015-10-28 09:14
    关注

    You can accomplish these calculations by importing a geospatial library into your project or just adding some code.

    Turf.js is a very interesting one in javascript and I believe turf.point-on-line is what you need. It'd take a location and a series of coordinates from your polygon and return the closest point on the polygon to your given location and the distance to it.

    But you'll also find info on a similar answer

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大