Closed MaximeROUBY closed 1 year ago
Like in https://github.com/JuliaGeo/LibGEOS.jl/issues/181#issuecomment-1701708022, this hasn't been wrapped, so it's a bit harder to use, but here is an example. The main things are that the first argument needs to be a context handle, and a Vector{Point}
is not accepted, it needs to be converted to a MultiPoint first.
julia> using LibGEOS
julia> g = MultiPoint([[1.1,2.2],[3.3,4.4],[2.2,3.3]])
MULTIPOINT ((1.1 2.2), (3.3 4.4), (2.2 3.3))
julia> ctx = LibGEOS.get_context(g)
LibGEOS.GEOSContext(Ptr{Nothing} @0x0000024a80733c20)
julia> ptr = LibGEOS.GEOSConcaveHullByLength_r(ctx, g, 1.5, 1)
Ptr{Nothing} @0x0000024b131a8b50
julia> conc = LibGEOS.geomFromGEOS(ptr)
POLYGON ((1.1 2.2, 3.3 4.4, 2.2 3.3, 1.1 2.2))
Thanks for the quick answer. However, I tried your code and it didn't work for me. Is there something wrong with my installation ?
It looks like it, yes. Is this using LibGEOS v0.8.5 with GEOS_jll v3.12.0? Could you share the output of versioninfo()
and from the package manager (press ]
), st -m
? That shows the versions.
[a90b1aa1] LibGEOS v0.8.5 [d604d12d] GEOS_jll v3.11.2+0 Oh Here is the issue, isn't it ?
(The output was huge so I took only those two)
I also use GDAL for this project and it seems to block my version of GEOS_jll
Right indeed that explains it. I should've added compat bounds such that you cannot get the newly wrapped functions with an old binary that doesn't have them, I forgot. So for now you cannot use both at the same time, until a new GDAL_jll is released that is compatible with GEOS 3.12.
I saw some work was underway in https://github.com/JuliaPackaging/Yggdrasil/pull/7050 but it looks a bit stalled.
Ok. No problem, thank you for the help :)
GDAL.jl 1.6.1 should no longer hold back the GEOS version.
Yes I just tried it and it worked perfectly. Thanks :)
I tried to use your GEOSConcaveHullByLength function and it seems that it crashes when calling the C code. I am looking into it but if you find a solution before I do, it could be nice to correct it XD.