UNPKG

geotiff-tile-web-worker

Version:
1 lines 677 kB
module.exports = { workerString: "!function(A,t){if(\"object\"==typeof exports&&\"object\"==typeof module)module.exports=t();else if(\"function\"==typeof define&&define.amd)define([],t);else{var e=t();for(var i in e)(\"object\"==typeof exports?exports:A)[i]=e[i]}}(self,(()=>(()=>{var A={9357:A=>{\"use strict\";function t([A,t,e,i]){return(e-A)*(i-t)}A.exports=t,A.exports.default=t},139:A=>{\"use strict\";function t(A,{nan_strategy:t=\"throw\"}={nan_strategy:\"throw\"}){const e=A.length;let i=null,s=null,a=null,n=null;for(let o=0;o<e;o++){const[e,r]=A[o];if(isNaN(e)){if(\"throw\"===t)throw new Error(\"[bbox-fns/bbox-array] encountered point with a NaN value: [\"+e+\", \"+r+\"]\")}else null===i?(i=e,s=e):e<i?i=e:e>s&&(s=e);if(isNaN(r)){if(\"throw\"===t)throw new Error(\"[bbox-fns/bbox-array] encountered point with a NaN value: [\"+e+\", \"+r+\"]\")}else null===a?(a=r,n=r):r<a?a=r:r>n&&(n=r)}return[i,a,s,n]}A.exports=t,A.exports.default=t},2452:A=>{\"use strict\";function t([A,t]){return[A,t,A,t]}A.exports=t,A.exports.default=t},3945:A=>{\"use strict\";function t([A,t,e,i]){return[e-A,i-t]}A.exports=t,A.exports.default=t},6493:A=>{function t([A,t,e,i],[s,a],{exclusive:n=!1}={exclusive:!1}){return n?a<i&&a>t&&s<e&&s>A:a>=t&&a<=i&&s>=A&&s<=e}A.exports=t,A.exports.default=t},762:A=>{function t([A,t,e,i],[s,a,n,o],{exclusive:r=!1}={exclusive:!1}){if(r){return s>A&&n<e&&(a>t&&o<i)}return s>=A&&n<=e&&(a>=t&&o<=i)}A.exports=t,A.exports.default=t},605:A=>{function t([A,t,e,i],[s,a,n,o]){return s<=e&&n>=A&&(a<=i&&o>=t)}A.exports=t,A.exports.default=t},8566:A=>{const t=[\"right -> down -> left -> up\",\"down -> left -> up -> right\",\"left -> up -> right -> down\",\"up -> right -> down -> left\",\"down -> right -> up -> left\",\"right -> up -> left -> down\",\"up -> left -> down -> right\",\"left -> down -> right -> up\"];function e(A,{debug:e=0}={debug:0}){if(!Array.isArray(A))return e&&console.log(\"[bbox-fns/booleanRectangle] coords is not an array\"),!1;if(1===A.length&&(A=A[0]),1===A.length&&(A=A[0]),!A.every((A=>Array.isArray(A)&&A.every((A=>\"number\"==typeof A)))))return e&&console.log(\"[bbox-fns/booleanRectangle] invalid points\"),!1;if(JSON.stringify(A[0])!==JSON.stringify(A[A.length-1]))return e&&console.log(\"[bbox-fns/booleanRectangle] first and last coordinates not equal\"),!1;let i=[];for(let t=1;t<A.length;t++){const[s,a]=A[t-1],[n,o]=A[t],r=s===n,l=a===o;if(r===l)return e&&console.log(\"[bbox-fns/booleanRectangle] invalid angle\"),!1;let h;if(r?h=o>a?\"up\":\"down\":l&&(h=n>s?\"right\":\"left\"),h!==i[i.length-1]){if(4===i.length)return e&&console.log(\"[bbox-fns/booleanRectangle] more than 4 turns\"),!1;i.push(h)}}return i=i.join(\" -> \"),e&&console.log(\"[bbox-fns/booleanRectangle] order: \"+i),-1!==t.indexOf(i)||(e&&console.log(\"[bbox-fns/booleanRectangle] invalid order\"),!1)}A.exports=e,A.exports.default=e},5751:(A,t,e)=>{const i=e(3983);function s(A){const t=[];for(let e=0;e<A.length;e++){const i=A[e];for(let A=0;A<i.length;A++)t.push(i[A])}return t}function a(A){if(A.geometry&&(A=A.geometry),A.coordinates&&(A=A.coordinates),A.paths&&(A=A.paths),A.points&&(A=A.points),A.rings&&(A=A.rings),Array.isArray(A.features))return i(s(A.features.map(a)));if(Array.isArray(A.geometries))return i(s(A.geometries.map(a)));if(Array.isArray(A)&&Array.isArray(A[0])&&Array.isArray(A[0][0]))return i(s(A.map(a)));if(Array.isArray(A)&&Array.isArray(A[0])&&\"number\"==typeof A[0][0]){const[t,e]=A[0];let i=t,s=e,a=t,n=e;return A.forEach((([A,t])=>{A<i&&(i=A),A>a&&(a=A),t<s&&(s=t),t>n&&(n=t)})),[[i,s,a,n]]}if(Array.isArray(A)&&(2===A.length||3===A.length)&&\"number\"==typeof A[0]){const[t,e]=A;return[[t,e,t,e]]}if(\"number\"==typeof A.x&&\"number\"==typeof A.y){const{x:t,y:e}=A;return[[t,e,t,e]]}return[\"xmin\",\"xmax\",\"ymin\",\"ymax\"].every((t=>\"number\"==typeof A[t]))?[[A.xmin,A.ymin,A.xmax,A.ymax]]:void 0}A.exports=a,A.exports.default=a},3177:(A,t,e)=>{const i=e(6518);function s(A){if(A.geometry&&(A=A.geometry),A.coordinates&&(A=A.coordinates),A.paths&&(A=A.paths),A.points&&(A=A.points),A.rings&&(A=A.rings),Array.isArray(A.features))return i(A.features.map(s));if(Array.isArray(A.geometries))return i(A.geometries.map(s));if(Array.isArray(A)&&Array.isArray(A[0])&&Array.isArray(A[0][0]))return i(A.map(s));if(Array.isArray(A)&&Array.isArray(A[0])&&\"number\"==typeof A[0][0]){const[t,e]=A[0];let i=t,s=e,a=t,n=e;return A.forEach((([A,t])=>{A<i&&(i=A),A>a&&(a=A),t<s&&(s=t),t>n&&(n=t)})),[i,s,a,n]}if(Array.isArray(A)&&(2===A.length||3===A.length)&&\"number\"==typeof A[0]){const[t,e]=A;return[t,e,t,e]}if(\"number\"==typeof A.x&&\"number\"==typeof A.y){const{x:t,y:e}=A;return[t,e,t,e]}return[\"xmin\",\"xmax\",\"ymin\",\"ymax\"].every((t=>\"number\"==typeof A[t]))?[A.xmin,A.ymin,A.xmax,A.ymax]:void 0}A.exports=s,A.exports.default=s},3983:A=>{function t(A){const t=[];for(let e=0;e<A.length;e++){const i=A[e],s=JSON.stringify(i);-1===t.indexOf(s)&&t.push(s)}return t.map((A=>JSON.parse(A)))}A.exports=t,A.exports.default=t},3966:A=>{function t([A,t,e,i],{density:s=0}={density:0}){\"number\"==typeof s&&(s=[s,s]);const[a,n]=s,o=[],r=(e-A)/(a+1),l=(i-t)/(n+1);o.push([A,i]);for(let t=1;t<=n;t++)o.push([A,i-t*l]);o.push([A,t]);for(let e=1;e<=a;e++)o.push([A+e*r,t]);o.push([e,t]);for(let A=1;A<=n;A++)o.push([e,t+A*l]);o.push([e,i]);for(let A=1;A<=a;A++)o.push([e-A*r,i]);return o.push([A,i]),[o]}A.exports=t,A.exports.default=t},5088:A=>{\"use strict\";function t([A,t,e,i],s){\"number\"==typeof s?s=[s,s]:void 0===s&&(s=[2,2]);const[a,n]=s,o=[],r=(e-A)/a,l=(i-t)/n;for(let s=0;s<n;s++){const h=t+s*l,g=s===n.length-1?i:h+l;for(let t=0;t<a;t++){const i=A+t*r,s=t===a.length-1?e:i+r;o.push([i,h,s,g])}}return o}A.exports=t,A.exports.default=t},7278:(A,t,e)=>{var i;const s=e(9357),a=e(139),n=e(2452),o=e(3945),r=e(762),l=e(6493),h=e(605),g=e(8566),c=e(3177),f=e(5751),u=e(3966),d=e(5088),I=e(4019),_=e(6518),p=e(6052),C=e(6400),B=e(7803),w=e(5970),E=e(1748),y=e(508),Q=e(726),m=e(5260),k={bboxArea:s,bboxArray:a,bboxPoint:n,bboxSize:o,booleanContains:r,booleanContainsPoint:l,booleanIntersects:h,booleanRectangle:g,calc:c,calcAll:f,densePolygon:u,grid:d,intersect:I,merge:_,polygon:p,preciseDensePolygon:C,preciseDivide:B,preciseReproject:w,reproject:E,scale:y,shift:Q,split:e(9774),validate:e(4538),preciseValidate:e(6044),sort:m,union:e(7649),unwrap:e(2363)};void 0===(i=function(){return k}.call(t,e,t,A))||(A.exports=i),A.exports=k,\"object\"==typeof window&&(window.bboxfns=k),\"object\"==typeof self&&(self.bboxfns=k)},4019:(A,t,e)=>{const i=e(605);function s(A,t){const[e,s,a,n]=A,[o,r,l,h]=t;return i(A,t)?[Math.max(e,o),Math.max(s,r),Math.min(a,l),Math.min(n,h)]:null}A.exports=s,A.exports.default=s},6518:A=>{\"use strict\";function t(A){if(0===A.length)return;if(1===A.length)return A[0];let[t,e,i,s]=A[0];for(let a=1;a<A.length;a++){const n=A[a];n[0]<t&&(t=n[0]),n[1]<e&&(e=n[1]),n[2]>i&&(i=n[2]),n[3]>s&&(s=n[3])}return[t,e,i,s]}A.exports=t,A.exports.default=t},6052:A=>{function t([A,t,e,i]){return[[[A,i],[A,t],[e,t],[e,i],[A,i]]]}A.exports=t,A.exports.default=t},9013:(A,t,e)=>{\"use strict\";const i=e(5007);function s(A){const t=A.length,[e,s]=A[0];let a=e,n=e,o=s,r=s;for(let e=1;e<t;e++){const[t,s]=A[e];\"<\"===i(t,a)?a=t:\">\"===i(t,n)&&(n=t),\"<\"===i(s,o)?o=s:\">\"===i(s,r)&&(r=s)}return[a,o,n,r]}A.exports=s,A.exports.default=s},6400:(A,t,e)=>{const i=e(3535),s=e(3091),a=e(5194),n=e(1614);function o(A,{density:t=0}={density:0}){A=A.map((A=>A.toString()));let[e,o,r,l]=A;\"number\"!=typeof t&&\"string\"!=typeof t||(t=[t,t]),t=t.map((A=>A.toString()));const[h,g]=t,c=n(l,o),f=n(r,e),u=[],d=s(f,i(h,\"1\")),I=s(c,i(g,\"1\"));u.push([e,l]);for(let A=1;A<=g;A++)u.push([e,n(l,a(A.toString(),I))]);u.push([e,o]);for(let A=1;A<=h;A++)u.push([i(e,a(A.toString(),d)),o]);u.push([r,o]);for(let A=1;A<=g;A++)u.push([r,i(o,a(A.toString(),I))]);u.push([r,l]);for(let A=1;A<=h;A++)u.push([n(r,a(A.toString(),d)),l]);return u.push([e,l]),[u]}A.exports=o,A.exports.default=o},7803:(A,t,e)=>{\"use strict\";const i=e(3091);function s([A,t,e,s],a,{ellipsis:n=!1,max_decimal_digits:o=100}={}){const[r,l]=\"string\"==typeof a||\"number\"==typeof a?[a,a]:1===a.length?[a[0].toString(),a[0].toString()]:a,h={ellipsis:n,max_decimal_digits:o},g=r.toString(),c=l.toString();return[i(A.toString(),g,h),i(t.toString(),c,h),i(e.toString(),g,h),i(s.toString(),c,h)]}A.exports=s,A.exports.default=s},5970:(A,t,e)=>{const i=e(9013),s=e(6400);function a(A,t,{async:e=!1,density:a}={}){const n=s(A,{density:a})[0].map((A=>t(A)));return e?Promise.all(n).then((A=>i(A))):i(n)}A.exports=a,A.exports.default=a},6044:(A,t,e)=>{const i=e(5007);function s(A){if(!Array.isArray(A))return!1;if(4!==A.length)return!1;if(A.some((A=>\"string\"!=typeof A)))return!1;const[t,e,s,a]=A;return\">\"!==i(t,s)&&\">\"!==i(e,a)}A.exports=s,A.exports.default=s},1748:(A,t,e)=>{const i=e(139),s=e(3966);function a(A,t,{async:e=!1,density:a,nan_strategy:n=\"throw\"}={}){const o=s(A,{density:a})[0].map((A=>t(A)));return e?Promise.all(o).then((A=>i(A,{nan_strategy:n}))):i(o,{nan_strategy:n})}A.exports=a,A.exports.default=a},508:A=>{\"use strict\";function t([A,t,e,i],s){const[a,n]=\"number\"==typeof s?[s,s]:1===s.length?[s[0],s[0]]:s;return[A*a,t*n,e*a,i*n]}A.exports=t,A.exports.default=t},726:A=>{function t([A,t,e,i],s){const a=Array.isArray(s)&&s.length>=1?s[0]:\"number\"==typeof s.x?s.x:0,n=Array.isArray(s)&&s.length>=2?s[1]:\"number\"==typeof s.y?s.y:0;return[A+a,t+n,e+a,i+n]}A.exports=t,A.exports.default=t},5260:A=>{function t(A){return A.sort(((A,t)=>{const[e,i,s,a]=A,[n,o,r,l]=t;return e<n?-1:e>n||i<o?1:i>o?-1:0}))}A.exports=t,A.exports.default=t},9774:A=>{\"use strict\";function t(A,t){const[e,i,s,a]=A;if(!t)throw new Error(\"[bbox-fns/split.js] missing breakpoints\");const n=t.x||[],o=t.y||[],r=[e].concat(n.filter((A=>A>e&&A<s))).concat([s]),l=[i].concat(o.filter((A=>A>i&&A<a))).concat([a]),h=[];for(let A=1;A<r.length;A++){const t=r[A-1],e=r[A];for(let A=1;A<l.length;A++){const i=l[A-1],s=l[A];h.push([t,i,e,s])}}return h}A.exports=t,A.exports.default=t},7649:(A,t,e)=>{\"use strict\";const i=e(605),s=e(6518);function a(A){if(0===A.length)return[];if(1===A.length)return[A[0]];let t=[A[0]];for(let e=1;e<A.length;e++){const a=A[e],n=t.filter((A=>i(a,A))),o=s(n.concat([a])),r=t.filter((A=>!n.includes(A)));t=[o].concat(r)}return t}A.exports=a,A.exports.default=a},2363:(A,t,e)=>{const i=e(726),s=e(5260),a=e(9774),n=e(7649);function o(A,t){const[e,o,r,l]=t,h=r-e,g=l-o;let c=a(A,{x:[e-h,e,r,r+h],y:[o-g,o,l,l+g]});return c=c.map((A=>{const[t,s,a,n]=A;return i(A,{x:Math.ceil((e-t)/h)*h,y:Math.ceil((o-s)/g)*g})})),c=n(c),c=s(c),c}A.exports=o,A.exports.default=o},4538:A=>{\"use strict\";function t(A){if(!Array.isArray(A))return!1;if(4!==A.length)return!1;if(A.some((A=>\"number\"!=typeof A)))return!1;const[t,e,i,s]=A;return!(t>i)&&!(e>s)}A.exports=t,A.exports.default=t},4109:(A,t,e)=>{\"use strict\";const i=e(4484),s=e(5950),a=e(8365),n=e(6001),o=e(4181),r=e(1655),l=e(8371),h=e(3771);A.exports=function({debug_level:A=0,raster_bbox:t,raster_height:e,raster_width:g,pixel_height:c,pixel_width:f,ring:u,per_pixel:d,per_row_segment:I}){const[_,p,C,B]=t,w=[];for(let A=0;A<e;A++)w.push([]);o(u,((A,i)=>{const[a,n]=A,[o,r]=a,[l,h]=n,g=Math.sign(h-r),f=r===h,d=o===l,I=(h-r)/(l-o),_=r,p=Math.min(r,h),C=Math.max(r,h);let E,y,Q,m;if(o<l?([E,y]=a,[m,Q]=n):([E,y]=n,[m,Q]=a),void 0===E)throw Error(\"startLng is \"+E);const k=Math.round((t[3]-.5*c-y)/c),x=Math.round((t[3]-.5*c-Q)/c);let M,b;k<x?(M=k,b=x):(M=x,b=k),M=s(M,0,e-1),b=s(b,0,e-1);for(let t=M;t<b+1;t++){const e=B-c*t-c/2,s=r===e,a=h===e,n=!a;let y,Q;if(f){if(_!==e)continue;y=E,Q=m}else if(d)e>=p&&e<=C&&(y=E,Q=m);else if(s)y=Q=o;else if(a)y=Q=l;else try{y=Q=o+(e-r)/I}catch(A){throw A}void 0!==y&&void 0!==Q&&(f||y>=E&&Q<=m&&e<=C&&e>=p)&&w[t].push({direction:g,index:i,edge:A,last_edge_in_ring:i===u.length-2,endsOnLine:a,endsOffLine:n,horizontal:f,startsOnLine:s,vertical:d,xmin:y,xmax:Q,imageLineY:e})}}));const E=f/2,y=h(_,f);A>=1&&console.log(\"[dufour-peyton-intersection] intersectionsByRow:\",w),w.forEach(((t,e)=>{if(t.length>0){const s=n(t).map(i),[o,h]=l(s,(A=>A.through));if(o.length%2==1)throw A>=1&&console.error(\"[dufour-peyton-intersection] throughs:\",JSON.stringify(o)),Error(\"throughs.length for \"+e+\" is odd with \"+o.length);let c=h.map((A=>[A.xmin,A.xmax]));o.sort(((A,t)=>A.xmin-t.xmin));const f=a(o).map((A=>{const[t,e]=A;return[t.xmin,e.xmax]}));c=c.concat(f),c=r(c),c.forEach((A=>{const[t,i]=A;if(i-t<E)return;const[s,a]=y(A);if(s===a)return;if(s>g)return;if(a<=0)return;const n=Math.max(s,0),o=Math.min(a-1,g-1);if(I&&I({row:e,columns:[n,o]}),d)for(let A=n;A<=o;A++)d({row:e,column:A})}))}}))}},2358:(A,t,e)=>{\"use strict\";const i=e(700),s=e(8068);A.exports=function({polygon:A,...t}){const{debug_level:e=0}=t,[a,...n]=A.map((A=>s({ring:A,...t})));e>=2&&console.log(\"[dufour-peyton-intersection] exterior:\",a);return a.map(((A,t)=>{const e=n.map((A=>A[t])).flat();return i(A,e)}))}},8068:(A,t,e)=>{\"use strict\";const i=e(4109),s=e(7699),a=e(2412),n=e(6007);A.exports=function({debug_level:A=0,raster_bbox:t,raster_height:e,raster_width:o,pixel_height:r,pixel_width:l,ring:h}){const[g,c,f,u]=t;if(t.every((A=>\"string\"==typeof A)))throw new Error(\"[dufour-peyton-intersection] raster_bbox should be all numbers, not strings\");null==r&&(r=(u-c)/e),null==l&&(l=(f-g)/o);const d=[];for(let A=0;A<e;A++)d.push([]);i({debug_level:A,raster_bbox:t,raster_height:e,raster_width:o,pixel_height:r,pixel_width:l,ring:h,per_row_segment:({row:A,columns:t})=>{d[A].push(t)}});for(let A=0;A<d.length;A++){const t=d[A];t&&(n(t),d[A]=a(t))}return A>=2&&s(d),d}},2353:(A,t,e)=>{\"use strict\";const i=e(9841),s=e(2412),a=e(6007),n=e(2358);A.exports=function({geometry:A,raster_height:t,per_pixel:e,per_row_segment:o,debug_level:r=0,...l}){const h=i(A).map((A=>n({polygon:A,raster_height:t,debug_level:r,...l})));r>=1&&console.log(\"[dufour-peyton-intersection] inside_rows_by_polygon:\",h);const g=new Array(t);for(let A=0;A<t;A++){const t=h.map((t=>t[A])).filter((A=>void 0!==A&&A.length>0)).flat();if(t.length>0){const e=a(t),i=s(e);g[A]=i}}return(o||e)&&g.forEach(((A,t)=>{A&&A.forEach(((A,i)=>{if(o&&o({row:t,columns:A}),e){const[i,s]=A;for(let A=i;A<=s;A++)e({row:t,column:A})}}))})),{rows:g}}},4484:A=>{\"use strict\";A.exports=function(A){try{let t,e,i;const s=A.length,a=A[0];if(1===s)t=!0,e=a.xmin,i=a.xmax;else{const n=A[s-1];t=a.direction===n.direction,e=Math.min(a.xmin,n.xmin),i=Math.max(a.xmax,n.xmax)}if(void 0===e||void 0===i||void 0===t||isNaN(e)||isNaN(i))throw Error(\"categorizeIntersection failed with xmin\",e,\"and xmax\",i);return{xmin:e,xmax:i,through:t}}catch(t){throw console.error(\"[categorizeIntersection] segments:\",A),console.error(\"[categorizeIntersection]\",t),t}}},7699:A=>{\"use strict\";A.exports=function(A){A.forEach(((A,t)=>{for(let e=0;e<A.length;e++){const i=A[e],[s,a]=i;s>a&&console.warn(\"[dufour-peyton-intersection] uh oh, encountered invalid range\",i,\"at row index\",t,\"with ranges\",A);for(let i=e+1;i<A.length;i++)i[0]<=a&&console.warn(\"[dufour-peyton-intersection] encountered range problem on row index\",t,\":\",A)}}))}},5950:A=>{\"use strict\";A.exports=function(A,t,e){return A<t?t:A>e?e:A}},6001:(A,t,e)=>{\"use strict\";const i=e(9039);A.exports=function(A,t,e=!1){try{const t=i(A,(A=>A.endsOffLine));if(t.length>=2){const A=t[0],e=A[0],i=t[t.length-1],s=i[i.length-1];s.last_edge_in_ring&&0===e.index&&s.endsOnLine&&(t[0]=t.pop().concat(A))}return t}catch(A){console.error(\"[clusterLineSegments]\",A)}}},9039:A=>{\"use strict\";A.exports=function(A,t){try{const e=A.length,i=[];let s=[];for(let a=0;a<e;a++){const e=A[a];s.push(e),t(e)&&(i.push(s),s=[])}return s.length>0&&i.push(s),i}catch(A){console.error(\"[cluster]:\",A)}}},8365:A=>{\"use strict\";A.exports=function(A){const t=[],e=A.length;for(let i=0;i<e;i+=2)t.push([A[i],A[i+1]]);return t}},4181:A=>{\"use strict\";A.exports=function(A,t){for(let e=1;e<A.length;e++){t([A[e-1],A[e]],e-1)}}},1755:(A,t,e)=>{\"use strict\";const i=e(9123);A.exports=function A(t,e){if(\"FeatureCollection\"===t.type)t.features.forEach((t=>A(t,e)));else if(\"GeometryCollection\"===t.type)t.geometries.forEach((t=>A(t,e)));else if(\"Feature\"===t.type)A(t.geometry,e);else if(\"Polygon\"===t.type)A(t.coordinates,e);else if(\"MultiPolygon\"===t.type)t.coordinates.forEach((A=>{e(A)}));else if(Array.isArray(t)){const A=i(t);4===A?t.forEach((A=>{e(A)})):3===A?e(t):2===A&&e([t])}}},9841:(A,t,e)=>{\"use strict\";const i=e(1755);A.exports=function(A){const t=[];return i(A,(A=>t.push(A))),t}},8581:(A,t,e)=>{\"use strict\";var i;const s=e(4484),a=e(5950),n=e(9039),o=e(6001),r=e(2353),l=e(4109),h=e(8365),g=e(4181),c=e(1755),f=e(1655),u=e(2412),d=e(8371),I=e(3771),_=e(8214),p=e(2723),C=e(700),B=e(4459),w=e(6130),E={calculate:r,calculateCore:l,carveHoles:C,categorizeIntersection:s,clamp:a,cluster:n,clusterLineSegments:o,couple:h,eachPair:g,eachPolygon:c,mergeRanges:f,mergeConsecutiveRanges:u,partition:d,prepareSnap:I,rangeContains:_,rangeCut:p,rangeOverlap:B,rangeSort:e(6007),roundDown:w};void 0===(i=(()=>E).call(t,e,t,A))||(A.exports=i),A.exports=E,\"object\"==typeof self&&(self.dufour_peyton_intersection=E),\"object\"==typeof window&&(window.dufour_peyton_intersection=E)},8371:A=>{\"use strict\";A.exports=function(A,t){const e=[],i=[],s=A.length;for(let a=0;a<s;a++){const s=A[a];t(s)?e.push(s):i.push(s)}return[e,i]}},3771:(A,t,e)=>{\"use strict\";const i=e(6130);A.exports=function(A,t){return([e,s])=>(-0===(e=i((e-A)/t))&&(e=0),-0===(s=Math.round((s-A)/t))&&(s=0),[e,s])}},4928:A=>{A.exports=function(A,t){return Math.sign(A[0]-t[0])||Math.sign(A[1]-t[1])}},8214:A=>{A.exports=function(A,t){return t[0]>=A[0]&&t[1]<=A[1]}},2723:(A,t,e)=>{const i=e(4459);A.exports=function(A,t){if(!Array.isArray(A))throw new Error(\"[cut] range is not an array: \"+JSON.stringify(A));if(void 0===t)return[A];if(!Array.isArray(t))throw new Error(\"[cut] hole is not an array:\"+JSON.stringify(t));if(!i(A,t))return[A];const e=[];return A[0]<t[0]&&e.push([A[0],t[0]-1]),A[1]>t[1]&&e.push([t[1]+1,A[1]]),e}},2412:A=>{A.exports=function(A){const t=A.length;if(0===t)return[];const e=A[0];let i=e[1];const s=[e];for(let e=1;e<t;e++){const t=A[e],[a,n]=t;a<=i+1?s[s.length-1][1]=Math.max(i,n):s.push(t),i=n}return s}},1655:A=>{A.exports=function(A){const t=A.length;if(t>0){const e=A[0];let i=e[1];const s=[e];for(let e=1;e<t;e++){const t=A[e],[a,n]=t;a<=i?s[s.length-1][1]=n:s.push(t),i=n}return s}}},700:(A,t,e)=>{const i=e(2723);A.exports=function(A,t){let e=A;return t.forEach((A=>{e=e.map((t=>i(t,A))).flat()})),e}},4459:A=>{A.exports=function(A,t){if(!Array.isArray(A))throw new Error(\"[overlaps] a is not an array\");if(!Array.isArray(t))throw new Error(\"[overlaps] b is not an array\");return A[0]<=t[1]&&t[0]<=A[1]}},6007:(A,t,e)=>{const i=e(4928);A.exports=function(A){return A.sort(i)}},6130:A=>{\"use strict\";A.exports=function(A){return-1*Math.round(-1*A)}},4968:(A,t,e)=>{const i=e(2227);function s(A,{debug:t=!1,no_data:e,theoretical_max:s}={debug:!1,no_data:void 0,theoretical_max:void 0}){if(t&&console.log(\"[fast-max] starting with numbers:\",A.slice(0,10)),!A.length)throw t&&console.error(\"[fast-max] Instead of an array of numbers, you passed in\",A),new Error(\"[fast-max] You didn't pass in an array of numbers\");if(0===A.length)throw new Error(\"[fast-max] You passed in an empty array\");let a;!1===Array.isArray(e)&&(e=\"number\"==typeof e?[e]:[]);const n=A.length;t&&console.log(\"[fast-max] constructor:\",A.constructor.name),null==s&&(s=i(A.constructor.name)),t&&console.log(\"[fast-max] theoretical maximunm is\",s);for(let i=0;i<n;i++){const o=A[i];if(\"number\"==typeof o&&o==o&&-1===e.indexOf(o)&&((void 0===a||o>a)&&(a=o),\"number\"==typeof s&&o>=s)){t&&console.log(\"[fast-max] found maximum value of \"+o+\" at index \"+i+\" of \"+n),a=o;break}}return t&&console.log(\"[fast-max] returning\",a),a}A.exports=s,A.exports.default=s,\"object\"==typeof self&&(self.fastMax=s),\"object\"==typeof window&&(window.fastMax=s)},2142:(A,t,e)=>{const i=e(6177);function s(A,{debug:t=!1,no_data:e,theoretical_min:s}={debug:!1,no_data:void 0,theoretical_min:void 0}){if(t&&console.log(\"[fast-min] starting with numbers:\",A.slice(0,10)),!A.length)throw t&&console.error(\"[fast-min] Instead of an array of numbers, you passed in\",A),new Error(\"[fast-min] You didn't pass in an array of numbers\");if(0===A.length)throw new Error(\"[fast-min] You passed in an empty array\");let a;!1===Array.isArray(e)&&(e=\"number\"==typeof e?[e]:[]);const n=A.length;t&&console.log(\"[fast-min] constructor:\",A.constructor.name),null==s&&(s=i(A.constructor.name)),t&&console.log(\"[fast-min] theoretical minimunm is\",s);for(let i=0;i<n;i++){const o=A[i];if(\"number\"==typeof o&&o==o&&-1===e.indexOf(o)&&((void 0===a||o<a)&&(a=o),\"number\"==typeof s&&o<=s)){t&&console.log(\"[fast-min] found minimum value of \"+o+\" at index \"+i+\" of \"+n),a=o;break}}return t&&console.log(\"[fast-min] returning\",a),a}A.exports=s,A.exports.default=s,\"object\"==typeof self&&(self.fastMin=s),\"object\"==typeof window&&(window.fastMin=s)},1410:(A,t,e)=>{var i;const s=e(4186),a=e(876);function n(A){const t=a(A);return{forward:function(t){return s(A,t)},inverse:function(A,{floor:e=!1,round:i=!1}={floor:!1,round:!1}){let a=s(t,A);return i&&(a=a.map((A=>Math.round(A)))),e&&(a=a.map((A=>Math.floor(A)))),a}}}void 0===(i=function(){return n}.call(t,e,t,A))||(A.exports=i),A.exports=n,A.exports.default=n},4186:(A,t,e)=>{var i;function s(A,t){const[e,i,s,a,n,o]=A,[r,l]=t;return[e+i*r+s*l,a+n*r+o*l]}void 0===(i=function(){return s}.call(t,e,t,A))||(A.exports=i),A.exports=s,A.exports.default=s},876:(A,t,e)=>{var i;function s(A){const[t,e,i,s,a,n]=A,o=e*n-i*a,r=-1*o;return[(i*s-t*n)/o,n/o,i/r,(e*s-t*a)/r,a/r,e/o]}void 0===(i=function(){return s}.call(t,e,t,A))||(A.exports=i),A.exports=s,A.exports.default=s},5363:(A,t,e)=>{var i;function s(A,{debug:t=!1}={debug:!1}){const e=A.fileDirectory;if(e.ModelTransformation){const[A,t,i,s,a,n,o,r,l,h,g,c,f,u,d,I]=e.ModelTransformation;return[s,A,t,r,a,n]}if(e.ModelTiepoint&&!e.ModelPixelScale)t&&console.log(\"[geotiff-geotransform] missing ModelPixelScaleTag\");else if(e.ModelPixelScale&&!e.ModelTiepoint)t&&console.log(\"[geotiff-geotransform] missing ModelTiepointTag\");else if(e.ModelTiepoint&&e.ModelPixelScale){const[A,i,s,a,n,o]=e.ModelTiepoint;t&&(0!==A&&console.log(\"[geotiff-geotransform] unexpected i value in ModelTiepoint: \"+A),0!==i&&console.log(\"[geotiff-geotransform] unexpected j value in ModelTiepoint: \"+i),0!==s&&console.log(\"[geotiff-geotransform] unexpected k value in ModelTiepoint: \"+s));const[r,l,h]=e.ModelPixelScale;return[a,r,0,n,0,-1*l]}}void 0===(i=function(){return s}.call(t,e,t,A))||(A.exports=i),A.exports=s,A.exports.default=s},5855:(A,t,e)=>{var i;const s=e(9987);function a(A){const t=s(A);if(void 0===typeof t)return;const e=Number(t);return isNaN(e)?void 0:e}void 0===(i=function(){return a}.call(t,e,t,A))||(A.exports=i),A.exports=a,A.exports.default=a,\"object\"==typeof window&&(window.getNoDataNumber=a),\"object\"==typeof self&&(self.getNoDataNumber=a)},9987:A=>{function t(A,t){if(A.fileDirectory&&(A=A.fileDirectory),A.GDAL_NODATA&&(A=A.GDAL_NODATA),\"string\"==typeof A)return t&&t.raw?A:(A=A.replace(\"\\0\",\"\").trim(),[\"-inf\",\"-infinity\"].includes(A)?\"-Infinity\":[\"+inf\",\"inf\",\"+infinity\",\"infinity\"].includes(A)?\"Infinity\":A=A.replace(/^\\+/,\"\"))}A.exports=t,A.exports.default=t,A.exports.getPreciseNoDataValue=t},3503:(A,t,e)=>{const{booleanIntersects:i,calc:s,intersect:a,polygon:n}=e(7278),o=e(8581),r=e(4968),l=e(2142),h=e(1410),g=e(9123),c=e(2227),f=e(6177),u=e(1215).calculate,d=e(1748),I=e(8006),{turbocharge:_}=e(6241),p=e(1327),C=e(5703),B=e(3486),w=(A,t,e)=>A<t?t:A>e?e:A,E=A=>null==A||A!=A,y=(A,t)=>{const e=Math.round(A*t);return[e,e/A,A/e]},Q=A=>new Array(A).fill(0).map(((A,t)=>t)),m=(A,t)=>{let e=0,i=0;return((A,t,e)=>{const i=A.length;if(t)for(let s=0;s<i;s++){const i=A[s];-1===t.indexOf(i)&&e(i)}else for(let t=0;t<i;t++)e(A[t])})(A,t,(A=>{i++,e+=A})),0===i?void 0:e/i},k=(A,t)=>{if(0===A.length)return;const e={};if(t)for(let i=0;i<A.length;i++){const s=A[i];\"number\"==typeof s&&s==s&&-1===t.indexOf(s)&&(s in e?e[s].count++:e[s]={n:s,count:1})}else for(let t=0;t<A.length;t++){const i=A[t];i in e?e[i].count++:e[i]={n:i,count:1}}const i=Object.values(e),s=i.sort(((A,t)=>Math.sign(t.count-A.count)))[0].count;return i.filter((A=>A.count===s)).map((A=>A.n))},x=function({debug_level:A=0,in_data:t,in_bbox:e,in_geotransform:x,in_layout:M=\"[band][row,column]\",in_srs:b,in_height:D,in_pixel_depth:v,in_pixel_height:S,in_pixel_width:G,in_width:N,in_no_data:R,out_array_types:F,out_bands:L,out_data:U,out_pixel_depth:O,out_pixel_height:P,out_pixel_width:T,out_bbox:H=null,out_bbox_in_srs:J,out_layout:q,out_resolution:z=[1,1],out_srs:j,out_width:K=256,out_height:Y=256,out_no_data:V=null,method:W=\"median\",read_bands:X,row_start:Z=0,row_end:$,expr:AA,round:tA=!1,theoretical_min:eA,theoretical_max:iA,inverse:sA,forward:aA,cutline:nA,cutline_bbox:oA,cutline_srs:rA,cutline_forward:lA,cutline_strategy:hA=\"outside\",turbo:gA=!1,insert_pixel:cA,insert_sample:fA,insert_null_strategy:uA=\"skip\",skip_no_data_strategy:dA,cache_process:IA=!1}){A>=1&&console.log(\"[geowarp] starting\");const _A=A>=1?performance.now():0;if(isNaN(Y))throw new Error(\"[geowarp] out_height is NaN\");if(isNaN(K))throw new Error(\"[geowarp] out_width is NaN\");let pA=0;const[CA,BA,wA]=y(Y,z[1]),[EA,yA,QA]=y(K,z[0]);A>=1&&console.log(\"[geowarp] scaled size:\",[EA,CA]),A>=1&&console.log(\"[geowarp] resolution:\",[yA,BA]),A>=1&&console.log(\"[geowarp] scale:\",[QA,wA]);const mA=b===j;let kA,xA,MA;if(A>=1&&console.log(\"[geowarp] input and output srs are the same:\",mA),A>=1&&console.log(\"[geowarp] skip_no_data_strategy:\",dA),sA??=arguments[0].reproject,cA??=arguments[0].insert,!mA){if(!e)throw new Error(\"[geowarp] can't reproject without in_bbox\");if(!H){if(!aA)throw new Error(\"[geowarp] must specify out_bbox or forward\");H=kA=MA=d(e,aA,{density:100})}}if(!mA&&\"function\"!=typeof sA)throw new Error(\"[geowarp] you must specify a reproject function\");if(!D)throw new Error(\"[geowarp] you must provide in_height\");if(!N)throw new Error(\"[geowarp] you must provide in_width\");if(q||(q=M),null==v)if(M.startsWith(\"[band]\"))v=t.length;else{const A=g(t);1===A?v=t.length/D/N:2===A?v=t[0].length:3===A&&(v=t[0][0].length)}var bA;A>=1&&console.log(\"[geowarp] number of bands in source data:\",v),X||(AA?X=Q(v):L?(bA=L,X=Array.from(new Set(bA)).sort(((A,t)=>t-A))):X=Q(v)),L??=X,tA&&\"number\"==typeof V&&(V=Math.round(V)),!1===Array.isArray(R)&&(R=\"in_no_data\"in arguments[0]?[R]:[]);const DA=R[0];let vA,SA;if(AA)vA=tA?({pixel:A})=>p(AA({pixel:A})).then((A=>A.map((A=>Math.round(A))))):AA;else{const A=L.map((A=>X.indexOf(A)));vA=tA?({pixel:t})=>A.map((A=>{const e=t[A];return E(e)||R.includes(e)?V:Math.round(e)})):({pixel:t})=>A.map((A=>{const e=t[A];return E(e)||R.includes(e)?V:e}))}IA&&([vA,SA]=((A,t=(A=>A.toString()))=>{let e={};return[i=>e[t(i)]??=A(i),()=>e={}]})(vA,(({pixel:A})=>A.toString()))),A>=1&&console.log(\"[geowarp] read_bands:\",X),A>=1&&console.log(\"[geowarp] out_height:\",Y),A>=1&&console.log(\"[geowarp] out_width:\",K),mA&&e&&!H&&(H=e);const[GA,NA,RA,FA]=e;S??=(FA-NA)/D,G??=(RA-GA)/N,A>=1&&console.log(\"[geowarp] pixel height of source data:\",S),A>=1&&console.log(\"[geowarp] pixel width of source data:\",G),x??=[GA,G,0,FA,0,-1*S];const{forward:LA,inverse:UA}=h(x),OA=mA?UA:A=>UA(lt(A)),[PA,TA,HA,JA]=H;A>=1&&console.log(\"[geowarp] out_xmin:\",PA),A>=1&&console.log(\"[geowarp] out_ymin:\",TA),A>=1&&console.log(\"[geowarp] out_xmax:\",HA),A>=1&&console.log(\"[geowarp] out_ymax:\",JA),P??=(JA-TA)/Y,T??=(HA-PA)/K,A>=1&&console.log(\"[geowarp] out_pixel_height:\",P),A>=1&&console.log(\"[geowarp] out_pixel_width:\",T);const qA=P*wA,zA=T*QA;A>=1&&console.log(\"[geowarp] out_sample_height:\",qA),A>=1&&console.log(\"[geowarp] out_sample_width:\",zA);const jA=qA/2,KA=zA/2,YA=mA?LA:A=>rt(LA(A));if(void 0===eA||void 0===iA)try{const e=t[0].constructor.name;A>=1&&console.log(\"[geowarp] data_constructor:\",e),eA??=f(e),iA??=c(e),A>=1&&console.log(\"[geowarp] theoretical_min:\",eA),A>=1&&console.log(\"[geowarp] theoretical_max:\",iA)}catch(A){console.error(A)}if(![void 0,null,\"\"].includes(lA)&&\"function\"!=typeof lA)throw new Error(\"[geowarp] cutline_forward must be of type function not \"+typeof nA);let VA=new Array(CA).fill(0).map((()=>[]));if(nA&&rA!==j){if(!lA)throw b===rA&&(lA=aA),new Error(\"[geowarp] must specify cutline_forward when cutline_srs and out_srs differ\");let t;lA&&oA&&(t=_({bbox:oA,debug_level:A,quiet:!0,reproject:lA,threshold:[KA,jA]})?.reproject),nA=I(nA,{reproject:t||lA})}const WA=EA-1,XA=[0,WA],ZA=[XA];if(nA){o.calculate({raster_bbox:H,raster_height:CA,raster_width:EA,geometry:nA}).rows.forEach(((A,t)=>{VA[t]=A})),\"inside\"===hA&&(VA=VA.map((A=>0===A.length?ZA:C({segments:A,min:0,max:WA,debug:!1}))))}else for(let A=0;A<CA;A++)VA[A].push(XA);const $A={band:v,row:D,column:N},At=B.prepareSelect({data:t,layout:M,sizes:$A}),tt=({row:A,column:t})=>X.map((e=>At({point:{band:e,row:A,column:t}}).value)),et=(({select:A,width:t,height:e},[i,s])=>{const a={},n=t/i,o=e/s,r=new Array(s).fill(null).map(((A,t)=>Math.floor(t*o))),l=new Array(i).fill(null).map(((A,t)=>Math.floor(t*n)));return r.forEach((t=>{l.forEach((e=>{const i=A({row:t,column:e});i in a?a[i]++:a[i]=1}))})),Object.entries(a).sort((([A,t],[e,i])=>Math.sign(i-t)))})({select:tt,width:N,height:D},[10,10]),{hits:it,total:st}=et.reduce(((A,[t,e])=>(A.total+=e,A.hits+=e-1,A)),{hits:0,total:0});if(null==IA&&(IA=it/st>=.85),\"function\"!=typeof cA){let t;const e=({row:A,column:e,pixel:i})=>{i.forEach(((i,s)=>{t({point:{band:s,row:A,column:e},value:i})}))};let i=({pixel:s,...a})=>{try{O??=s.length,A>=1&&console.log(\"[geowarp] out_pixel_depth:\",O);const n={band:O,row:Y,column:K};A>=1&&console.log(\"[geowarp] out_sizes:\",n),U??=B.prepareData({fill:V,layout:q,sizes:n,arrayTypes:F}).data,A>=1&&console.log(\"[geowarp] out_data:\",typeof U),t=B.prepareUpdate({data:U,layout:q,sizes:n}),A>=1&&console.log(\"[geowarp] prepared update function\"),i=e,e({pixel:s,...a})}catch(A){console.error(\"first call to insert_pixel_sync failed:\",A)}};cA=({pixel:A,...t})=>{pA++,p(A).then((A=>{i({pixel:A,...t}),pA--}))}}\"function\"!=typeof fA&&(fA=1===yA&&1===BA?A=>cA(A):({row:A,column:t,pixel:e,...i})=>{const[s,a,n,o]=(([A,t],[e,i])=>[Math.round(A*e),Math.round(t*i),Math.round((A+1)*e),Math.round((t+1)*i)])([t,A],[QA,wA]);for(let A=a;A<o;A++)for(let t=s;t<n;t++)cA({row:A,column:t,pixel:e,...i})}),$??=CA,A>=1&&console.log(\"[geowarp] method:\",W);let at,nt,ot=([A,t])=>{const e=[PA+A*zA+KA,JA-t*qA-jA],i=mA?e:sA(e);return UA(i).map((A=>Math.floor(A)))};if(gA){const t=_({bbox:[0,0,K,Y],debug_level:A,quiet:!0,reproject:ot,threshold:[.5,.5]})?.reproject;t&&(ot=A=>t(A).map((A=>Math.round(A))))}gA&&(aA&&(J??=d(H,sA,{density:100,nan_strategy:\"skip\"}),xA??=a(e,J),at=_({bbox:xA,debug_level:A,quiet:!0,reproject:aA,threshold:[KA,jA]})),sA&&(kA??=d(e,aA,{density:100}),MA??=a(H,kA),nt=_({bbox:MA,debug_level:A,quiet:!0,reproject:sA,threshold:[KA,jA]}))),A>=2&&(at&&console.log(\"[geowarp] turbocharged forward\"),nt&&console.log(\"[geowarp] turbocharged inverse\"));const rt=at?.reproject||aA,lt=nt?.reproject||sA;let ht,gt,ct,ft;\"near-vectorize\"!==W&&\"nearest-vectorize\"!==W||(A>=2&&console.log('[geowarp] choosing between \"near\" and \"vectorize\" for best speed'),J??=mA?H:d(H,sA,{density:100,nan_strategy:\"skip\"}),ht=(J[3]-J[1])/CA,gt=(J[2]-J[0])/EA,ct=ht/S,ft=gt/G,A>=2&&console.log(\"[geowarp] pixel_height_ratio:\",ct),A>=2&&console.log(\"[geowarp] pixel_width_ratio:\",ft),ct<.1&&ft<.1?(W=\"vectorize\",A>=1&&console.log('[geowarp] selected \"vectorize\" method as it is likely to be faster')):(W=\"near\",A>=1&&console.log('[geowarp] selected \"near\" method as it is likely to be faster')));const ut=\"any\"===dA?A=>A.some((A=>E(A)||R.includes(A))):\"all\"===dA?A=>A.every((A=>E(A)||R.includes(A))):()=>!1;if(\"vectorize\"===W){J??=mA?H:d(H,sA,{density:100,nan_strategy:\"skip\"});let[t,r,l,h]=J;ht??=(h-r)/CA,S<ht&&A>=1&&console.warn(`[geowarp] normalized height of sample area of ${ht} is larger than input pixel height of ${S}`),gt??=(l-t)/K,G<gt&&A>=1&&console.warn(`[geowarp] normalized width of sample area of ${gt} is larger than input pixel width of ${G}`);const g=nA&&I(nA,{reproject:sA}),c=nA&&s(g);if((!nA||i(e,c))&&([t,r,l,h]=nA&&\"inside\"!==hA?a(J,c):J,A>=1&&console.log(\"[geowarp] [left, bottom, right, top]:\",[t,r,l,h]),t<RA&&r<FA&&l>GA||h<NA)){const t=d(J,UA);if(A>=1&&console.log(\"[geowarp] out_bbox_in_input_image_coords:\",t),i(t,[0,0,N,D])){const[A,e,i,s]=t.map((A=>Math.floor(A))),a=w(e,0,D-1),r=w(s,0,D-1),l=w(A,0,N-1),h=w(i,0,N-1);for(let A=a;A<=r;A++)for(let t=l;t<=h;t++){const e=X.map((e=>At({point:{band:e,row:A,column:t}}).value));if(ut(e))continue;const i=n([t,A,t+1,A+1]),s={debug:!1,raster_bbox:H,raster_height:CA,raster_width:EA,geometry:I(i,{reproject:YA})},a=vA({pixel:e});null===a&&\"insert\"!==uA||(s.per_pixel=nA?({row:A,column:t})=>{VA[A].some((([A,e])=>t>=A&&t<=e))&&fA({raw:e,pixel:a,row:A,column:t})}:({row:A,column:t})=>{fA({raw:e,pixel:a,row:A,column:t})},o.calculate(s))}}}}else if(\"near\"===W||\"nearest\"===W){const A=Math.min($,CA);for(let t=Z;t<A;t++){const A=VA[t];for(let e=0;e<A.length;e++){const[i,s]=A[e];for(let A=i;A<=s;A++){const[e,i]=ot([A,t]);let s=[];if(s=e<0||i<0||e>=N||i>=D?new Array(X.length).fill(DA):tt({row:i,column:e}),ut(s))continue;const a=vA({pixel:s});null===a&&\"insert\"!==uA||fA({row:t,column:A,pixel:a,raw:s,x_in_raster_pixels:e,y_in_raster_pixels:i})}}}}else if(\"bilinear\"===W){const A=Math.min($,CA);let t=JA+jA-Z*qA;for(let e=Z;e<A;e++){t-=qA;const A=VA[e];for(let i=0;i<A.length;i++){const[s,a]=A[i];for(let A=s;A<=a;A++){const i=[PA+A*zA+KA,t],s=mA?i:lt(i),[a,n]=UA(s),o=Math.floor(a),r=Math.ceil(a),l=Math.floor(n),h=Math.ceil(n),g=r-a,c=a-o,f=l===h?.5:h-n,u=l===h?.5:n-l,d=o<0||o>=N,I=r<0||r>=N,_=l<0||l>=D,p=h<0||h>=D,C=_||d,B=_||I,w=p||d,y=p||I,Q=new Array;for(let A=0;A<X.length;A++){const t=X[A],e=C?DA:At({point:{band:t,row:l,column:o}}).value,i=B?DA:At({point:{band:t,row:l,column:r}}).value,s=w?DA:At({point:{band:t,row:h,column:o}}).value,a=y?DA:At({point:{band:t,row:h,column:r}}).value;let n;const d=E(e)||R.includes(e),I=E(i)||R.includes(i);let _;d&&I||(n=d?i:I||e===i?e:g*e+c*i);const p=E(s)||R.includes(s),m=E(a)||R.includes(a);let k;p&&m||(_=p?a:m||s===a?s:g*s+c*a),k=void 0===n&&void 0===_?DA:void 0===n?_:void 0===_?n:u*_+f*n,Q.push(k)}if(ut(Q))continue;const m=vA({pixel:Q});null===m&&\"insert\"!==uA||fA({row:e,column:A,pixel:m,raw:Q})}}}}else{let e,i,s,a,n;if(\"function\"==typeof W)e=A=>W({values:A});else if(\"max\"===W)e=A=>r(A,{theoretical_max:iA});else if(\"mean\"===W)e=A=>m(A);else if(\"median\"===W)e=A=>u(A);else if(\"min\"===W)e=A=>l(A,{theoretical_min:eA});else if(\"mode\"===W)e=A=>k(A)[0];else if(\"mode-max\"===W)e=A=>r(k(A));else if(\"mode-mean\"===W)e=A=>m(k(A));else if(\"mode-median\"===W)e=A=>u(k(A));else{if(\"mode-min\"!==W)throw new Error(`[geowarp] unknown method \"${W}\"`);e=A=>l(k(A))}a=JA-Z*Z;const o=Math.min($,CA);for(let r=Z;r<o;r++){i=a,a=i-qA;const o=VA[r];for(let l=0;l<o.length;l++){const[h,g]=o[l];n=PA+zA*h;for(let o=h;o<=g;o++){let l,h,g,c;s=n,n=s+zA;try{[l,h,g,c]=d([s,a,n,i],OA,{nan_strategy:\"throw\"})}catch(A){continue}A>=4&&console.log(\"[geowarp] leftInRasterPixels:\",l),A>=4&&console.log(\"[geowarp] rightInRasterPixels:\",g),A>=4&&console.log(\"[geowarp] topInRasterPixels:\",h),A>=4&&console.log(\"[geowarp] bottomInRasterPixels:\",c);let f=Math.round(l),u=Math.round(g),I=Math.round(h),_=Math.round(c);if(f===u){const A=(g+l)/2;f=Math.floor(A),u=f+1}if(I===_){const A=(h+c)/2;I=Math.floor(A),_=I+1}let p=[];if(f>=N||u<0||_<0||I>=D)p=new Array(X.length).fill(DA);else{f=Math.max(0,f),u=Math.min(u,N),I=Math.max(0,I),_=Math.min(_,D);for(let A=0;A<X.length;A++){const i=X[A],{data:s}=B.clip({data:t,flat:!0,layout:M,sizes:$A,rect:{band:[i,i],row:[I,Math.max(I,_-1)],column:[f,Math.max(f,u-1)]}}),a=s.filter((A=>\"number\"==typeof A&&A==A&&-1===R.indexOf(A)));0===a.length?p.push(DA):p.push(e(a))}}if(ut(p))continue;const C=vA({pixel:p});null===C&&\"insert\"!==uA||fA({row:r,column:o,pixel:C,raw:p})}}}}const dt=()=>(A>=1&&console.log(\"[geowarp] took \"+(performance.now()-_A).toFixed(0)+\"ms\"),{data:U,out_bands:L,out_height:Y,out_layout:q,out_pixel_depth:O,out_pixel_height:P,out_pixel_width:T,out_sample_height:qA,out_sample_width:zA,out_width:K,read_bands:X});return pA>0?new Promise((A=>{const t=setInterval((()=>{0===pA&&(clearInterval(t),A(dt()))}),5)})):dt()};A.exports=x,A.exports.default=x,\"object\"==typeof window&&(window.geowarp=x),\"object\"==typeof self&&(self.geowarp=x)},9123:A=>{A.exports=function(A){const t=A=>Array.isArray(A)||A instanceof Int8Array||A instanceof Uint8Array||A instanceof Uint8ClampedArray||A instanceof Int16Array||A instanceof Uint16Array||A instanceof Int32Array||A instanceof Uint32Array||A instanceof Float32Array||A instanceof Float64Array||A instanceof BigInt64Array||A instanceof BigUint64Array;let e=0,i=A;for(;t(i);)e++,i=i[0];return e}},9938:(A,t,e)=>{var i,s=Object.defineProperty,a=(A,t)=>s(A,\"name\",{value:t,configurable:!0}),n=(A,t)=>()=>(t||A((t={exports:{}}).exports,t),t.exports),o=n(((s,n)=>{var o={char2bits:{0:\"110100\",1:\"110101\",2:\"110110\",3:\"110111\",4:\"111000\",5:\"111001\",6:\"111010\",7:\"111011\",8:\"111100\",9:\"111101\",A:\"000000\",Q:\"010000\",g:\"100000\",w:\"110000\",B:\"000001\",R:\"010001\",h:\"100001\",x:\"110001\",C:\"000010\",S:\"010010\",i:\"100010\",y:\"110010\",D:\"000011\",T:\"010011\",j:\"100011\",z:\"110011\",E:\"000100\",U:\"010100\",k:\"100100\",F:\"000101\",V:\"010101\",l:\"100101\",G:\"000110\",W:\"010110\",m:\"100110\",H:\"000111\",X:\"010111\",n:\"100111\",I:\"001000\",Y:\"011000\",o:\"101000\",J:\"001001\",Z:\"011001\",p:\"101001\",K:\"001010\",a:\"011010\",q:\"101010\",L:\"001011\",b:\"011011\",r:\"101011\",M:\"001100\",c:\"011100\",s:\"101100\",N:\"001101\",d:\"011101\",t:\"101101\",O:\"001110\",e:\"011110\",u:\"101110\",\"+\":\"111110\",P:\"001111\",f:\"011111\",v:\"101111\",\"/\":\"111111\"}};o.toArrayBuffer=a((function(A){var t=o.char2bits,e=0;for(let t=A.length;t>=0;t--)\"=\"===A[t]&&e++;for(var i=A.length-e,s=Math.floor(.75*i),a=new Uint8Array(s),n=\"\",r=0;r<i;r++){var l=A[r];if(\"=\"===l)break;(n+=t[l]).length>=8&&(a[Math.floor(.75*r)]=parseInt(n.substring(0,8),2),n=n.substring(8))}return a.buffer}),\"toArrayBuffer\"),o.toBase64String=a((function(A){if(!o.bits2char){o.bits2char={};for(let A in o.char2bits)o.bits2char[o.char2bits[A]]=A}for(var t=o.bits2char,e=new Uint8Array(A),i=\"\",s=\"\",a=0;a<e.length;a++){for(var n=e[a].toString(2);n.length<8;)n=\"0\"+n;for(s+=n;s.length>=6;)i+=t[s.substring(0,6)],s=s.substring(6)}if(s.length>0){for(;s.length<6;)s+=\"0\";i+=t[s]}for(;i.length%4!=0;)i+=\"=\";return i}),\"toBase64String\"),void 0===(i=function(){return o}.call(t,e,t,A))||(A.exports=i),\"object\"==typeof n&&(n.exports=o),\"object\"==typeof window&&(window.b64ab=o),\"object\"==typeof self&&(self.b64ab=o)})),r=n(((A,t)=>{function e(A,t,e){let i=new RegExp(t).exec(A.slice(e));return i?e+i.index:-1}a(e,\"indexOfMatch\"),t.exports=e,t.exports.default=e})),l=n(((A,t)=>{function e(A,t,e){let i=new RegExp(t).exec(A.slice(e));return i?e+i.index+i[0].length-1:-1}a(e,\"indexOfMatchEnd\"),t.exports=e,t.exports.default=e})),h=n(((A,t)=>{function e(A,t){let e=new RegExp(t,\"g\"),i=A.match(e);return i?i.length:0}a(e,\"countSubstring\"),t.exports=e,t.exports.default=e})),g=n(((A,t)=>{var e=r(),i=l(),s=h();function n(A,t,a){let n=a&&a.debug||!1,o=!(a&&!1===typeof a.nested),r=a&&a.startIndex||0;n&&console.log(\"[xml-utils] starting findTagByName with\",t,\" and \",a);let l=e(A,`<${t}[ \\n>/]`,r);if(n&&console.log(\"[xml-utils] start:\",l),-1===l)return;let h=A.slice(l+t.length),g=i(h,\"^[^<]*[ /]>\",0),c=-1!==g&&\"/\"===h[g-1];if(n&&console.log(\"[xml-utils] selfClosing:\",c),!1===c)if(o){let A=0,e=1,a=0;for(;-1!==(g=i(h,\"[ /]\"+t+\">\",A));){let i=h.substring(A,g+1);if(e+=s(i,\"<\"+t+\"[ \\n\\t>]\"),a+=s(i,\"</\"+t+\">\"),a>=e)break;A=g}}else g=i(h,\"[ /]\"+t+\">\",0);let f=l+t.length+g+1;if(n&&console.log(\"[xml-utils] end:\",f),-1===f)return;let u,d=A.slice(l,f);return u=c?null:d.slice(d.indexOf(\">\")+1,d.lastIndexOf(\"<\")),{inner:u,outer:d,start:l,end:f}}a(n,\"findTagByName\"),t.exports=n,t.exports.default=n})),c=n(((A,t)=>{var e=g();function i(A,t,i){let s,a=[],n=i&&i.debug||!1,o=!i||\"boolean\"!=typeof i.nested||i.nested,r=i&&i.startIndex||0;for(;s=e(A,t,{debug:n,startIndex:r});)r=o?s.start+1+t.length:s.end,a.push(s);return n&&console.log(\"findTagsByName found\",a.length,\"tags\"),a}a(i,\"findTagsByName\"),t.exports=i,t.exports.default=i})),f=n(((A,t)=>{var e=c();function i(A,t,i){let s=i&&i.debug||!1,a=i&&i.returnOnFirst||!1,n=e(A,t.shift(),{debug:s,nested:!1});s&&console.log(\"first tags are:\",n);for(let A=0;A<t.length;A++){let i=t[A];s&&console.log(\"tagName:\",i);let o=[];for(let r=0;r<n.length;r++){let l=n[r],h=e(l.outer,i,{debug:s,startIndex:1});if(s&&console.log(\"subTags.length:\",h.length),h.length>0){if(h.forEach((A=>{A.start+=l.start,A.end+=l.start})),a&&A===t.length-1)return[h[0]];o=o.concat(h)}}n=o}return n}a(i,\"findTagsByPath\"),t.exports=i,t.exports.default=i})),u=n(((A,t)=>{var e=f();function i(A,t,i){let s=i&&i.debug||!1,a=e(A,t,{debug:s,returnOnFirst:!0});if(Array.isArray(a)&&1===a.length)return a[0]}a(i,\"findTagByPath\"),t.exports=i,t.exports.default=i})),d=n(((A,t)=>{function e(A,t,e){let i=e&&e.debug||!1;i&&console.log(\"[xml-utils] getting \"+t+\" in \"+A);let s=\"object\"==typeof A?A.outer:A,a=s.slice(0,s.indexOf(\">\")+1),n=['\"',\"'\"];for(let A=0;A<n.length;A++){let e=n[A],s=t+\"\\\\=\"+e+\"([^\"+e+\"]*)\"+e;i&&console.log(\"[xml-utils] pattern:\",s);let o=new RegExp(s).exec(a);if(i&&console.log(\"[xml-utils] match:\",o),o)return o[1]}}a(e,\"getAttribute\"),t.exports=e,t.exports.default=e})),I=n(((A,t)=>{\"use strict\";var e=1,i=/\\s/,s=/[A-Za-z]/,n=/[A-Za-z84_]/,o=/[,\\]]/,r=/[\\d\\.E\\-\\+]/;function l(A){if(\"string\"!=typeof A)throw new Error(\"not a string\");this.text=A.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=e}function h(A){return new l(A).output()}function g(A,t,e){Array.isArray(t)&&(e.unshift(t),t=null);var i=t?{}:A,s=e.reduce((function(A,t){return c(t,A),A}),i);t&&(A[t]=s)}function c(A,t){if(Array.isArray(A)){var e=A.shift();if(\"PARAMETER\"===e&&(e=A.shift()),1===A.length)return Array.isArray(A[0])?(t[e]={},void c(A[0],t[e])):void(t[e]=A[0]);if(A.length)if(\"TOWGS84\"!==e){if(\"AXIS\"===e)return e in t||(t[e]=[]),void t[e].push(A);var i;switch(Array.isArray(e)||(t[e]={}),e){case\"UNIT\":case\"PRIMEM\":case\"VERT_DATUM\":return t[e]={name:A[0].toLowerCase(),convert:A[1]},void(3===A.length&&c(A[2],t[e]));case\"SPHEROID\":case\"ELLIPSOID\":return t[e]={name:A[0],a:A[1],rf:A[2]},void(4===A.length&&c(A[3],t[e]));case\"PROJECTEDCRS\":case\"PROJCRS\":case\"GEOGCS\":case\"GEOCCS\":case\"PROJCS\":case\"LOCAL_CS\":case\"GEODCRS\":case\"GEODETICCRS\":case\"GEODETICDATUM\":case\"EDATUM\":case\"ENGINEERINGDATUM\":case\"VERT_CS\":case\"VERTCRS\":case\"VERTICALCRS\":case\"COMPD_CS\":case\"COMPOUNDCRS\":case\"ENGINEERINGCRS\":case\"ENGCRS\":case\"FITTED_CS\":case\"LOCAL_DATUM\":case\"DATUM\":return A[0]=[\"name\",A[0]],void g(t,e,A);default:for(i=-1;++i<A.length;)if(!Array.isArray(A[i]))return c(A,t[e]);return g(t,e,A)}}else t[e]=A;else t[e]=!0}else t[A]=!0}a(l,\"Parser\"),l.prototype.readCharicter=function(){var A=this.text[this.place++];if(4!==this.state)for(;i.test(A);){if(this.place>=this.text.length)return;A=this.text[this.place++]}switch(this.state){case e:return this.neutral(A);case 2:return this.keyword(A);case 4:return this.quoted(A);case 5:return this.afterquote(A);case 3:return this.number(A);case-1:return}},l.prototype.afterquote=function(A){if('\"'===A)return this.word+='\"',void(this.state=4);if(o.test(A))return this.word=this.word.trim(),void this.afterItem(A);throw new Error(\"havn't handled \\\"\"+A+'\" in afterquote yet, index '+this.place)},l.prototype.afterItem=function(A){return\",\"===A?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=e)):\"]\"===A?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=e,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},l.prototype.number=function(A){if(!r.test(A)){if(o.test(A))return this.word=parseFloat(this.word),void this.afterItem(A);throw new Error(\"havn't handled \\\"\"+A+'\" in number yet, index '+this.place)}this.word+=A},l.prototype.quoted=function(A){'\"'!==A?this.word+=A:this.state=5},l.prototype.keyword=function(A){if(n.test(A))this.word+=A;else{if(\"[\"===A){var t=[];return t.push(this.word),this.level++,null===this.root?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,void(this.state=e)}if(!o.test(A))throw new Error(\"havn't handled \\\"\"+A+'\" in keyword yet, index '+this.place);this.afterItem(A)}},l.prototype.neutral=function(A){if(s.test(A))return this.word=A,void(this.state=2);if('\"'===A)return this.word=\"\",void(this.state=4);if(r.test(A))return this.word=A,void(this.state=3);if(!o.test(A))throw new Error(\"havn't handled \\\"\"+A+'\" in neutral yet, index '+this.place);this.afterItem(A)},l.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string \"'+this.text+'\". State is '+this.state)},a(h,\"parseString\"),a(g,\"mapit\"),a(c,\"sExpr\");var f=.017453292519943295;function u(A,t){var e=t[0],i=t[1];!(e in A)&&i in A&&(A[e]=A[i],3===t.length&&(A[e]=t[2](A[e])))}function d(A){return A*f}function I(A){if(\"GEOGCS\"===A.type?A.projName=\"longlat\":\"LOCAL_CS\"===A.type?(A.projName=\"identity\",A.local=!0):\"object\"==typeof A.PROJECTION?A.projName=Object.keys(A.PROJECTION)[0]:A.projName=A.PROJECTION,A.AXIS){for(var t=\"\",e=0,i=A.AXIS.length;e<i;++e){var s=[A.AXIS[e][0].toLowerCase(),A.AXIS[e][1].toLowerCase()];-1!==s[0].indexOf(\"north\")||(\"y\"===s[0]||\"lat\"===s[0])&&\"north\"===s[1]?t+=\"n\":-1!==s[0].indexOf(\"south\")||(\"y\"===s[0]||\"lat\"===s[0])&&\"south\"===s[1]?t+=\"s\":-1!==s[0].indexOf(\"east\")||(\"x\"===s[0]||\"lon\"===s[0])&&\"east\"===s[1]?t+=\"e\":(-1!==s[0].indexOf(\"west\")||(\"x\"===s[0]||\"lon\"===s[0])&&\"west\"===s[1])&&(t+=\"w\")}2===t.length&&(t+=\"u\"),3===t.length&&(A.axis=t)}A.UNIT&&(A.units=A.UNIT.name.toLowerCase(),\"metre\"===A.units&&(A.units=\"meter\"),A.UNIT.convert&&(\"GEOGCS\"===A.type?A.DATUM&&A.DATUM.SPHEROID&&(A.to_meter=A.UNIT.convert*A.DATUM.SPHEROID.a):A.to_meter=A.UNIT.convert));var n=A.GEOGCS;function o(t){return t*(A.to_meter||1)}\"GEOGCS\"===A.type&&(n=A),n&&(n.DATUM?A.datumCode=n.DATUM.name.toLowerCase():A.datumCode=n.name.toLowerCase(),\"d_\"===A.datumCode.slice(0,2)&&(A.datumCode=A.datumCode.slice(2)),(\"new_zealand_geodetic_datum_1949\"===A.datumCode||\"new_zealand_1949\"===A.datumCode)&&(A.datumCode=\"nzgd49\"),(\"wgs_1984\"===A.datumCode||\"world_geodetic_system_1984\"===A.datumCode)&&(\"Mercator_Auxiliary_Sphere\"===A.PROJECTION&&(A.sphere=!0),A.datumCode=\"wgs84\"),\"_ferro\"===A.datumCode.slice(-6)&&(A.datumCode=A.datumCode.slice(0,-6)),\"_jakarta\"===A.datumCode.slice(-8)&&(A.datumCode=A.datumCode.slice(0,-8)),~A.datumCode.indexOf(\"belge\")&&(A.datumCode=\"rnb72\"),n.DATUM&&n.DATUM.SPHEROID&&(A.ellps=n.DATUM.SPHEROID.name.replace(\"_19\",\"\").replace(/[Cc]larke\\_18/,\"clrk\"),\"international\"===A.ellps.toLowerCase().slice(0,13)&&(A.ellps=\"intl\"),A.a=n.DATUM.SPHEROID.a,A.rf=parseFloat(n.DATUM.SPHEROID.rf,10)),n.DATUM&&n.DATUM.TOWGS84&&(A.datum_params=n.DATUM.TOWGS84),~A.datumCode.indexOf(\"osgb_1936\")&&(A.datumCode=\"osgb36\"),~A.datumCode.indexOf(\"osni_1952\")&&(A.datumCode=\"osni52\"),(~A.datumCode.indexOf(\"tm65\")||~A.datumCode.indexOf(\"geodetic_datum_of_1965\"))&&(A.datumCode=\"ire65\"),\"ch1903+\"===A.datumCode&&(A.datumCode=\"ch1903\"),~A.datumCode.indexOf(\"israel\")&&(A.datumCode=\"isr93\")),A.b&&!isFinite(A.b)&&(A.b=A.a),a(o,\"toMeter\");var r=a((function(t){return u(A,t)}),\"renamer\");[[\"standard_parallel_1\",\"Standard_Parallel_1\"],[\"standard_parallel_1\",\"Latitude of 1st standard parallel\"],[\"standard_parallel_2\",\"Standard_Parallel_2\"],[\"standard_parallel_2\",\"Latitude of 2nd standard parallel\"],[\"false_easting\",\"False_Easting\"],[\"false_easting\",\"False easting\"],[\"false-easting\",\"Easting at false origin\"],[\"false_northing\",\"False_Northing\"],[\"false_northing\",\"False northing\"],[\"false_northing\",\"Northing at false origin\"],[\"central_meridian\",\"Central_Meridian\"],[\"central_meridian\",\"Longitude of natural origin\"],[\"central_meridian\",\"Longitude of false origin\"],[\"latitude_of_origin\",\"Latitude_Of_Origin\"],[\"latitude_of_origin\",\"Central_Parallel\"],[\"latitude_of_origin\",\"Latitude of natural origin\"],[\"latitude_of_origin\",\"Latitude of false origin\"],[\"scale_factor\",\"Scale_Factor\"],[\"k0\",\"scale_factor\"],[\"latitude_of_center\",\"Latitude_Of_Center\"],[\"latitude_of_center\",\"Latitude_of_center\"],[\"lat0\",\"latitude_of_center\",d],[\"longitude_of_center\",\"Longitude_Of_Center\"],[\"longitude_of_center\",\"Longitude_of_center\"],[\"longc\",\"longitude_of_center\",d],[\"x0\",\"false_easting\",o],[\"y0\",\"false_northing\",o],[\"long0\",\"central_meridian\",d],[\"lat0\",\"latitude_of_origin\",d],[\"lat0\",\"standard_parallel_1\",d],[\"lat1\",\"standard_parallel_1\",d],[\"lat2\",\"standard_parallel_2\",d],[\"azimuth\",\"Azimuth\"],[\"alpha\",\"azimuth\",d],[\"srsCode\",\"name\"]].forEach(r),!A.long0&&A.longc&&(\"Albers_Conic_Equal_Area\"===A.projName||\"Lambert_Azimuthal_Equal_Area\"===A.projName)&&(A.long0=A.longc),A.lat_ts||!A.lat1||\"Stereographic_South_Pole\"!==A.projName&&\"Polar Stereographic (v