Skip to content
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

Add geometry transformation operations #437

Open
tyrasd opened this issue Dec 8, 2021 · 0 comments
Open

Add geometry transformation operations #437

tyrasd opened this issue Dec 8, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request priority:low Should be quite a far way down on the agenda

Comments

@tyrasd
Copy link
Member

tyrasd commented Dec 8, 2021

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. 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

  1. 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.

@tyrasd tyrasd added the enhancement New feature or request label Dec 8, 2021
@tyrasd tyrasd self-assigned this Dec 8, 2021
@Hagellach37 Hagellach37 added the priority:low Should be quite a far way down on the agenda label Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority:low Should be quite a far way down on the agenda
Projects
None yet
Development

No branches or pull requests

2 participants