Custom Gis Application with Arcgis Javascript API with modern layouting
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

6 lines
1.6 KiB

// All material copyright Esri, All Rights Reserved, unless otherwise specified.
// See https://js.arcgis.com/4.30/esri/copyright.txt for details.
//>>built
define(["exports","./GeohashCell"],function(t,u){class v{constructor(a){this._fields=a;this._depth=this._size=0;this._root=u.GeohashCell.create(this._fields,0,0,0)}destroy(){}get size(){return this._size}get depth(){return this._depth}find(a,k,g){return this._root.find(a,k,g,0,0,0)}insert(a,k,g,r,b,p,q){let h=this._root,e=0,l=0,m=0;for(;null!==h;){h.insert(a,k,g,r,b,q);if(e>=p)break;var d=Math.ceil((e+1)/2),f=Math.floor((e+1)/2);const c=1-e%2;var n=30-(3*d+2*f);d=30-(2*d+3*f);n=(r&7*c+3*(1-c)<<n)>>
n;d=(b&3*c+7*(1-c)<<d)>>d;f=n+d*(8*c+4*(1-c));const w=2*c+3*(1-c);l=l<<3*c+2*(1-c)|n;m=m<<w|d;null==h.children[f]&&(h.children[f]=u.GeohashCell.create(this._fields,l,m,e+1),this._depth=Math.max(this._depth,e+1),this._size+=1);e+=1;h=h.children[f]}}putBins(a,k){for(const g of this.getNodes(k))(k=a.get(g.id))?k.merge(g):a.set(g.id,g.clone())}getNodes(a){const k=[],{geohashBounds:g,level:r}=a;for(a=this._root;null!==a;){var b=a.depth,p=a.xNode,q=a.yNode;if(b>=r)k.push(a),a=a.next;else{var h=Math.ceil((b+
1)/2),e=Math.floor((b+1)/2);b=1-b%2;var l=30-(3*h+2*e),m=30-(2*h+3*e),d=~((1<<l)-1),f=~((1<<m)-1);p<<=3*b+2*(1-b);q<<=2*b+3*(1-b);h=Math.max(p,(g.xLL&d)>>l);e=Math.max(q,(g.yLL&f)>>m);l=Math.min(p+8*b+4*(1-b),(g.xTR&d)>>l);m=Math.min(q+4*b+8*(1-b),(g.yTR&f)>>m);for(d=f=null;e<=m;e++)for(let n=h;n<=l;n++){const c=a.children[n-p+(e-q)*(8*b+4*(1-b))];c&&(f||(f=c,f.next=a.next),d&&(d.next=c),d=c,c.next=a.next)}a=f||a.next}}return k}}t.GeohashTree=v;Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});