Standard Buffer Reader for (Geo|S2)JSON implements the FeatureIterator interface
import { BufferJSONReader } from 'gis-tools-ts';const reader = new BufferJSONReader(`{ type: 'FeatureCollection', features: [...] }`);// ORconst reader = new BufferJSONReader({ type: 'FeatureCollection', features: [...] });// ORconst reader = new BufferJSONReader( await fetch('example.com/data.json').then(async (res) => await res.text()));// read the featuresfor await (const feature of reader) { console.log(feature);} Copy
import { BufferJSONReader } from 'gis-tools-ts';const reader = new BufferJSONReader(`{ type: 'FeatureCollection', features: [...] }`);// ORconst reader = new BufferJSONReader({ type: 'FeatureCollection', features: [...] });// ORconst reader = new BufferJSONReader( await fetch('example.com/data.json').then(async (res) => await res.text()));// read the featuresfor await (const feature of reader) { console.log(feature);}
the JSON data to parase
Generator to iterate over each (Geo|S2)JSON object in the file
JSON Buffer Reader
Description
Standard Buffer Reader for (Geo|S2)JSON implements the FeatureIterator interface
Usage