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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: antimeridian-0.3.11.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.11.tar.gz
Algorithm Hash digest
SHA256 fde0134e6799676ec68765d3e588f5f32cabd4041b1f969b923758d0a6cd0c7f
MD5 57f51ef14eff8ae307de962a0c487927
BLAKE2b-256 f2427bddf42ea25e5e682aea63b76326d09cedb1b3f28cc4a9cf680a271ae3fc

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for antimeridian-0.3.11-py3-none-any.whl
Algorithm Hash digest
SHA256 1c08efe55de11338235d21920d49bacbc63fe369d3f23c6e00d9cf08b052ede1
MD5 6198625617dfcf5200ac5051f114e3bf
BLAKE2b-256 f5e3a1ce92c9082936d0b58dba6e74a980c0b9eef2714bd3f4a988a7bfd4ec65

See more details on using hashes here.

Provenance

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