Using gulp to convert multi-geo file format to geojson.
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
sample
.gitignore
.travis.yml
README.md
gulpfile.js
index.js
package.json
test.js

README.md

gulp-geojson

Build Status

Converting multipule geo file format to geojson using gulp.

Install

npm install --save-dev gulp-geojson

Support

  • kml
  • csv
  • tsv
  • topojson
  • gpx

Example

var gulp = require('gulp');
var geojson = require('./');
var rename = require('gulp-rename');

// kml
gulp.task('kml', function () {
    gulp.src('sample/data/*.kml')
        .pipe(geojson())
        .pipe(rename({extname: '.geojson'}))
        .pipe(gulp.dest('./sample/dist'));
});

// csv
gulp.task('csv', function () {
    gulp.src('sample/data/*.csv')
        .pipe(geojson())
        .pipe(rename({extname: '.geojson'}))
        .pipe(gulp.dest('./sample/dist'));
});


// tsv
gulp.task('tsv', function () {
    gulp.src('sample/data/*.tsv')
        .pipe(geojson())
        .pipe(rename({extname: '.geojson'}))
        .pipe(gulp.dest('./sample/dist'));
});

// gpx
gulp.task('gpx', function () {
    gulp.src('sample/data/*.gpx')
        .pipe(geojson())
        .pipe(rename({extname: '.geojson'}))
        .pipe(gulp.dest('./sample/dist'));
});

// topojson
gulp.task('topojson', function () {
    gulp.src('sample/data/*.topojson')
        .pipe(geojson())
        .pipe(rename({extname: '.geojson'}))
        .pipe(gulp.dest('./sample/dist'));
});

gulp.task('default', ['kml','csv','tsv','gpx','topojson']);

API

geojson()

geojson()

License

MIT @chilijung