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

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

报告相同问题?

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效