cleangeojson2mongo
v1.1.0
Published
Clean GeoJson to import into MongoDB
Downloads
20
Readme
Import document in GeoJSON format to MongoDB .
This converts KML & GPX to GeoJSON, in a browser or with Node.js. Then this convert document is imported into MongoDB mongoimport
- [x] Dependency-free
- [x] Tiny
- [x] Tested
- [x] Node.js
Want to use this with Leaflet? Try leaflet-omnivore!
API
cleanGeoJson2Mongo.parse2savemongo(path, collection, host, port, db, user, pass, authdb)
Convert a KML or GPX 'file | path' to GeoJSON and insert into MongoDB. DB parameters is necessary include them.
The output is a log with operations and MongoDB results.
CLI
Install it into your path with npm install -i cleangeojson2mongo
.
~> node test/test.js PATH COLLECTION [database info - host port db user pass authDB]
Node.js
Install it into your project with npm install --save cleangeojson2mongo
.
// using cleangeojson2mongo in nodejs
var cj2m = require('cleangeojson2mongo');
console.log('Resultado:: ' + cj2m.parse2savemongo(path, collection, host, port, db, user, pass, authdb));
KML Feature Support
- [x] Point
- [x] Polygon
- [x] LineString
- [x] name & description
- [x] ExtendedData
- [x] SimpleData
- [x] MultiGeometry -> GeometryCollection
- [x] Styles with hashing
- [x] Tracks & MultiTracks with
gx:coords
, including altitude - [x] TimeSpan
- [x] TimeStamp
- [ ] NetworkLinks
- [ ] GroundOverlays
GPX Feature Support
- [x] Line Paths
- [x] Line styles
- [ ] Properties
- [x] 'name', 'cmt', 'desc', 'link', 'time', 'keywords', 'sym', 'type' tags
- [ ] 'author', 'copyright' tags