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

feat: normalize capture-area geometry TDE-1359 #1288

Merged
merged 9 commits into from
Feb 25, 2025

Conversation

paulfouquet
Copy link
Collaborator

@paulfouquet paulfouquet commented Feb 20, 2025

Motivation

When an existing capture-area geometry is being modified (polygon being removed/added), as a result the polygons points can be moved around. When the overall geometry ends up being the same (no visual change), we prefer the capture-area geometry to not show a change (difference between existing and new/re-processed one).

Modifications

What does shapely.normalize()?

According to the official documentation:

  • the coordinates of exterior rings follow a clockwise orientation and interior rings have a counter-clockwise orientation
  • the starting point of rings is lower left
  • elements in collections are ordered by geometry type: by descending dimension and multi-types first (MultiPolygon, Polygon, MultiLineString, LineString, MultiPoint, Point). Multiple elements from the same type are ordered from right to left and from top to bottom.

Because, "the coordinates of exterior rings follow a clockwise orientation and interior rings have a counter-clockwise orientation" is going against RFC 7946 - "A linear ring MUST follow the right-hand rule with respect to the area it bounds, i.e., exterior rings are counterclockwise, and holes are clockwise.", we need to apply orient() after normalize() the geometry.

Verification

@paulfouquet paulfouquet requested a review from a team as a code owner February 20, 2025 22:54
@paulfouquet paulfouquet self-assigned this Feb 21, 2025
@paulfouquet paulfouquet marked this pull request as draft February 21, 2025 01:14
@paulfouquet paulfouquet marked this pull request as ready for review February 21, 2025 03:24
@paulfouquet paulfouquet marked this pull request as draft February 23, 2025 21:48
@paulfouquet paulfouquet marked this pull request as ready for review February 24, 2025 01:49
@paulfouquet paulfouquet added this pull request to the merge queue Feb 25, 2025
Merged via the queue into master with commit 0a061ba Feb 25, 2025
2 checks passed
@paulfouquet paulfouquet deleted the feat/normalize-capture-area-geometry-tde-1359 branch February 25, 2025 02:14
@github-actions github-actions bot mentioned this pull request Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants