Socket
Socket
Sign inDemoInstall

geojson-precision

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

geojson-precision - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

2

package.json
{
"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:

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc