-
Notifications
You must be signed in to change notification settings - Fork 353
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
WIP: Add clustering functions to C API #1154
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Even Rouault <even.rouault@spatialys.com>
A suggestion for naming of a couple of the methods, with clarifying comments:
|
Rather than adding another type to the API, perhaps a function similar to That has the downside that all clusters have to be materialized at once, rather than individually. But perhaps this is fine for the anticipated use cases? |
I'm OK with either approach, but I think the extra functionality of the added object is pretty good, and it's supporting 4 different functions, so it's not like it's an extra "junk object" or something. |
Thanks for the feedback. I've implemented a new version with the custom type, but I don't want to rush it out before Friday. I'm OK leaving this until 3.14. |
There is at least one other non-clustering algorithm that could benefit from this approach - Given this, is it worth renaming the API so that it's more general than just clustering? The term
Or, LineMerge can be though of as a kind of clustering, so an alternative design choice is to use this API and name the GEOS C API function appropriately (say |
This PR resurrects the C API that was removed from #688 and changes it to return an array of cluster IDs instead of a GeometryCollection, as suggested in #823.
This is clearly a more flexible API than the one implemented in e464b79, but it becomes somewhat awkward to construct geometries representing the clusters (see function
construct_clusters
in the test suite).I am a bit averse to adding new types to the C API, but I am wondering if something like the following would be an improvement.