-1

this is my first question in stackoverflow after reading a lot about concave hulls and alpha shapes but unfortunately I still have not found a working solution :(

My input is a big array of GPS-Coordinates (lat,lon) (around 1000-2000 points) defining a GPS track. Now I'm looking for a way to measure the perimeter of the outline of all coordinates.

Until now, I was able to calculate and display the convex hull from all the points but the calculation of the concave hull was not successful so far :(

I use javascript for all my programming and looking for the following task: Input: all lat/lon coordinates (WGS84) Output: all edge coordinates defining the concave hull.

I already found interesting infos about concave hulls, alpha shapes and delaunay triangulation but unfortunately all infos refer to a 2D plane / X,Y coordinates (like [5,2][6,7][3,2]) and if I try those scripts with my WGS84 coordinates -> unable to get the concave hull of my point cloud :(

Thank you very much for any help!

  • yoou should add some code to your question – Malakiof Dec 21 '14 at 13:24
  • well - there is only my code to get the convex hull but i need a concave hull. the code for convex hull is taken from a finished script, found also here http://w.brianbar.net/graham_scan_js/ I have this now working with my GPS Coordinates: http://cgm.cs.mcgill.ca/~beezer/cs507/mygifs/figure3.gif But I cannot user the convex hull, I need a concave hull like this: http://webee.technion.ac.il/control//info/Projects/Students/2013/David%20Shalom%20and%20Guy%20Greenhouse/WWW/clip_image009.jpg – Patrick Stahel Dec 21 '14 at 13:41

2 Answers2

1

Try to use hull.js library to solve your problem: https://github.com/AndriiHeonia/hull

AndriiHeonia
  • 162
  • 6
0

You can use alpha shapes. Its a delaunay triangulation without edges exceeding alpha.WGS84 means spherical earth so z isn't so useful. But you can try a 3d triangulation (set Z to anything) or try a mercator map projection:https://alastaira.wordpress.com/2011/01/23/the-google-maps-bing-maps-spherical-mercator-projection/ and then alpha shapes.

Micromega
  • 12,486
  • 7
  • 35
  • 72