gadomski / antimeridian

Correct GeoJSON geometries that cross the 180th meridian
https://antimeridian.readthedocs.io
Apache License 2.0
50 stars 6 forks source link

Support arbitrary antimeridian location #132

Open philipc2 opened 2 months ago

philipc2 commented 2 months ago

Occasionally, the range of my longitude values may be in the range of [0, 360] instead of [-180, 180]. I'm wondering if it would be useful to allow for a user-defined antimeridian location.

Right now for uxarray we are restricted to having our longitude in the [-180, 180] range due to this.

gadomski commented 2 months ago

Occasionally, the range of my longitude values may be in the range of [0, 360] instead of [-180, 180]. I'm wondering if it would be useful to allow for a user-defined antimeridian location.

Maybe, but my guess it that it would take a non-trivial refactor. [0, 360] should work on input because of this, if it doesn't that's a bug: https://github.com/gadomski/antimeridian/blob/18336fbeaf5c54fb368e0fb4a43b35fb2ba3327b/src/antimeridian/_implementation.py#L455

To get [0, 360] on output it would just be a matter of applying the inverse operation on the output.