Skip to main content

Correct GeoJSON geometries that cross the 180th meridian

Project description

antimeridian

CI Status Docs PyPI Conda Downloads GitHub Contributor Covenant

status DOI

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

To build and serve the docs locally:

uv run mkdocs serve

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

Uploaded Source

Built Distribution

antimeridian-0.4.1-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: antimeridian-0.4.1.tar.gz
  • Upload date:
  • Size: 12.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for antimeridian-0.4.1.tar.gz
Algorithm Hash digest
SHA256 4efe7aa15ef1bc66169392870d54b945c31ef9574e08bc930650f0b7beefc354
MD5 1e5353a216c06dcdb4ceadd6d4e6c99f
BLAKE2b-256 de4fb83d7ea4ee0ff64fa36906f82d6f2c227aa36828481f60eafbf320dea6c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for antimeridian-0.4.1.tar.gz:

Publisher: release.yaml on gadomski/antimeridian

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: antimeridian-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for antimeridian-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 45c31d5fc834863175a1d20b522c1da941edb906dfd84a05fae5007985efe405
MD5 863043e40cdcfcce690e4e49a5884841
BLAKE2b-256 107a12dcb24f69cb8fb8b65b810d9590038b06c528f5b57c6db9bfaecc7121e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for antimeridian-0.4.1-py3-none-any.whl:

Publisher: release.yaml on gadomski/antimeridian

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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