-
Notifications
You must be signed in to change notification settings - Fork 7
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
Count number of geometry primitives #202
Comments
If counting primitives isn't currently directly supported, could we add an additional column to |
I think adding a simple geometry count to whatever is returned by I also want to avoid adding too many new features to the reader/handler system...for a variety of reasons, I'd like to move towards a pattern of making calculations from "chunks" of geoarrow arrays (but that functionality hasn't quite landed yet). The most important reason is that writing handlers is incredibly error-prone! |
This is now low priority for me also. I'm approaching this problem differently, working directly with coords (I needed the coords anyway) and counting unique parts from that. Since empty parts are dropped from coords, parts = simple geometries. Related: wk::wkt("MULTIPOINT (1 1)") |>
wk::wk_count()
#> n_geom n_ring n_coord
#> 1 2 0 1 Created on 2023-10-13 with reprex v2.0.2 |
Yeah, I remember being surprised by that, too. I'm open to the best solution, there...new column? Make |
Separating collections and primitives makes sense to me. Something like this? wk::wkt("MULTIPOINT (1 1)") |>
wk::wk_count()
#> n_multi_geom n_simple_geom n_ring n_coord
#> 1 1 1 0 1 I don't mind what these counts are named, provided they're clear enough. |
I'm trying to count the number of geometry primitives (point, linestring, polygon) per element. Is there a better / more direct approach than this?
Created on 2023-10-09 with reprex v2.0.2
The text was updated successfully, but these errors were encountered: