Skip to content

deyihu/geojson-read-stream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

geojson-read-stream

read big geojson file by stream

Install

npm i geojson-read-stream
#or
yarn add geojson-read-stream

API

readGeoJSON(filepath, callback)

const path = require('path');
const {
    readGeoJSON
} = require('geojson-read-stream');

const p = path.join(__dirname, './test/test.geojson');

const time = 'time';
console.time(time);
readGeoJSON(p, (err, geojson) => {
    if (err) {
        console.error(err);
        return;
    }
    console.timeEnd(time);
    console.log(geojson.features.length);
})