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

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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: antimeridian-0.3.9.tar.gz
  • Upload date:
  • Size: 13.3 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.9.tar.gz
Algorithm Hash digest
SHA256 006570ca60b2e71ac3f8ab796bb0235b437162ed13e739402ba8a8b0dea6d720
MD5 7d90a9cc20529b4662612b9db85ab9f6
BLAKE2b-256 2b2f6837e0d13ec47970dd65ce5ce8f338909cbe2f6aa76752010bf5aa29ffc6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: antimeridian-0.3.9-py3-none-any.whl
  • Upload date:
  • Size: 14.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for antimeridian-0.3.9-py3-none-any.whl
Algorithm Hash digest
SHA256 c8434c29bdbd23af571913ede823b4b72a51a023b9ae0c37504ae1beeabba2fc
MD5 24e45a6606958c7e07cd43146058ed6e
BLAKE2b-256 0ad176e8ac9ef97279b1fe1e274f2e1754f0f51d2006b43c594e0b5e36222993

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