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

fix: Orient exterior rings counter-clockwise TDE-1205 #987

Closed
wants to merge 2 commits into from

Conversation

l0b0
Copy link
Contributor

@l0b0 l0b0 commented Jun 13, 2024

Depends on #993.

Motivation

GeoJSON requires this:

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.

However, Shapely does not do this by default.

Closes linz/elevation#298 (but we'll have to reprocess datasets to get the right geometry).

Before: capture-area.geojson
After: capture-area.geojson

Example from Hawke's Bay 2023 Elevation dataset:
Before:
Screenshot from 2024-06-21 13-51-55
capture-area.hb.before.zip

After:
Screenshot from 2024-06-21 13-52-01
capture-area.hb.after.zip

Modification

Reverse merged polygon orientation.

Checklist

  • Tests updated
  • Docs updated
  • Issue linked in Title

@l0b0 l0b0 force-pushed the fix/counter-clockwise-outer-ring branch 4 times, most recently from 85b7f9d to 2f6e37f Compare June 13, 2024 02:15
@l0b0 l0b0 marked this pull request as ready for review June 13, 2024 02:15
@l0b0 l0b0 requested a review from a team as a code owner June 13, 2024 02:15
@l0b0 l0b0 force-pushed the fix/counter-clockwise-outer-ring branch 4 times, most recently from 8f7060d to b98e3cb Compare June 14, 2024 03:08
@amfage amfage force-pushed the fix/counter-clockwise-outer-ring branch from b98e3cb to 8f6fdb7 Compare June 14, 2024 03:39
@l0b0 l0b0 enabled auto-merge June 14, 2024 03:40
@l0b0 l0b0 force-pushed the fix/counter-clockwise-outer-ring branch from 8f6fdb7 to 29a170f Compare June 14, 2024 03:41
l0b0 added 2 commits June 20, 2024 09:29
We load the item from a JSON file into a `dict` in the production code,
but none of our automated tests verify this code path, so it broke.

This partially reverts commit ed177c6.
[GeoJSON requires this](https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.6):

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

However,
[Shapely does not do this by default](shapely/shapely#622).
@l0b0 l0b0 force-pushed the fix/counter-clockwise-outer-ring branch from 29a170f to fb6adcf Compare June 20, 2024 21:48
@amfage amfage marked this pull request as draft June 23, 2024 21:39
auto-merge was automatically disabled June 23, 2024 21:39

Pull request was converted to draft

@amfage amfage closed this Jul 24, 2024
@amfage
Copy link
Contributor

amfage commented Jul 24, 2024

Superseded by #1008 to specify counter-clockwise.

@l0b0 l0b0 deleted the fix/counter-clockwise-outer-ring branch November 4, 2024 20:27
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.

Hawkes-bay 2023 capture_area.geojson doesn't validate
2 participants