Skip to main content

Fix GeoJSON geometries that cross the antimeridian

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

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:

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

Developing

Clone and install in editable mode with the development optional dependencies:

git clone https://github.com/gadomski/antimeridian
cd antimeridian
pip install -e '.[dev,docs]'

We use pytest for tests:

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.4.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

antimeridian-0.3.4-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: antimeridian-0.3.4.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for antimeridian-0.3.4.tar.gz
Algorithm Hash digest
SHA256 4d84ff711ce91a7ff005ca145b6301a4a4572eab32e439edd0b76d2c318d70e5
MD5 57f2e2596985eaf035377d84b64e40c2
BLAKE2b-256 3bfd2a288c9a4cefe32391430e6974e444d8e580f52e95d2e0725cac6f9fdb01

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: antimeridian-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for antimeridian-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 88e8eabf08c327457dd477c57f6f41c88a9ef65a8fee5267918d7552de7cb13b
MD5 4e760872b89db6a9e0e445583524e83d
BLAKE2b-256 1f8f5a27e262cb5ee5ee8c521c075100aa912e55136c058d2aedb36203b6cd2c

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