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.5.tar.gz
(13.2 kB
view details)
Built Distribution
File details
Details for the file antimeridian-0.2.5.tar.gz
.
File metadata
- Download URL: antimeridian-0.2.5.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc42ce90d8a9428be003e5f99d7124aa06eb2ba939d388d8c487c2f9a28fd3fb |
|
MD5 | 3504ad620cdd07d989c4278ef02319bf |
|
BLAKE2b-256 | eeace429e496027d77f1c53bd4aeadcaa473269a990f0816cd696ae8b9aa158c |
File details
Details for the file antimeridian-0.2.5-py3-none-any.whl
.
File metadata
- Download URL: antimeridian-0.2.5-py3-none-any.whl
- Upload date:
- Size: 11.7 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 | a685764a37e9196e947d8bc0e116f93782fe8a53deb4015a2e5a19c9a83b7f49 |
|
MD5 | 191618095fdddba15ee7edf898bef9f9 |
|
BLAKE2b-256 | f31567954e235c7fb6643fbf7e47e4ed4310a2b86f20643d8c5a4c2fe4791cb0 |