Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/node-geojson/geojson2dsv

shuttle GeoJSON points into DSV encoding.
https://github.com/node-geojson/geojson2dsv

Last synced: about 1 month ago
JSON representation

shuttle GeoJSON points into DSV encoding.

Awesome Lists containing this project

README

        

[![Build Status](https://travis-ci.org/tmcw/geojson2dsv.svg)](https://travis-ci.org/tmcw/geojson2dsv)
[![Coverage Status](https://coveralls.io/repos/tmcw/geojson2dsv/badge.svg)](https://coveralls.io/r/tmcw/geojson2dsv)
[![Greenkeeper badge](https://badges.greenkeeper.io/tmcw/geojson2dsv.svg)](https://greenkeeper.io/)

# geojson2dsv

The reverse of [csv2geojson](https://github.com/mapbox/csv2geojson): shuttle [GeoJSON](http://geojson.org/) points into
CSV encoding.

## API

### geojson2dsv

Given a valid GeoJSON object, return a CSV composed of all decodable points.

**Parameters**

- `geojson` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** any GeoJSON object
- `delim` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** CSV or DSV delimiter: by default, ","
- `mixedGeometry` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** serialize just the properties
of non-Point features. (optional, default `false`)

**Examples**

```javascript
var csvString = geojson2dsv(geojsonObject)
```

## see also

- [geojson2csv](https://github.com/morganherlocker/geojson2csv) also does this, but has file-assumptions and does dsv encoding in-house instead of farming it out to mbostock/dsv