flatgeobuf
Version:
A performant binary encoding for geographic data
2 lines • 709 B
JavaScript
import{readFileSync as e}from"node:fs";import r from"node:path";import{describe as o,expect as a,it as t}from"vitest";import{ArrayReader as i}from"./array-reader.js";import{fromFeature as m}from"./geojson/feature.js";o("ArrayReader",()=>{t("Should filter features using ArrayReader",async()=>{let o=new Uint8Array(e(r.join(__dirname,"../../test/data/UScounties.fgb"))),t=i.open(o),s=[];for await(let e of t.selectBbox({minX:-106.88,minY:36.75,maxX:-101.11,maxY:41.24}))s.push(m(e.id,e.feature,t.header));a(s.length).toBe(86),a(s.slice(0,4).map(e=>`${e.properties?.NAME}, ${e.properties?.STATE}`)).toEqual(["Texas, OK","Cimarron, OK","Taos, NM","Colfax, NM"])})});
//# sourceMappingURL=array-reader.spec.js.map