geo
geo copied to clipboard
Add `num_rings` or `rings_count` to `Polygon`
Is this just 1 + length of interiors vector or am I missing something?
Thanks for adding starter bugs for the likes of me :) Is there interest in adding this?
A few clarifications would be useful:
- Naming: I'd vote for
rings_countto go with existingcoords_count(PostGIS usesST_NRings, geos crate hasget_num_interior_ringsand nothing that includes the exterior ring). - Should this be added directly to struct impl(s)?
- It should probably be added to:
Polygon,MultiPolygon,Rect(always 1) andTriangle(always 1).
I want to answer 2 with: Add geo::algorithm::RingsCount trait, even though it will only be implemented for a few of the core types. There are plenty of examples where algorithms only apply to subset of types (e.g. FrechetDistance only applies to LineString).
Resolved in https://github.com/georust/geo/pull/1145