geojson-precision
Advanced tools
Comparing version 0.2.2 to 0.2.3
{ | ||
"name": "geojson-precision", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "Remove meaningless precision from GeoJSON", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# geojson-precision | ||
Remove meaningless precision from your GeoJSON. If your coordinates go out to 7+ digits, you are [probably misrepresenting your data](http://gis.stackexchange.com/a/8674/14196). Most scenarios in which GeoJSON is useful (i.e. web-related applications) do not require survey-grade precision, and a higher value is placed on a compact file size. Trimming the precision of coordinates can greatly reduce file size, while removing the appearance of fake high precision. | ||
## Install | ||
@@ -9,8 +10,3 @@ ```` | ||
## CLI | ||
````geojson-precision -p 4 input.json output.json```` | ||
## API | ||
@@ -23,4 +19,5 @@ | ||
````precision```` is a positive integer. If your specified ````precision```` value is greater than the precision of the input geometry, the output precision will be the same as the input. For example, if your input coordinates are ````[10.0, 20.0]````, and you specify a ````precision```` of ````5````, the output will be the same as the input. | ||
Example use: | ||
##### Example use: | ||
@@ -52,2 +49,33 @@ ```` | ||
````.parse()```` can also be used directly, for example: | ||
```` | ||
var gp = require("geojson-precision"); | ||
var trimmed = gp({ ... }, 3); | ||
```` | ||
## CLI | ||
Geojson-precision can also be used via the command line. Especially easy to use if installed globally (using ````-g````). | ||
###Parameters | ||
###### precision (-p) | ||
A positive integer specifying coordinate precision | ||
###### input | ||
An input GeoJSON file | ||
###### output | ||
An output GeoJSON file | ||
##### Example use | ||
```` | ||
geojson-precision -p 4 input.json output.json | ||
```` | ||
## Inspiration | ||
@@ -54,0 +82,0 @@ Concepts, ideas, etc borrowed to various degrees from: |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6586137
86