Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GEOSConcaveHullByLength Error #182

Closed
MaximeROUBY opened this issue Aug 31, 2023 · 10 comments
Closed

GEOSConcaveHullByLength Error #182

MaximeROUBY opened this issue Aug 31, 2023 · 10 comments

Comments

@MaximeROUBY
Copy link

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.
image

@visr
Copy link
Member

visr commented Aug 31, 2023

Like in #181 (comment), 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))

@MaximeROUBY
Copy link
Author

Thanks for the quick answer.
However, I tried your code and it didn't work for me.
Is there something wrong with my installation ?
image

@visr
Copy link
Member

visr commented Aug 31, 2023

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.

@MaximeROUBY
Copy link
Author

[a90b1aa1] LibGEOS v0.8.5
[d604d12d] GEOS_jll v3.11.2+0
Oh Here is the issue, isn't it ?

@MaximeROUBY
Copy link
Author

(The output was huge so I took only those two)

@MaximeROUBY
Copy link
Author

I also use GDAL for this project and it seems to block my version of GEOS_jll

@visr
Copy link
Member

visr commented Aug 31, 2023

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 JuliaPackaging/Yggdrasil#7050 but it looks a bit stalled.

@visr visr mentioned this issue Aug 31, 2023
@MaximeROUBY
Copy link
Author

Ok. No problem, thank you for the help :)

@visr
Copy link
Member

visr commented Sep 22, 2023

GDAL.jl 1.6.1 should no longer hold back the GEOS version.

@MaximeROUBY
Copy link
Author

Yes I just tried it and it worked perfectly. Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants