UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 683 B
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{r as n}from"../../../../chunks/rbush.js";import{create as s}from"../../../../geometry/support/aaBoundingBox.js";class t{static fromReader(o){const e=[],r=o.copy(),a=s();for(;r.next();){r.getBounds(a)&&e.push(r.getIndex())}const i=n(9,(n=>(r.setIndex(n),{minX:r.getBoundsXMin(),minY:r.getBoundsYMin(),maxX:r.getBoundsXMax(),maxY:r.getBoundsYMax()})));return i.load(e),new t(i)}constructor(n){this._index=n}search(n){const s={minX:n[0],minY:n[1],maxX:n[2],maxY:n[3]};return this._index.search(s)}}export{t as FeatureSpatialIndex};