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 rhumb triangulation across IDL #8206

Closed
wants to merge 2 commits into from
Closed

Conversation

hpinkos
Copy link
Contributor

@hpinkos hpinkos commented Sep 20, 2019

Fixes #8042

This is the same fix @shehzan10 added in #8176, but attempts to account for when the polygon positions cross the IDL for the projection into 2D for triangulation. It makes the assumption that if adjacent polygon positions are greater than 180 degrees away, it must be because that position crossed the IDL and it adds TWO_PI to the longitude. I think this is a safe assumption because Cesium can't triangulate polygons that are larger than half the earth anyway. I honestly couldn't figure out a better way to do this, but I'm open to suggestions if anyone has one. I originally wanted to use Rectangle.fromCartesianArray to get the "west" edge but that doesn't handle the case where a polygon crosses both the IDL and the prime meridian.

TODO

  • Fix polygons that cross poles

@cesium-concierge
Copy link

Thanks for the pull request @hpinkos!

  • ✔️ Signed CLA found.
  • CHANGES.md was not updated.
    • If this change updates the public API in any way, please add a bullet point to CHANGES.md.
  • ❔ Unit tests were not updated.
    • Make sure you've updated tests to reflect your changes, added tests for any new code, and ran the code coverage tool.

Reviewers, don't forget to make sure that:

  • Cesium Viewer works.
  • Works in 2D/CV.
  • Works (or fails gracefully) in IE11.

@hpinkos
Copy link
Contributor Author

hpinkos commented Sep 20, 2019

@shehzan10 please review

@hpinkos
Copy link
Contributor Author

hpinkos commented Sep 20, 2019

shoot, I made a mistake and forgot to account for polygons that go across the north or south pole. I'm going to revert those changes in master and put this on hold until we figure out a solution that works in all those edge cases.

@hpinkos hpinkos mentioned this pull request Sep 20, 2019
@hpinkos hpinkos closed this Sep 23, 2019
@hpinkos hpinkos deleted the fix-rhumb-triangulation branch September 23, 2019 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GeoJSON renders incorrectly with default Rhumb arc type
2 participants