# convert-geo

> convert multi-format to geojson.

Latest version **0.4.0** (published 2014-03-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install convert-geo
pnpm add convert-geo
yarn add convert-geo
bun add convert-geo
```

## Health

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

Positive: no vulnerabilities.

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

Negative: insecure dependencies; abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2014-03-14 |
| First published | 2014-02-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | chilijung |
| Maintainers | chilijung |
| Keywords | geojson |

## Links

- npm: https://www.npmjs.com/package/convert-geo
- Repository: https://github.com/DataGarage/convert-geo
- Issues: https://github.com/DataGarage/convert-geo/issues
- npm.io page: https://npm.io/package/convert-geo

## Dependencies (5)

- [jsdom](https://npm.io/package/jsdom.md) ~0.10.1
- [topojson](https://npm.io/package/topojson.md) ~1.4.6
- [togeojson](https://npm.io/package/togeojson.md) ~0.7.0
- [csv2geojson](https://npm.io/package/csv2geojson.md) ~3.7.0
- [osm2geojson](https://npm.io/package/osm2geojson.md) git://github.com/chilijung/osm2geojson.git

## 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.4.0 (latest) — 2014-03-14
- 0.3.3 — 2014-03-13
- 0.3.2 — 2014-03-13
- 0.2.2 — 2014-02-24
- 0.2.1 — 2014-02-24
- 0.2.0 — 2014-02-24
- 0.1.1 — 2014-02-22
- 0.1.0 — 2014-02-22

## README

# convert-geo

[![Build Status](https://travis-ci.org/DataGarage/convert-geo.png?branch=master)](https://travis-ci.org/DataGarage/convert-geo)

converting multi-format to geojson.

## Install

```
npm install convert-geo
```

## Support

- kml
- topojson
- gpx
- csv
- tsv
- osm xml

convert to geojson :).

## example

For converting kml, topojson, gpx, osm xml format is quite simple

```javascript
var cv_geojson = require('..');

cv_geojson({
    input: __dirname + '/test.kml' // input file
  }, function(err, result) {
    if(err) {
      console.error(err); // it should be null if it success.
    }else {
      console.log(result); // result will be the geojson
    }
  
  }
);
```

for csv, tsv you will need to pass an options in the object. For telling the converter, which field is latitude, which field is longitude

```javascript
var cv_geojson = require('..');

cv_geojson({
    input: __dirname + '/test.csv' // input file
    options: { 
        // latitude
        latfield: 'LATFIELDNAME',
        // longitude
        lonfield: 'LONFIELDNAME'
    }
  }, function(err, result) {
    if(err) {
      console.error(err); // it should be null if it success.
    }else {
      console.log(result); // result will be the geojson
    }
  
  }
);
```

## Reference:

- https://github.com/mapbox/togeojson
- https://github.com/mapbox/csv2geojson
- https://github.com/mbostock/topojson

## License

MIT [@chilijung](http://github.com/chilijung)

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