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:

This repo has been ported to a few other languages:

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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

antimeridian-0.4.5-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for antimeridian-0.4.5.tar.gz
Algorithm Hash digest
SHA256 088f8daec4109ce5d85d52e9b4382bffcbd1a5b47c78644898f9c6d8562d1207
MD5 3ff2996b9162aab527e8b2764c51dd2c
BLAKE2b-256 0a25183493a0a47f1a70d22329083c65396ee8a343a6dbe6b3eb29d0da496099

See more details on using hashes here.

Provenance

The following attestation bundles were made for antimeridian-0.4.5.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.5-py3-none-any.whl.

File metadata

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

File hashes

Hashes for antimeridian-0.4.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8b1f82c077d2c48eae0a6606759cfec9133a0701250371cb707a56959451d9dd
MD5 5cb756f82afc8d6897ad58400f0a306a
BLAKE2b-256 69ce68d6e31f0a75a5cccc03535e47434c0ca4be37fe950e93117e455cbc362c

See more details on using hashes here.

Provenance

The following attestation bundles were made for antimeridian-0.4.5-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 Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page