Skip to main content

Fix GeoJSON geometries that cross the 180th meridian

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

python -m 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:

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

Developing

Get uv. Then:

git clone https://github.com/gadomski/antimeridian
cd antimeridian
uv sync

We use pytest for tests:

uv run pytest

We use Sphinx for docs:

make -C docs html

Contributing

See CONTRIBUTING.md.

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.10.tar.gz (10.1 MB view details)

Uploaded Source

Built Distribution

antimeridian-0.3.10-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: antimeridian-0.3.10.tar.gz
  • Upload date:
  • Size: 10.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for antimeridian-0.3.10.tar.gz
Algorithm Hash digest
SHA256 6928234d98b516ba21808d51284b2358d8dc7a01f62874cc850b8e25f38dac20
MD5 0ed6ba4c5493e1ea78e7d607a81f8f40
BLAKE2b-256 3b852d2f8d439802d82128c601e65d0257c3c0afcf5ac65174471f7c2545851c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for antimeridian-0.3.10-py3-none-any.whl
Algorithm Hash digest
SHA256 307c26046e5caca1516d49b1e4f4fa11ca2a4a1a665e631dd606984a7ca0eee1
MD5 384fb939af119c0aa7435e2c8a5d8179
BLAKE2b-256 5ad385daf2d64486fd5ec52ba082a927b3bbd8652331fe3ee399226612763eb6

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