Fix GeoJSON geometries that cross the antimeridian
Project description
antimeridian
Fix polygons that cross the antimeridian. See the documentation for information about the underlying algorithm. Depends on shapely.
Can fix:
- Shapely
Polygon
andMultiPolygon
objects - GeoJSON Polygons, MultiPolygons, Features and FeatureCollections, as dictionaries
- Anything that has a
__geo_interface__
Usage
pip install antimeridian
Then:
import antimeridian
fixed = antimeridian.fix_geojson(geojson)
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
Project details
Release history Release notifications | RSS feed
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.2.3.tar.gz
(12.4 kB
view details)
Built Distribution
File details
Details for the file antimeridian-0.2.3.tar.gz
.
File metadata
- Download URL: antimeridian-0.2.3.tar.gz
- Upload date:
- Size: 12.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef0557423d2319d74e678a453fbbe0dec4fdc0936fe1eb120d2a065f1f7fc5a4 |
|
MD5 | 014eeccdce95fae97208d664ed42fa8a |
|
BLAKE2b-256 | fdb1a115596d1c00926afaa6fb6613de1667621f878780730694c9e64f600c95 |
File details
Details for the file antimeridian-0.2.3-py3-none-any.whl
.
File metadata
- Download URL: antimeridian-0.2.3-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19f2b13cc78ba5b46e71ad9864ed3de8ccf251e07eeaea93a8ace8e7d87fe65e |
|
MD5 | a4997dbdc94456a1f4413195bcb6ec73 |
|
BLAKE2b-256 | 5bdb902a174ede5779f1e9c4fb8caf89f42ff529f481e5bab392e3fc73c52c19 |