geojson-helpers

0.2.1 • Public • Published

Build Status Coverage Status npm version MIT licensed

GeoJSON Helpers

Helps read & write GeoJSON files based on RFC 7946 GeoJSON.

Install

$ npm install --save geojson-helpers

Quickstart

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

  • path string
  • geojson FeatureCollection GeoJSON FeatureCollection
  • properties [Array<(string | number)>] Only include the following properties

readFileSync

Reads GeoJSON file

Parameters

  • path string File must be a GeoJSON FeatureCollection

Changelog

0.1.0 - 2016-11-09

Begining of project geojson-helpers.

  • readFileSync
  • writeFileSync

Package Sidebar

Install

npm i geojson-helpers

Weekly Downloads

0

Version

0.2.1

License

MIT

Last publish

Collaborators

  • deniscarriere