A command-line tool for reducing the size of GeoJSON files.
Project description
geojson-shave reduces the size of GeoJSON files by:
- Truncating latitude/longitude coordinates to the specified decimal places.
- Eliminating unnecessary whitespace.
- (Optionally) replacing the properties key's value with null/empty dictionary.
This tool assumes that your GeoJSON file confirms to the RFC 7946.
Installation
$ pip install geojson-shave
Usage
Simply pass the file path of your GeoJSON file and it will truncuate the coordinates to 5 decimal places, outputing to the current working directory:
$ geojson-shave roads.geoson
Alterntatively you can specify the number of decimal points you want the coordiantes truncuated to:
$ geojson-shave roads.geojson -d 3
You can also specify if you only want certain Geometry object types in the file to be processed:
$ geojson-shave roads.geojson -g LineString Polygon
Note that the -g option doesn't apply to objects nested within Geometry Collection.
And to reduce the file size even further you can nullify the property value of Feature objects:
$ geojson-shave roads.geojson -p
Output to a directory other than the current working directory:
$ geojson-shave roads.geojson -o ../data/output.geojson
TODO
- Add support for passing the URL of a hosted GeoJSON file to the tool.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for geojson_shave-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 672192a5949cea4988cbcd833088085e6088cba6574f0108dda10a5f40a84c4c |
|
MD5 | 6605a7ef8f668103abef3b9b1ed5fddb |
|
BLAKE2b-256 | d9db1b5f8f2bdfba3e8be841984dd2c3ecc688e1e6640bf48b5af848490ddf0a |