# geojson-helpers

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

Latest version **0.2.1** (published 2016-11-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install geojson-helpers
pnpm add geojson-helpers
yarn add geojson-helpers
bun add geojson-helpers
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2016-11-25 |
| First published | 2016-11-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Denis Carriere |
| Maintainers | deniscarriere |
| Keywords | gis, geo, geojs, geospatial, geography, geojson |

## Links

- npm: https://www.npmjs.com/package/geojson-helpers
- Repository: https://github.com/DenisCarriere/geojson-helpers
- Homepage: https://github.com/DenisCarriere/geojson-helpers#readme
- Issues: https://github.com/DenisCarriere/geojson-helpers/issues
- npm.io page: https://npm.io/package/geojson-helpers

## Dependencies (2)

- [@types/node](https://npm.io/package/@types/node.md) ^6.0.45
- [@types/geojson](https://npm.io/package/@types/geojson.md) 0.0.31

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.2.1 (latest) — 2016-11-25
- 0.2.0 — 2016-11-25
- 0.1.7 — 2016-11-24
- 0.1.6 — 2016-11-24
- 0.1.5 — 2016-11-09
- 0.1.4 — 2016-11-09
- 0.1.3 — 2016-11-09
- 0.1.1 — 2016-11-09
- 0.1.0 — 2016-11-09

## README

[![Build Status](https://travis-ci.org/DenisCarriere/geojson-helpers.svg?branch=master)](https://travis-ci.org/DenisCarriere/geojson-helpers)
[![Coverage Status](https://coveralls.io/repos/github/DenisCarriere/geojson-helpers/badge.svg?branch=master)](https://coveralls.io/github/DenisCarriere/geojson-helpers?branch=master)
[![npm version](https://badge.fury.io/js/geojson-helpers.svg)](https://badge.fury.io/js/geojson-helpers)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/DenisCarriere/geojson-helpers/master/LICENSE)

# GeoJSON Helpers

Helps read & write GeoJSON files based on [RFC 7946 GeoJSON](http://www.macwright.org/2016/11/07/the-geojson-ietf-standard.html).

## Install

```bash
$ npm install --save geojson-helpers
```

## Quickstart

```javascript
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](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** 
-   `geojson` **FeatureCollection** GeoJSON FeatureCollection
-   `properties` **\[[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number))>]** Only include the following properties

# readFileSync

Reads GeoJSON file

**Parameters**

-   `path` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** File must be a GeoJSON FeatureCollection

# Changelog

## 0.1.0 - 2016-11-09

Begining of project `geojson-helpers`.

- readFileSync
- writeFileSync

---
_Source: https://npm.io/package/geojson-helpers · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
