Fix GeoJSON geometries that cross the antimeridian
Project description
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
, andMultiLineString
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.3.1.tar.gz
(15.4 kB
view details)
Built Distribution
File details
Details for the file antimeridian-0.3.1.tar.gz
.
File metadata
- Download URL: antimeridian-0.3.1.tar.gz
- Upload date:
- Size: 15.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57779363ac73a41583ac36ea0333cf78785f8b253b865b4a0ba9602b2fbd6d5c |
|
MD5 | 414742170fe73583793b5f40c3f2dbaa |
|
BLAKE2b-256 | aa23caf88a26bc263e480ff09207ccf9a4c3f3904271bdc68842a6c85e8e72bc |
File details
Details for the file antimeridian-0.3.1-py3-none-any.whl
.
File metadata
- Download URL: antimeridian-0.3.1-py3-none-any.whl
- Upload date:
- Size: 13.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 275923275138706a7c7499f8e82fa0cb4ba9e9efe4ecd53ded51c479bea39eb6 |
|
MD5 | cb6f142bee92a17b7670afa7b6abcaee |
|
BLAKE2b-256 | f13ae4e8e7054d37ef6a12dc74d9c6678123e260f6bce2c87ca53b4d8c64c4f3 |