csv2geo

1.0.41 • Public • Published

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)
})

Readme

Keywords

Package Sidebar

Install

npm i csv2geo

Weekly Downloads

7

Version

1.0.41

License

MIT

Unpacked Size

7.32 kB

Total Files

6

Last publish

Collaborators

  • seremetonurhan