LibGEOS.jl icon indicating copy to clipboard operation
LibGEOS.jl copied to clipboard

Concave hull with holes

Open Wikunia opened this issue 2 years ago • 2 comments

I just came across this library and I'm interested in the concave hull functionality of LibGEOS. Looks like there are some C calls implemented for this but I'm unsure how they can be used as there isn't a function like concavehull as one exists for convexhull.

Can the concave hull functionality be used already or does it need some more work and the functions like GEOSConcaveHull are just the preparation step?

Wikunia avatar Aug 31 '23 09:08 Wikunia

Yes, the functions in src/generated/libgeos_api.jl and we generally wrap them in geos_functions.jl to offer a nicer API. And like you mention for GEOSConcaveHull that hasn't been done yet. That doesn't mean it cannot be used directly though. Contributions like this are always welcome.

https://github.com/JuliaGeo/LibGEOS.jl/blob/5439a4546f7733c59a85f056a120d77bf3d4f4cf/src/generated/libgeos_api.jl#L642-L649

https://github.com/JuliaGeo/LibGEOS.jl/blob/5439a4546f7733c59a85f056a120d77bf3d4f4cf/src/geos_functions.jl#L668-L674

So if you have a GEOS geometry object, you can get its context from get_context(obj), and pass both into the low-level function. The geomFromGEOS function converts the pointer we get back from GEOS into a geometry type.

visr avatar Aug 31 '23 20:08 visr

Similarly GEOSConcaveHullByLength needs to be wrapped, this came up in #182.

visr avatar Sep 25 '23 13:09 visr