geocanvas
Version:
Functions for Working with GeoSpatial Canvas Elements
2 lines • 17.9 kB
JavaScript
(()=>{var t={973:(t,e,r)=>{const n=r(338),o=r(641),s=r(173),i=r(441),a=r(40),c=r(300),l=r(182),u=r(289),f=r(365),g=r(363),h=r(622);t.exports=function({raster_bbox:t,raster_height:e,raster_width:r,pixel_height:p,pixel_width:d,geometry:m,per_pixel:x,per_row_segment:b}){const[w,y,_,v]=t,k=[];if(0!==e){for(let t=0;t<e;t++){const e=v-p*t-p/2,r=n([w,e],[w+1,e]);k.push(r)}u(m).map(c).forEach((c=>{const u=h(e).map((()=>[])),m=c.length;for(let r=0;r<m;r++){const o=c[r],[i,a]=o,[f,g]=i,[h,d]=a,m=Math.sign(d-g),x=g===d,b=f===h,w=g,y=n(i,a),_=Math.min(g,d),v=Math.max(g,d);let j,A,M,N;if(f<h?([j,A]=i,[N,M]=a):([j,A]=a,[N,M]=i),void 0===j)throw Error("startLng is "+j);const S=Math.round((t[3]-.5*p-A)/p),E=Math.round((t[3]-.5*p-M)/p);let O,L;S<E?(O=S,L=E):(O=E,L=S),O=s(O,0,e-1),L=s(L,0,e-1);for(let t=O;t<L+1;t++){const e=k[t];if(void 0===e)throw console.error("j:",t),console.error("imageLines:",k),Error("imageLines");const n=-1*e.c,s=g===n,i=d===n,a=!i;let c,p;if(x){if(w!==n)continue;c=j,p=N}else if(b)n>=_&&n<=v&&(c=j,p=N);else if(s)c=p=f;else if(i)c=p=h;else try{c=p=l(y,e).x}catch(t){throw t}c&&p&&(x||c>=j&&p<=N&&n<=v&&n>=_)&&u[t].push({direction:m,index:r,edge:o,endsOnLine:i,endsOffLine:a,horizontal:x,startsOnLine:s,vertical:b,xmin:c,xmax:p,imageLineY:n})}}u.map(((t,e)=>{if(t.length>0){const n=a(t,m).map(o),[s,c]=g(n,(t=>t.through));if(s.length%2==1)throw Error("throughs.length for "+e+" is odd with "+s.length);let l=c.map((t=>[t.xmin,t.xmax]));s.sort(((t,e)=>t.xmin-e.xmin));const u=i(s).map((t=>{const[e,r]=t;return[e.xmin,r.xmax]}));l=l.concat(u),l=f(l),l.forEach((t=>{const[n,o]=t,s=Math.round((n-(w+.5*d))/d),i=Math.round((o-(w+.5*d))/d);if(s>=r)return;if(i<0)return;const a=Math.max(s,0),c=Math.min(i,r-1);if(b&&b({row:e,columns:[a,c]}),x)for(let t=a;t<=c;t++)x({row:e,column:t})}))}}))}))}}},184:(t,e,r)=>{const n=r(973),o=r(436),s=r(911);t.exports=function({debug:t=!1,raster_bbox:e,raster_height:r,raster_width:i,pixel_height:a,pixel_width:c,geometry:l,per_pixel:u,per_row_segment:f}){const[g,h,p,d]=e;null==a&&(a=(d-h)/r),null==c&&(c=(p-g)/i);const m=new Array(r);n({raster_bbox:e,raster_height:r,raster_width:i,pixel_height:a,pixel_width:c,geometry:l,per_pixel:u,per_row_segment:({row:t,columns:e})=>{m[t]||(m[t]=[]),m[t].push(e),f&&f({row:t,columns:e})}});for(let t=0;t<m.length;t++){const e=m[t];e&&(e.sort(((t,e)=>t===e?t[1]-e[1]:t[0]-e[0])),m[t]=s(e))}return t&&o(insides),{rows:m}}},641:t=>{t.exports=function(t){try{let e,r,n;const o=t.length,s=t[0];if(1===o)e=!0,r=s.xmin,n=s.xmax;else{const i=t[o-1];e=s.direction===i.direction,r=Math.min(s.xmin,i.xmin),n=Math.max(s.xmax,i.xmax)}if(void 0===r||void 0===n||void 0===e||isNaN(r)||isNaN(n))throw Error("categorizeIntersection failed with xmin",r,"and xmax",n);return{xmin:r,xmax:n,through:e}}catch(e){throw console.error("[categorizeIntersection] segments:",t),console.error("[categorizeIntersection]",e),e}}},436:t=>{t.exports=function(t){t.forEach(((t,e)=>{for(let r=0;r<t.length;r++){const n=t[r],[o,s]=n;o>s&&console.warn("[dufour-peyton-intersection] uh oh, encountered invalid range",n,"at row index",e,"with ranges",t);for(let n=r+1;n<t.length;n++)n[0]<=s&&console.warn("[dufour-peyton-intersection] encountered range problem on row index",e,":",t)}}))}},173:t=>{t.exports=function(t,e,r){return t<e?e:t>r?r:t}},40:(t,e,r)=>{const n=r(259);t.exports=function(t,e,r=!1){try{const r=n(t,(t=>t.endsOffLine));if(r.length>=2){const t=r[0],n=t[0],o=r[r.length-1],s=o[o.length-1];s.index===e-1&&0===n.index&&s.endsOnLine&&(r[0]=r.pop().concat(t))}return r}catch(t){console.error("[clusterLineSegments]",t)}}},259:t=>{t.exports=function(t,e){try{const r=t.length,n=[];let o=[];for(let s=0;s<r;s++){const r=t[s];o.push(r),e(r)&&(n.push(o),o=[])}return o.length>0&&n.push(o),n}catch(t){console.error("[cluster]:",t)}}},441:t=>{t.exports=function(t){const e=[],r=t.length;for(let n=0;n<r;n+=2)e.push([t[n],t[n+1]]);return e}},827:t=>{t.exports=function(t,e){t.forEach((t=>{for(let r=1;r<t.length;r++){const n=t[r-1],o=t[r];e([n,o],r-1)}}))}},385:(t,e,r)=>{const n=r(155);t.exports=function t(e,r){if("FeatureCollection"===e.type)e.features.forEach((e=>t(e,r)));else if("Feature"===e.type)t(e.geometry,r);else if("Polygon"===e.type)t(e.coordinates,r);else if("MultiPolygon"===e.type)e.coordinates.forEach((t=>{r(t)}));else if(Array.isArray(e)){const t=n(e);4===t?e.forEach((t=>{r(t)})):3===t&&r(e)}}},450:(t,e,r)=>{const n=r(385);t.exports=function(t){let e,r,o,s;return n(t,(t=>{const n=t[0],i=n.length-1;let a;for(void 0===e?(e=o=n[0][0],r=s=n[0][1],a=1):a=0;a<=i;a++){const[t,i]=n[a];t<e?e=t:t>o&&(o=t),i<r?r=i:i>s&&(s=i)}})),[e,r,o,s]}},300:(t,e,r)=>{const n=r(827);t.exports=function(t){const e=[];return n(t,(t=>e.push(t))),e}},182:t=>{t.exports=function(t,e){const r=t.a*e.b-e.a*t.b;if(r)return{x:(e.b*t.c-t.b*e.c)/r,y:(t.a*e.c-e.a*t.c)/r}}},338:t=>{t.exports=function(t,e){const[r,n]=t,[o,s]=e,i=s-n,a=r-o;return{a:i,b:a,c:i*r+a*n}}},289:(t,e,r)=>{const n=r(385);t.exports=function(t){const e=[];return n(t,(t=>e.push(t))),e}},81:(t,e,r)=>{var n;const o=r(641),s=r(173),i=r(259),a=r(40),c=r(184),l=r(973),u=r(441),f=r(450),g=r(289),h={calculate:c,calculateCore:l,categorizeIntersection:o,clamp:s,cluster:i,clusterLineSegments:a,couple:u,eachEdge:r(827),getBoundingBox:f,getIntersectionOfTwoLines:r(182),getLineFromPoints:r(338),getPolygons:g,mergeRanges:r(365),partition:r(363),range:r(622)};void 0===(n=(()=>h).call(e,r,e,t))||(t.exports=n),t.exports=h,"object"==typeof self&&(self.dufour_peyton_intersection=h),"object"==typeof window&&(window.dufour_peyton_intersection=h)},911:t=>{t.exports=function(t){const e=t.length;if(e>0){const r=t[0];let n=r[1];const o=[r];for(let r=1;r<e;r++){const e=t[r],[s,i]=e;s<=n+1?o[o.length-1][1]=i:o.push(e),n=i}return o}}},365:t=>{t.exports=function(t){const e=t.length;if(e>0){const r=t[0];let n=r[1];const o=[r];for(let r=1;r<e;r++){const e=t[r],[s,i]=e;s<=n?o[o.length-1][1]=i:o.push(e),n=i}return o}}},363:t=>{t.exports=function(t,e){const r=[],n=[],o=t.length;for(let s=0;s<o;s++){const o=t[s];e(o)?r.push(o):n.push(o)}return[r,n]}},622:t=>{t.exports=function(t){const e=new Array(t);for(let r=0;r<t;r++)e[r]=r;return e}},869:(t,e,r)=>{const n=r(81),o=r(42),s=r(89),i=r(683),a=r(905);function c({rows:t}){t.forEach(((t,e)=>{t&&t.forEach((([t,r],n)=>{if(t>r)throw Error(`uh oh: invalid segment at row ${e}, segment ${n}`)}))}))}function l({debug:t=!1,raster_bbox:e,raster_height:r,raster_width:a,pixel_height:l,pixel_width:u,mask:f,reproject:g}){"function"==typeof g&&(f=i(f,{in_place:!1,reproject:g})),void 0===l&&(l=Number(s(o(e[3].toString(),e[1].toString()),r.toString()))),void 0===u&&(u=Number(s(o(e[2].toString(),e[0].toString()),a.toString())));const{rows:h}=n.calculate({raster_bbox:e,raster_height:r,raster_width:a,pixel_height:l,pixel_width:u,geometry:f});return t&&c({rows:h}),{rows:h}}const u={inside:l,outside:function({debug:t=!1,raster_bbox:e,raster_height:r,raster_width:n,pixel_height:u,pixel_width:f,mask:g,reproject:h}){"function"==typeof h&&(g=i(g,{in_place:!1,reproject:h})),void 0===u&&(u=Number(s(o(e[3].toString(),e[1].toString()),r.toString()))),void 0===f&&(f=Number(s(o(e[2].toString(),e[0].toString()),n.toString())));const{rows:p}=l({debug:t,raster_bbox:e,raster_height:r,raster_width:n,pixel_height:u,pixel_width:f,mask:g});t&&c({rows:p});const d=n-1,m=[];for(let t=0;t<p.length;t++){const e=p[t];Array.isArray(e)&&0!==e.length?m.push(a({segments:e,min:0,max:d,debug:!1})):m.push([[0,d]])}return t&&c({rows:m}),{rows:m}}};t.exports=u},155:t=>{t.exports=function(t){const e=t=>Array.isArray(t)||t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array||t instanceof BigInt64Array||t instanceof BigUint64Array;let r=0,n=t;for(;e(n);)r++,n=n[0];return r}},585:(t,e,r)=>{const n=r(875);t.exports=function(t){return"-"===(t=n(t))[0]?t.substring(1):t}},316:(t,e,r)=>{const n=r(232),o=r(875),s=r(888),i=r(411);t.exports=function(t,e){t=o(t),e=o(e);const r="-"!==t[0],a="-"!==e[0];if(r&&a)return s(t,e);if(!r&&!a)return"-"+s(t.substring(1),e.substring(1));if(!r&&a)switch(t=t.substring(1),n(t,e)){case"=":return"0";case"<":return i(e,t);case">":return"-"+i(t,e)}else if(r&&!a)switch(e=e.substring(1),n(t,e)){case"=":return"0";case"<":return"-"+i(e,t);case">":return i(t,e)}}},875:(t,e,r)=>{const n=r(604);t.exports=function(t){return"+"===t[0]&&(t=t.substring(1)),(t=n(t)).replace(/^0+(?=\d)/,"")}},232:(t,e,r)=>{r(875),t.exports=function(t,e){const r=t.length,n=e.length,o=t.indexOf("."),s=e.indexOf("."),i=-1===o?r:o,a=-1===s?n:s,c=i-a;let l=c<0?-1*c:0,u=c<=0?0:c,f=Math.max(i,a)+1+Math.max(r-i,n-a)-1,g=0;for(;g<f;){const r=t[g-l]||"0",n=e[g-u]||"0";if(r!==n){if(r>n)return">";if(r<n)return"<"}g++}return"="}},89:(t,e,r)=>{const n=r(585),o=r(875),s=r(41);t.exports=function(t,e,r){t=o(t),e=o(e);const i="-"!==t[0],a="-"!==e[0],c=i!==a?"-":"";return i||(t=n(t)),a||(e=n(e)),c+s(t,e,r)}},604:t=>{t.exports=function(t){"+"===t[0]&&(t=t.substring(1));const e="-"===t[0]?"-":"";"-"===e&&(t=t.substring(1));const r=t.indexOf("e");if(-1===r)return e+t;let n=t.indexOf(".");-1===n&&(n=r);const o=Number(t.substring(r+1)),s=t.substring(0,r).replace(".",""),i=n+o,a=s.length;if(i>=a){const t=i-a;let r=s;for(let e=0;e<t;e++)r+="0";return e+r}if(i<0){result="0.";for(let t=0;t>i;t--)result+="0";return result+=s,e+result}return e+s.substring(0,i)+"."+s.substring(i)}},888:t=>{t.exports=function(t,e){const r=t.length,n=e.length,o=t.indexOf("."),s=e.indexOf("."),i=-1===o?r:o,a=-1===s?n:s,c=i-a;let l=Math.max(i,a),u=Math.max(r-i-1,n-a-1),f=c<0?-1*c:0,g=c<=0?0:c,h=l+1+u-1,p="",d=0,m=h;if(u>0){for(;m>h-u;){const r=t[m-f]||"0",n=e[m-g]||"0";let o=Number(r)+Number(n)+d;o>=10?(o-=10,d=1):d=0,""===p&&0===o||(p=o+p),m--}p&&(p="."+p),m--}if(l>0)for(;m>=0;){const r=t[m-f]||"0",n=e[m-g]||"0";let o=Number(r)+Number(n)+d;o>=10?(o-=10,d=1):d=0,p=o+p,m--}return 1===d&&(p=d+p),p}},41:(t,e,r)=>{const n=r(232),o=r(316),s=(r(494),r(42)),i=r(360);t.exports=function(t,e,{max_decimal_digits:r=100,ellipsis:a=!1}={}){"0"===t[0]&&(t=t.substring(1)),"0"===e[0]&&(e=e.substring(1));const c=t.indexOf("."),l=e.indexOf("."),u=-1===c?t.length:c,f=-1===l?0:e.length-1-l;let g=!1;t=t.replace(/\./,""),e=e.replace(/\./,"");const h=t.length;let p,d="",m="",x=-1*f,b=0;for(let r=0;r<h;r++)if(d+=t[r],p=n(d,e),">"===p){let t=1,r=o(e,e),i=e;for(;">"!==n(r,d);)t++,i=r,r=o(r,e);if(t=t.toString(),""!==m)for(let e=t.length;e<=b;e++)m+="0";m+=t,d=s(d,i),b=0}else{if("<"===p){""===m&&x++,b++;continue}if("="===p){if(""!==m)for(let t=0;t<b;t++)m+="0";m+="1",d="0",b=0}}if(d.match(/^0+$/g))"<"===p&&(m+=d.substring(0,d.length-1));else{const t={},i=u-x-m.length+r+1;""===m&&(b=0);for(let r=0;r<i;r++){if(d+="0",a)if(d in t){if(t[d]++,t[d]>3){m+="...",g=!0;break}}else t[d]=1;const r=n(d,e);if(">"===r){let t=1,r=o(e,e),i=e;for(;">"!==n(r,d);)t++,i=r,r=o(r,e);t=t.toString();for(let e=t.length;e<=b;e++)m+="0";if(m+=t,d=s(d,i),"0"===d)break;b=0}else{if("<"===r){b++;continue}if("="===r){for(let t=0;t<b;t++)m+="0";m+="1",b=0;break}}}}const w=u-x,y=m.length;let _;if(w===y)_=0;else if(w<0)m="0."+"0".repeat(Math.abs(w))+m,_=y-w;else if(w>y){for(let t=y;t<w;t++)m+="0";_=0}else w<y?(m=m.substring(0,w)+"."+m.substring(w),_=y-w):0===w&&(m="0."+m,_=y);if(m=m.replace(/^0+/,""),m=m.replace(/\.\d+0+$/,""),!g){const t=_-r;t>0&&(m=i(m.substring(0,m.length-t+1)))}return"."===m[0]&&(m="0"+m),m}},90:t=>{t.exports=function(t,e){if("0"===t||"0"===e)return"0";const r=t.indexOf("."),n=e.indexOf("."),o=(-1===r?0:t.length-1-r)+(-1===n?0:e.length-1-n);t=t.replace(".",""),e=e.replace(".","");const s=t.length,i=e.length,a=[];let c=s;for(;c>=0;){const e=c,r=c-=15,n=t.substring(r,e);a.push([Number(n),n.length])}const l=[],u=[];for(let t=0,r=i-1;r>=0;r--,t++){const n=e[r],o=Number(n);let s=0,i="";const c=a.length-1;a.forEach((([t,e],r)=>{let n=(s+o*t).toString();const a=n.length;if(a>e&&r!==c){const t=-1*e;i=n.slice(t)+i,s=Number(n.slice(0,t))}else{const t=e-a;for(let e=0;e<t;e++)n="0"+n;s=0,i=n+i}})),i+="0".repeat(t),l.push(i),u.push([Array.from(i).map((t=>Number(t))),i.length])}const f=l.length,g=u[u.length-1][1]+f;let h="",p=0;for(let t=0;t<g;t++){let e=p;const r=Math.min(t,f-1);for(let n=0;n<=r;n++){const[r,o]=u[n],s=o-1-t;s>=0&&(e+=r[s])}e>=10?(e=e.toString(),h=e[e.length-1]+h,p=Number(e.slice(0,-1))):(h=e+h,p=0)}if(0===o)h=h.replace(/^0+/,"");else{const t=h.length-o;h=h.substring(0,t)+"."+h.substring(t),h=h.replace(/^0+/,""),h=h.replace(/\.?0+$/,""),"."===h[0]&&(h="0"+h)}return h}},411:t=>{t.exports=function(t,e){const r=t.length,n=e.length,o=t.indexOf("."),s=e.indexOf("."),i=-1===o?r:o,a=-1===s?n:s,c=i-a;let l=Math.max(i,a),u=Math.max(r-i-1,n-a-1),f=c<0?-1*c:0,g=c<=0?0:c,h=l+1+u-1,p="",d=0,m=h;if(u>0){for(;m>h-u;){let r=t[m-f]||"0",n=e[m-g]||"0";r-=d,d=0;let o=r-n;if(o<0)for(;o<0;)d++,o+=10;else d&&d--;""===p&&0===o||(p=o+p),m--}""!==p&&(p="."+p),m--}if(l>0){for(;m>0;){let r=t[m-f]||"0",n=e[m-g]||"0";r-=d,d=0;let o=r-n;if(o<0)for(;o<0;)d++,o+=10;else d&&d--;p=o+p,m--}const r=t[0-f]||"0",n=e[0-g]||"0";let o=Number(r)-(d>0?1:0)-Number(n);0!==o&&(p=o+p),p=p.replace(/^0+/,"")}return"."===p[0]&&(p="0"+p),p}},494:(t,e,r)=>{const n=r(585),o=r(875),s=r(232),i=r(90);t.exports=function(t,e){t=o(t),e=o(e);const r="-"!==t[0]!=("-"!==e[0])?"-":"";if(t=n(t),e=n(e),"<"===s(t,e)){const r=t;t=e,e=r}return r+i(t,e)}},360:t=>{const e=["5","6","7","8","9"];t.exports=function(t){"+"===t[0]&&(t=t.substring(1));const r=t.length;let n="";const o=t[t.length-1];if(e.includes(o)){let e;for(e=r-2;e>=0;e--){const r=t[e];if("."===r||"-"===r)continue;const o=Number(r)+1;if(10!==o){n=o+n;break}n="0"+n}e>0&&(n=t.substring(0,e)+n)}else n=t.substring(0,r-1);return"."===n[n.length-1]&&(n=n.substring(0,n.length-1)),n.indexOf(".")>-1&&(n=n.replace(/0+$/,"")),n}},42:(t,e,r)=>{const n=r(875),o=r(232),s=r(888),i=r(411);t.exports=function(t,e){t=n(t),e=n(e);const r="-"!==t[0],a="-"!==e[0];if(r){if(a){const r=o(t,e);return">"===r?i(t,e):"<"===r?"-"+i(e,t):"0"}return s(t,e.substring(1))}if(a)return"-"+s(t.substring(1),e);{t=t.substring(1),e=e.substring(1);const r=o(t,e);return">"===r?"-"+i(t,e):"<"===r?i(e,t):"0"}}},683:(t,e,r)=>{var n;const o=r(155);function s(t,{reproject:e}){if("function"!=typeof e)throw new Error("[reproject-geojson] you must specify a reproject function");if("FeatureCollection"===t.type)return{...t,features:t.features.map((t=>s(t,{reproject:e})))};if("Feature"===t.type)return{...t,geometry:s(t.geometry,{reproject:e})};if("LineString"===t.type)return{...t,coordinates:t.coordinates.map((t=>e(t)))};if("MultiLineString"===t.type)return{...t,coordinates:t.coordinates.map((t=>t.map((t=>e(t)))))};if("MultiPoint"===t.type)return{...t,coordinates:t.coordinates.map((t=>e(t)))};if("MultiPolygon"===t.type)return{...t,coordinates:t.coordinates.map((t=>t.map((t=>t.map((t=>e(t)))))))};if("Point"===t.type)return{...t,coordinates:e(t.coordinates)};if("Polygon"===t.type)return{...t,coordinates:t.coordinates.map((t=>t.map((t=>e(t)))))};if(Array.isArray(t)){const r=o(t);if(1===r)return e(t);if(2===r)return t.map((t=>e(t)));if(3===r)return t.map((t=>t.map((t=>e(t)))));if(4===r)return t.map((t=>t.map((t=>t.map((t=>e(t)))))))}return t}void 0===(n=function(){return s}.call(e,r,e,t))||(t.exports=n),t.exports=s,"object"==typeof window&&(window.reprojectGeoJSONPluggable=s),"object"==typeof self&&(self.reprojectGeoJSONPluggable=s)},905:(t,e,r)=>{var n;function o({segments:t,min:e=-1/0,max:r=1/0,debug:n=!1}){if(n&&console.log("[segflip] segs:",t),null==t||Array.isArray(t)&&0===t.length)return n&&console.log("[segflip] segments are empty so return the whole row flipped"),[[e,r]];const o=t.map((([t,e])=>[t-1,e+1])).flat();o.unshift(e),o.push(r),n&&console.log("flattened nums:",o);const s=[];for(let t=1;t<o.length;t+=2){const e=o[t-1],r=o[t];e>r||s.push([e,r])}return s}void 0===(n=function(){return o}.call(e,r,e,t))||(t.exports=n),t.exports=o,"object"==typeof window&&(window.segflip=o),"object"==typeof self&&(self.segflip=o)},895:t=>{function e({data:t,data_bbox:e,data_height:r,data_width:n,data_srs:o,debug:s=!1,geomask:i,mask:a,mask_srs:c,reproject:l,strategy:u="outside",edition:f}){if(!["inside","outside"].includes(u))throw new Error(`[geocanvas] strategy can be either "inside" or "outside". you provided "${u}"`);const{rows:g}=i[u]({raster_bbox:e,raster_height:r,raster_width:n,raster_srs:o,mask:a,mask_srs:c,reproject:l});g.forEach(((e,r)=>{if(e){const o=4*r*n;e.forEach((([e,r])=>{for(let n=e;n<=r;n++)t[o+4*n+3]=0}))}}))}t.exports={maskImageData:e,maskCanvas:function({canvas:t,canvas_bbox:r,canvas_srs:n,geomask:o,mask:s,mask_srs:i,reproject:a,strategy:c="outside",edition:l,debug:u=!1}){if(u&&console.log("[geocanvas] starting to mask canvas"),!["inside","outside"].includes(c))throw new Error(`[geocanvas] strategy can be either "inside" or "outside". you provided "${c}"`);const f=t.getContext("2d"),{height:g,width:h}=t;u&&console.log(`[geocanvas] canvas height is ${g} pixels`),u&&console.log(`[geocanvas] canvas width is ${h} pixels`);const p=f.getImageData(0,0,h,g);return e({data:p.data,data_bbox:r,data_height:g,data_srs:n,data_width:h,debug:u,geomask:o,mask:s,mask_srs:i,reproject:a,strategy:c}),u&&console.log("[geocanvas] image data after masking:",p),f.putImageData(p,0,0),u&&console.log("[geocanvas] put image data back"),t}}},317:(t,e,r)=>{var n;const o=r(869),s=r(895),i={maskImageData:function(t){return s.maskImageData({...t,edition:"lite",geomask:o})},maskCanvas:function(t){return s.maskCanvas({...t,edition:"lite",geomask:o})}};void 0===(n=function(){return i}.call(e,r,e,t))||(t.exports=n),t.exports=i,"object"==typeof self&&(self.geocanvas=i),"object"==typeof window&&(window.geocanvas=i)}},e={};!function r(n){var o=e[n];if(void 0!==o)return o.exports;var s=e[n]={exports:{}};return t[n](s,s.exports,r),s.exports}(317)})();
//# sourceMappingURL=geocanvas.lite.min.js.map