You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes one desires that polygonal or line features are reduced to a single point before further operations such as counting-by-geometry are performed in order to avoid potentially unwanted side effects such as double counting of features which lie on the border of two aggregateByGeometry polygons. This could be avoided if there was a possibility to reduce the more complex geometry to a point before further internal operations are performed.
Expected Solution
There should be a functionality to transform the geometry after it has been built, but before the clipping-to-the-area-of-interest or aggregation-by-geometry is applied. This could take an arbitrary Function<Geometry, Geometry> as an argument which could transform the feature's geometry to anything1 one desires, e.g. applying geometry.centroid().
Alternative Solutions
Alternatively, the complete geometry builder could be made customizable, but that seems at first to be much harder to use by the user for the typical use case of just simplifying geometries down to a centroid for example.
A simple boolean switch transformToCentroid (or similar) would suffice for the most simple use case, but is less flexible (e.g. maybe one wants to convert polygons to their outline, or add/remove inner rings from polygons, etc.).
Additional Context
Footnotes
This transformation cannot be completely arbitrary, since some prefiltering which happens on the features' bounding boxes (or even cell id) would be unaffected by this. I think the transformation result needs to be inside the bounding box of the feature's original geometry bounding box. should be sufficient. ↩
The text was updated successfully, but these errors were encountered:
Problem Description
Sometimes one desires that polygonal or line features are reduced to a single point before further operations such as counting-by-geometry are performed in order to avoid potentially unwanted side effects such as double counting of features which lie on the border of two
aggregateByGeometry
polygons. This could be avoided if there was a possibility to reduce the more complex geometry to a point before further internal operations are performed.Expected Solution
There should be a functionality to transform the geometry after it has been built, but before the clipping-to-the-area-of-interest or aggregation-by-geometry is applied. This could take an arbitrary
Function<Geometry, Geometry>
as an argument which could transform the feature's geometry to anything1 one desires, e.g. applyinggeometry.centroid()
.Alternative Solutions
transformToCentroid
(or similar) would suffice for the most simple use case, but is less flexible (e.g. maybe one wants to convert polygons to their outline, or add/remove inner rings from polygons, etc.).Additional Context
Footnotes
This transformation cannot be completely arbitrary, since some prefiltering which happens on the features' bounding boxes (or even cell id) would be unaffected by this. I think the transformation result needs to be inside the bounding box of the feature's original geometry bounding box. should be sufficient. ↩
The text was updated successfully, but these errors were encountered: