Name | geojson-shave JSON |
Version |
0.2.0
JSON |
| download |
home_page | None |
Summary | A command-line tool for reducing the size of GeoJSON files. |
upload_time | 2024-07-01 12:33:24 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | MIT License Copyright (c) 2024, Ben Nour Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
geojson
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<p align="center">
<a href="https://pypi.python.org">
<img src="https://ben-nour.com/images/geojson-shave.png" alt="GeoJSON-shave" style="width: 60%; height: auto;"/>
</a>
</p>
<p align="center">
<a href="https://github.com/ben-n93/geojson-shave/actions/workflows/tests.yml"><img src="https://github.com/ben-n93/geojson-shave/actions/workflows/tests.yml/badge.svg" alt="Testing"></a>
<a href="https://github.com/ben-n93/geojson-shave/blob/main/LICENSE"><img src="https://img.shields.io/pypi/l/geojson-shave" alt="License"></a>
<a href="https://codecov.io/gh/ben-n93/geojson-shave" ><img src="https://codecov.io/gh/ben-n93/geojson-shave/graph/badge.svg?token=XUMK0D4J9X"/></a>
<a href="https://pypi.org/project/geojson-shave/"><img src="https://img.shields.io/pypi/pyversions/geojson-shave" alt="versions"></a>
<a href="https://github.com/tmcw/awesome-geojson"><img src="https://awesome.re/mentioned-badge.svg" alt="awesome list badge"></a>
</p>
---
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](https://datatracker.ietf.org/doc/html/rfc7946).
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](https://gis.stackexchange.com/questions/8650/measuring-accuracy-of-latitude-and-longitude).
## Installation
```
$ pip install geojson-shave
```
## Usage
<p align="center">
<a href="https://pypi.python.org">
<img src="https://ben-nour.com/images/demo.gif" alt="GeoJSON-shave-demo">
</a>
</p>
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
```
Raw data
{
"_id": null,
"home_page": null,
"name": "geojson-shave",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "geojson",
"author": null,
"author_email": "Ben Nour <hello@ben-nour.com>",
"download_url": "https://files.pythonhosted.org/packages/78/dc/cfd9e420f46cb18b9ebb88a87415180207011c84b3fb22d38196fae285a0/geojson_shave-0.2.0.tar.gz",
"platform": null,
"description": "\n<p align=\"center\">\n <a href=\"https://pypi.python.org\">\n <img src=\"https://ben-nour.com/images/geojson-shave.png\" alt=\"GeoJSON-shave\" style=\"width: 60%; height: auto;\"/>\n </a>\n</p>\n\n<p align=\"center\">\n <a href=\"https://github.com/ben-n93/geojson-shave/actions/workflows/tests.yml\"><img src=\"https://github.com/ben-n93/geojson-shave/actions/workflows/tests.yml/badge.svg\" alt=\"Testing\"></a>\n <a href=\"https://github.com/ben-n93/geojson-shave/blob/main/LICENSE\"><img src=\"https://img.shields.io/pypi/l/geojson-shave\" alt=\"License\"></a>\n <a href=\"https://codecov.io/gh/ben-n93/geojson-shave\" ><img src=\"https://codecov.io/gh/ben-n93/geojson-shave/graph/badge.svg?token=XUMK0D4J9X\"/></a>\n <a href=\"https://pypi.org/project/geojson-shave/\"><img src=\"https://img.shields.io/pypi/pyversions/geojson-shave\" alt=\"versions\"></a>\n <a href=\"https://github.com/tmcw/awesome-geojson\"><img src=\"https://awesome.re/mentioned-badge.svg\" alt=\"awesome list badge\"></a>\n</p>\n\n---\n\ngeojson-shave reduces the size of GeoJSON files by:\n\n- Reducing the precision of latitude/longitude coordinates to the specified decimal places.\n- Eliminating unnecessary whitespace.\n- (Optionally) replacing the properties key's value with null/empty dictionary.\n\nThis tool assumes that your GeoJSON file conforms to the [RFC 7946](https://datatracker.ietf.org/doc/html/rfc7946).\n\nPlease 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](https://gis.stackexchange.com/questions/8650/measuring-accuracy-of-latitude-and-longitude).\n\n## Installation\n```\n$ pip install geojson-shave\n```\n\n## Usage\n\n<p align=\"center\">\n <a href=\"https://pypi.python.org\">\n <img src=\"https://ben-nour.com/images/demo.gif\" alt=\"GeoJSON-shave-demo\">\n </a>\n</p>\n\nSimply pass the file path of your GeoJSON file and it will truncuate the coordinates to 5 decimal places, outputing to the current working directory:\n\n```\n$ geojson-shave roads.geoson\n```\n\nAlternatively you can specify the number of decimal points you want the coordinates truncuated to:\n\n```\n$ geojson-shave roads.geojson -d 3\n```\n\nYou can also specify if you only want certain Geometry object types in the file to be processed:\n\n```\n$ geojson-shave roads.geojson -g LineString Polygon\n```\n\nNote that the -g option doesn't apply to objects nested within Geometry Collection.\n\nAnd to reduce the file size even further you can nullify the property value of Feature objects:\n\n```\n$ geojson-shave roads.geojson -p\n```\n\nOr select a positive list of properties to keep:\n\n```\n$ geojson-shave roads.geojson -kp id,name,level\n```\n\nOutput to a directory other than the current working directory:\n\n```\n$ geojson-shave roads.geojson -o ../data/output.geojson\n```\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2024, Ben Nour Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "A command-line tool for reducing the size of GeoJSON files.",
"version": "0.2.0",
"project_urls": {
"homepage": "https://github.com/ben-n93/geojson-shave",
"repository": "https://github.com/ben-n93/geojson-shave"
},
"split_keywords": [
"geojson"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "50f6265755fdcaef3feeef3993f4e3c9c31d09ad85657df8a00d6d5b26b4f0a4",
"md5": "2da3e804f69c72571d6e2060ce16c777",
"sha256": "949a1ff8b86b23e53a1b15295d439165890631c15c7efab442bdabafc4f66c36"
},
"downloads": -1,
"filename": "geojson_shave-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2da3e804f69c72571d6e2060ce16c777",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 6909,
"upload_time": "2024-07-01T12:33:23",
"upload_time_iso_8601": "2024-07-01T12:33:23.287710Z",
"url": "https://files.pythonhosted.org/packages/50/f6/265755fdcaef3feeef3993f4e3c9c31d09ad85657df8a00d6d5b26b4f0a4/geojson_shave-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "78dccfd9e420f46cb18b9ebb88a87415180207011c84b3fb22d38196fae285a0",
"md5": "c865f352e0d74a1766883bd20d34a0db",
"sha256": "883461e80bb46e876eeb817c8e043385cb9c0e10dd5719a7cf6ff4772ce9fcc8"
},
"downloads": -1,
"filename": "geojson_shave-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "c865f352e0d74a1766883bd20d34a0db",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 7822,
"upload_time": "2024-07-01T12:33:24",
"upload_time_iso_8601": "2024-07-01T12:33:24.476476Z",
"url": "https://files.pythonhosted.org/packages/78/dc/cfd9e420f46cb18b9ebb88a87415180207011c84b3fb22d38196fae285a0/geojson_shave-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-01 12:33:24",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ben-n93",
"github_project": "geojson-shave",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "geojson-shave"
}