Skip to main content

Fix GeoJSON geometries that cross the antimeridian

Project description

antimeridian

CI Status Read the Docs PyPI

GitHub Contributor Covenant

Demonstration image

Fix shapes that cross the antimeridian. See the documentation for information about the underlying algorithm. Depends on shapely and numpy.

Can fix:

Usage

pip install antimeridian

Then:

import antimeridian

fixed = antimeridian.fix_geojson(geojson)

We also have some utilities to create bounding boxes and centroids from antimeridian-crossing polygons and multipolygons. See the documentation for a complete API reference.

Command line interface

Use the cli optional dependency to install the antimeridian CLI:

pip install 'antimeridian[cli]'
antimeridian fix input.json > output.json

Developing

Clone and install in editable mode with the development optional dependencies:

git clone https://github.com/gadomski/antimeridian
cd antimeridian
pip install -e '.[dev,docs]'

We use pytest for tests:

pytest

We use Sphinx for docs:

make -C docs html

Contributing

Github issues and pull requests, please and thank you!

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

antimeridian-0.3.5.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

antimeridian-0.3.5-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file antimeridian-0.3.5.tar.gz.

File metadata

  • Download URL: antimeridian-0.3.5.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for antimeridian-0.3.5.tar.gz
Algorithm Hash digest
SHA256 ec812b84d5b968ffb6af5e21306c27dbd43a59aa07c624749aea1a52ac300b80
MD5 f4b5310cf7589cd307d98829c420fba9
BLAKE2b-256 909509580768da0ae5d14c5273638380dbdc2147e6efb831597e8f1ce1a00cce

See more details on using hashes here.

File details

Details for the file antimeridian-0.3.5-py3-none-any.whl.

File metadata

File hashes

Hashes for antimeridian-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 88fa229ca61f96ea4744cf17712ccdb647b2cc6ac98965b5082195b8b19a2d48
MD5 68ab42c3393bbff4f40d90e41c99c558
BLAKE2b-256 e0de43d820e09c2f7fd382f9c7e54306f4e51168dbf078874c1fa8ab129956f8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page