-
Notifications
You must be signed in to change notification settings - Fork 4
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
Implement a GEOS
algorithm in an extension
#100
Conversation
I will have to work on this tomorrow but a basic framework of what has to happen:
Sidenote: we need topological simplify as well from GEOS, that can be its own object. |
Can you explain this a bit |
The parameter in the type can't exist, or more accurately it shouldn't be used for dispatch (which removes its purpose altogether) |
Well dispatch not the only purpose for type parameters... My concern would be where we are calling LibGEOS deep in |
I guess that brings up another topic - should we eagerly convert back to GI.* or leave geometries as LibGEOS geoms? |
Its almost an arbitrary descision, we may need real world use to know either way. Eager conversion is clean and will make subsequent native julia ops faster, but always makes the GEOS op slower. And e.g. if people do repeated GEOS operations not converting will be fastest overall. Like your issue over at Rasters is caused by an unused eager conversion step in GDAL: If GDAL could just pass points through to Proj unchanged there would be no problem. Having GeoInterface we can avoid that. But I'm not sure its worth it on balance. Maybe a keyword can control it eventually, and users can choose not to convert back when they need the performance for something. |
It does make things like segmentize type unstable unless you explicitly pass a method which is a bit strange... |
@rafaqz this is what I was thinking of - in any case kwargs will not change either the function called or return type, so the purpose they serve is limited. The only controlling factor might be |
Ok if they dont affect types its less an issue. I guess just put LibGEOS calls in explicit conditionals to avoid dyamic dispatch slowness. |
Some tests would be nice ;) Also just to see what everything actually does. |
Seems fair. I'm not going to test too thoroughly here since LibGEOS should be taking care of that, but can definitely test type combos + return types and keyword defaults/enforcement. |
At least make sure everything actually runs ;) |
The PR should be ready for review now! |
Oh geez...test failure is not present on my machine. I guess allowing Will modify the tests accordingly. |
I like the idea of a keyword eventually. It really does depend on the use case and it is nice to have control over your types. |
Maybe we could change the types at some point to have a |
The geometry correction seems a bit difficult to do correctly, so I'm considering removing it from this PR and fixing this up to merge as is. |
so they are more accessible and general
I've had to add a hack in the test file for LG geometrycollection conversion to work, but all tests pass locally, and are using the GEOS backend for GeometryOps rather than LibGEOS directly. IMO this should be ready for merge if tests pass. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall! Just a few clarifying questions to address.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR implements a parametrized
GEOS
algorithm within GeometryOps, and factors out the integration work to an extensionGeometryOpsLibGEOSExt
. (cf #76)The extension is currently implemented for polygon set ops, DE-9IM functions, and buffering.
With this, you basically pass
GEOS(; params...)
as the first argument to whichever functions have been overridden. Ideally, this should be at least most of the available functions.Needs docs and tests.