0.2.1 • Published 9 years ago
geojson-helpers v0.2.1
GeoJSON Helpers
Helps read & write GeoJSON files based on RFC 7946 GeoJSON.
Install
$ npm install --save geojson-helpersQuickstart
import geojson from 'geojson-helpers'
const featureCollection = geojson.readFileSync('places.geojson')
// <--Data processing-->
geojson.writeFileSync('new-places.geojson', featureCollection)Features
- Reads GeoJSON files
- Writes GeoJSON files
- Compact indentation, 1 line per feature (smallest file size possible)
- Limits coordinates decimals to a maximum of 6
- Does not include CRS
writeFileSync
Writes GeoJSON file
Parameters
pathstringgeojsonFeatureCollection GeoJSON FeatureCollectionproperties[Array<(string | number)>] Only include the following properties
readFileSync
Reads GeoJSON file
Parameters
pathstring File must be a GeoJSON FeatureCollection
Changelog
0.1.0 - 2016-11-09
Begining of project geojson-helpers.
- readFileSync
- writeFileSync