geojson-shave reduces the size of GeoJSON files by:
- Reducing the precision of 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 conforms to the RFC 7946.
Please be aware that when you use fewer decimal places you can lose some accuracy. "The fifth decimal place is worth up to 1.1 m: it distinguish trees from each other" - read more here.
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
Alternatively you can specify the number of decimal points you want the coordinates 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
Or select a positive list of properties to keep:
$ geojson-shave roads.geojson -kp id,name,level
Output to a directory other than the current working directory:
$ geojson-shave roads.geojson -o ../data/output.geojson
Metadata
Release files for geojson-shave 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| geojson_shave-0.2.0.tar.gz | 7.8 kB | Without provenance | Details for geojson_shave-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| geojson_shave-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for geojson_shave-0.2.0-py3-none-any.whl |
Total release size: 14.7 kB
Release files / geojson_shave-0.2.0.tar.gz
| Download URL | geojson_shave-0.2.0.tar.gz |
|---|---|
| Size | 7.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
883461e80bb46e876eeb817c8e043385cb9c0e10dd5719a7cf6ff4772ce9fcc8
|
|
BLAKE2b-256 checksum How to use checksums |
78dccfd9e420f46cb18b9ebb88a87415180207011c84b3fb22d38196fae285a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.10.2
|
Release files / geojson_shave-0.2.0-py3-none-any.whl
| Download URL | geojson_shave-0.2.0-py3-none-any.whl |
|---|---|
| Size | 6.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
949a1ff8b86b23e53a1b15295d439165890631c15c7efab442bdabafc4f66c36
|
|
BLAKE2b-256 checksum How to use checksums |
50f6265755fdcaef3feeef3993f4e3c9c31d09ad85657df8a00d6d5b26b4f0a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.10.2
|
Security for geojson-shave 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.