admin管理员组文章数量:1426839
I have a GPS cluster (contains many GPS points which are close to each other) and I want to identify it as a place by creating a polygon around its outer points. One way is Convex Hull and I am looking for its implementation in Javascript.
Any idea?
I have a GPS cluster (contains many GPS points which are close to each other) and I want to identify it as a place by creating a polygon around its outer points. One way is Convex Hull and I am looking for its implementation in Javascript.
Any idea?
Share Improve this question asked Jan 4, 2011 at 1:23 ZaheerZaheer 3755 silver badges20 bronze badges 1- 2 it looks relevant: geocodezip./map-markers_ConvexHull_Polygon.asp – Zaheer Commented Jan 4, 2011 at 1:28
2 Answers
Reset to default 3The following demo displays how to calculate a convex hull that will plot an outer boundary or the area for the given coordinates. This demo is implemented in javascript
http://www.geocodezip./v3_map-markers_convexhull.asp
The code for the demo is located at https://github./mgomes/ConvexHull
The convex hull is a concept that has not been provided in google maps API yet.
Yep. Check out the source in the tag. there's two separate scripts: one that executes the hull algorithm, and the other has the google maps API stuff in it.
In the example, the Initiation() function is called by the body's onload event, which sets up all of the listeners for click events, creates the random points and such.
Check out the algorithm for the hull, the chainHull_2D(P,n,H) function. It took me a bit to follow it but once I got a grasp it makes a lot of sense. The function spits H back out with the array of GLatLng of the hull. A GPolygon is then created using the array of GLatLng.
GPolygon implements googles maps overlay interface so you use the Map.addOverlay function to display the polygon.
Check this tutorial out too to better understand the maps API.
本文标签: How to findcreate Convex hull of GPS points in JavascriptStack Overflow
版权声明:本文标题:How to findcreate Convex hull of GPS points in Javascript - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745484139a2660306.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论