0.3.6 • Published 7 years ago

geojson-writer v0.3.6

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

GeoJSON Writer

Build Status Circle CI Coverage Status npm version Known Vulnerabilities MIT licensed

Reads & writes GeoJSON files based on RFC 7946 GeoJSON.

Install

$ npm install --save geojson-writer

Quickstart

import {writer, reader} from 'geojson-writer'

const data = reader('places.geojson')
// <--Data processing-->
writer('places-processed.geojson', data)

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

API

writer

Writes GeoJSON file

Parameters

  • path string File path
  • geojson Features GeoJSON FeatureCollection
  • options [Options](default {}) Options
    • options.properties [Array<string>] List of properties to include in GeoJSON
    • options.precision [number] Reduce coordinate precision (optional, default 6)
    • options.boolean [boolean] Drop Z coordinates (optional, default false)
    • options.properties [Array<(string | number)>] Only include the following properties

Returns void

removeEmptyProperties

Remove Empty values

Parameters

  • feature Feature

reader

Reads GeoJSON file

Parameters

  • path string File must be a GeoJSON FeatureCollection

Returns Features GeoJSON FeatureCollection

toFix

Reduce coordinate precision

Parameters

  • array
  • precision (optional, default 6)

writeFeature

Write Feature

Parameters

  • stream
  • feature
  • index
  • array
0.3.6

7 years ago

0.3.5

7 years ago

0.3.4

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago