-
Notifications
You must be signed in to change notification settings - Fork 7
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
Use great circles to calculate crossing latitude #153
Comments
That's correct, we don't: antimeridian/src/antimeridian/_implementation.py Lines 501 to 512 in 0f4ccb1
I'll mark this as an enhancement 👍🏼 |
Thanks, good to know! Would you be open to a PR for this ? I see the only dependencies are |
Yes! That would be excellent.
I try to stay dependency-light if possible, and IIRC it's not that complicated of an equation, so if we can implement it directly w/o too much hassle that would be my preference. |
This commit adds an option to compute the intersection of a segment and the meridian using spherical geometry, which provides nicer splits for large crossing the meridian diagonally. Related to gadomski#153
* feat: add great-circle meridian crossing option This commit adds an option to compute the intersection of a segment and the meridian using spherical geometry, which provides nicer splits for large crossing the meridian diagonally. Related to #153 * feat: add great_circle argument to functions This propagates the decision of whether to use planar or spherical geometry to compute meridian crossing latitudes. The default is set to False to keep this commit self-contained, because changing the default has a significant impact on the test results. The change of default will be done in a later commit, which will update the test suite at the same time. See #159 (comment) * feat: parametrize tests over great_circle values * feat: add --no-great-circle option to CLI This provides a way to opt out of the default spherical geometry used for computing meridian crossings. * feat: move output test data to subdirectory This prepares the addition of test outputs expected from spherical geometry. * feat: refactor Reader type alias as protocol This is required to introduce an optional argument with a default value (subdirectory), which cannot be expressed with Callable type hinting only. This has the nice benefit of not removing the need for typing extensions, since Protocols are available since Python 3.8, which is lower than the oldest non-EOL Python version. See https://docs.python.org/3/library/typing.html#annotating-callable-objects * test: add great-circle polygon fixing test The output of ogr2ogr is consistent with the behaviour of great-circle meridian crossing computation introduced by this PR. * docs: add entry to changelog * test: add great circle test suite The differences have been checked visually and are convincing, except the force-north-pole test for which a double-check would be needed. * feat!: change default value of great_circle arg Some tests were kept unparametrized over great_circle to make sure that the default behaviour is also tested. See #159 (comment) BREAKING CHANGE: Meridian crossings are now computed using spherical geometry by default.
Hello,
I'm using the following polygon as input
When running
antimeridian fix poly.json
I'm getting the following result
which does not seem correct ? I was expecting the lines between the four vertices to be ~straight, but they're not. At least I did not expect it to be a discontinuity at the antimeridian, but I might make wrong assumptions. Could this be due to
crossing_latitude
not performing great circle intercepts with the 180° meridian ?The text was updated successfully, but these errors were encountered: