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.4.tar.gz
(12.5 kB
view details)
Built Distribution
File details
Details for the file antimeridian-0.2.4.tar.gz
.
File metadata
- Download URL: antimeridian-0.2.4.tar.gz
- Upload date:
- Size: 12.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c79423a1fd5f58561e967fe96cc41488f35970d93f78107889512e2e94240461 |
|
MD5 | ac8acf8a38f2ddacca483a0d3d4fb206 |
|
BLAKE2b-256 | a354427963d7dc6c57413f4712e4a538b1282f3a36bb1c58d2e2c84a967caed9 |
File details
Details for the file antimeridian-0.2.4-py3-none-any.whl
.
File metadata
- Download URL: antimeridian-0.2.4-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 | ec8ffe925f91f29822f58503c3487674a7ba66b3b72fbcbeb49551a8e9675258 |
|
MD5 | 03da6b5cfcaf3fad788a5bd8159ea800 |
|
BLAKE2b-256 | a4d5885a95f45918f9eb455c6ce8450bc2041c2aeece0a15d1a8e7b48c875353 |