csv2geo
v1.0.41
Published
It enables you to convert files in CSV format into geographic datasets
Downloads
30
Readme
csv2geo
It enables you to convert files in CSV format into geographic datasets
npm install csv2geo
Example
const csv2geo = require('csv2geo')
csv2geo.geojson('./example.csv')
.then((res)=>{
let geojsonObject = res
let geojsonFeatures = res.features
})
.catch((err)=>{
console.log(err)
})
Example with Options
const csv2geo = require('csv2geo')
csv2geo.geojson('./example.csv',{
latitudeFieldName :"latFieldName", // Field Name of Latitude
longitudeFieldName :"lonFieldName", // Field Name of Longitude
delimeter :";", // Delimetery character
saveFilePath :"./example.geojson", // Save geojson as a file
})
.then((res)=>{
let geojsonObject = res
let geojsonFeatures = res.features
})
.catch((err)=>{
console.log(err)
})