gtran-csv
convert geojson to csv file and backwards
This is a sub-project of gtran.
Installation
npm install gtran-csv
Functions
-
setPromiseLib(object)
Specify the promise library. If not, the library will use the native Promise.
-
fromGeoJson(geojson, fileName)
Save the geojson into the given file name.
-
toGeoJson(fileName, options)
Read the given file into geojson.
options:
- mapping - Map csv columns to geojson attributes. Specifically, geographic coordinates are required:
x: 'x_column_name'y: 'y_column_name'
Use Example
var csv = ; // if specific promise library is neededcsv; // Read CSV filecsv; // Save geojson into CSV filecsv;