antimeridian
Fix shapes that cross the antimeridian. See the documentation for information about the underlying algorithm. Depends on shapely and numpy.
Can fix:
- Shapely
Polygon,MultiPolygon,LineString, andMultiLineStringobjects - GeoJSON Polygons, MultiPolygons, Features and FeatureCollections, as dictionaries
- Anything that has a
__geo_interface__
This repo has been ported to a few other languages:
- Typescript: https://github.com/krisaoe/antimeridian-ts
- Go: https://github.com/go-geospatial/antimeridian
Usage
python -m pip install antimeridian
Then:
import antimeridian
fixed = antimeridian.fix_geojson(geojson)
[!NOTE]
fix_geojsonmutates the input dictionary in-place. If you need to preserve the original GeoJSON, make a copy first:import copy fixed = antimeridian.fix_geojson(copy.deepcopy(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
Release files for antimeridian 0.4.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| antimeridian-0.4.9.tar.gz | 12.6 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| antimeridian-0.4.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size:12.6 MB
Release files / antimeridian-0.4.9.tar.gz
| Download URL | antimeridian-0.4.9.tar.gz |
|---|---|
| Size | 12.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7ac3799ab74613d87425b92e09a098a8eb71998bbe33d02d17302c566fd31064
|
|
BLAKE2b-256 checksum How to use checksums |
4bb95f7cc9cd82b00cedf4fca84e537ca72e7db33b6595f7737387a9a8ba05ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 3, 2026.
Transparency logRelease files / antimeridian-0.4.9-py3-none-any.whl
| Download URL | antimeridian-0.4.9-py3-none-any.whl |
|---|---|
| Size | 15.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0f6a0e875264422de4809bc04aefaec449d3957a8082b05ea648dd5d3017b7a1
|
|
BLAKE2b-256 checksum How to use checksums |
33e6097a020525a877f286991afbd4e91758658e83427c8e6f5681f11cbe7005
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 3, 2026.
Transparency log