@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
3 lines (2 loc) • 736 B
JavaScript
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.19/LICENSE.txt */
import{estimateNumberMemory as s}from"../../../../core/memoryEstimations.js";import{r as t}from"../../../../chunks/rbush.js";import{create as e}from"../../../../geometry/support/aaBoundingBox.js";class n{static fromReader(s){const o=[],r=s.copy(),i=e();for(;r.next();){r.getBounds(i)&&o.push(r.getIndex())}const m=t(9,s=>(r.setIndex(s),{minX:r.getBoundsXMin(),minY:r.getBoundsYMin(),maxX:r.getBoundsXMax(),maxY:r.getBoundsYMax()}));return m.load(o),new n(m,o.length)}constructor(s,t){this._index=s,this._size=t}get usedMemory(){return this._size*s}search(s){const t={minX:s[0],minY:s[1],maxX:s[2],maxY:s[3]};return this._index.search(t)}}export{n as FeatureSpatialIndex};