-
Notifications
You must be signed in to change notification settings - Fork 24
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
Expose makeValid #90
Comments
Yes, doable.
outputs a multi-polygon
whereas a valid polygon results in a polygon
outputs
Not only polygons, many other geometry types are supported https://github.com/libgeos/geos/blob/main/src/operation/valid/MakeValid.cpp |
Brilliant. Not sure where I went wrong when guessing how to call this, but this is very helpful. I will take a look at it and see if I can package your one liner as a pull request. |
Tests could come from https://github.com/libgeos/geos/blob/main/tests/unit/capi/GEOSMakeValidTest.cpp There seems to be functions not yet wrapped |
|
Nice.
I notice that the related function getGeometries is also not wrapped.
It seems like the natural one liner for that is
getGeometries(x::AbstractMultiPolygon) =
LibGEOS.geomFromGEOS.(LibGEOS.getGeometries(p2.ptr))
What is the thought about specializing on types that are from GeoInterface?
…On Tue, Sep 7, 2021 at 6:57 PM Jaakko Ruohio ***@***.***> wrote:
LibGEOS.geomFromGEOS is the function to go from GEOS to geom.
Better one-liner
makeValid(g) = LibGEOS.geomFromGEOS(LibGEOS.GEOSMakeValid_r(LibGEOS._context.ptr, g.ptr))
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#90 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAB5E6VE5C2VLN32GMPDOCLUA27JDANCNFSM5DPKSTSA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
I see that there is a function
LibGEOS.GEOSMakeValid
in the generated code.Unfortunately, when I call it like
LibGEOS.GEOSMakeValid(Ref(p))
wherep
is a self-intersecting polygon, I get back a null pointer.This would be a very nice function to have working, but I don't understand how call it (else I would have brought a pull request).
Is there any way to get this to work?
The text was updated successfully, but these errors were encountered: