raster-marching-squares
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -1,1 +0,1 @@ | ||
!function(t,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports):"function"==typeof define&&define.amd?define(["exports"],o):o(t.rastertools={})}(this,function(t){"use strict";function o(t,o,e){return(t-o)/(e-o)}function e(t){for(var o=[],e=t.rows,r=t.cols,p=[],u=0;u<e;u++)for(var s=0;s<r;s++)if(void 0!==t.cells[u][s]&&t.cells[u][s].edges.length>0){var h=t.cells[u][s],l=(h.cval,function(t){if(t.edges.length>0){var o=t.edges[t.edges.length-1],e=t.cval_real;switch(o){case 0:return e&a?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 1:return e&c?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 2:return e&c?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 3:return e&b?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 4:return e&a?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 5:return e&c?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 6:return e&c?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 7:return e&b?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 8:return e&c?{p:[t.bottomright],x:0,y:1,o:1}:{p:[1,t.righttop],x:-1,y:0,o:1};case 9:return e&b?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 10:return e&b?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.righttop],x:-1,y:0,o:1};case 11:return e&f?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 12:return e&c?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 13:return e&b?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 14:return e&b?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 15:return e&f?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 16:return e&c?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 17:return e&f?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 18:return e&b?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 19:return e&f?{p:[t.bottomleft,0],x:0,y:1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 20:return e&f?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 21:return e&a?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.topright,1],x:0,y:-1,o:1};case 22:return e&f?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 23:return e&a?{p:[0,t.lefttop],x:1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};default:console.log("edge index out of range!"),console.log(t)}}return null}(h)),n=null,i=s,R=u;null!==l&&p.push([l.p[0]+i,l.p[1]+R]);do{if(null===(n=function(t,o,e,r){var p,u,s,h,l,n=t.cval;switch(o){case-1:switch(r){case 0:p=z[n],s=j[n],h=C[n],l=_[n];break;default:p=q[n],s=x[n],h=w[n],l=N[n]}break;case 1:switch(r){case 0:p=H[n],s=V[n],h=L[n],l=S[n];break;default:p=J[n],s=G[n],h=P[n],l=T[n]}break;default:switch(e){case-1:switch(r){case 0:p=K[n],s=g[n],h=m[n],l=v[n];break;default:p=Q[n],s=d[n],h=y[n],l=k[n]}break;case 1:switch(r){case 0:p=D[n],s=E[n],h=M[n],l=F[n];break;default:p=B[n],s=O[n],h=I[n],l=A[n]}}}{if(u=t.edges.indexOf(p),void 0===t.edges[u])return null;!function(t,o){delete t.edges[o];for(var e=o+1;e<t.edges.length;e++)t.edges[e-1]=t.edges[e];t.edges.pop()}(t,u)}switch(n=t.cval_real,p){case 0:n&a?(o=t.topleft,e=1):(o=1,e=t.righttop);break;case 1:n&c?(o=1,e=t.rightbottom):(o=t.topleft,e=1);break;case 2:n&c?(o=t.topleft,e=1):(o=t.bottomright,e=0);break;case 3:n&b?(o=t.bottomleft,e=0):(o=t.topleft,e=1);break;case 4:n&a?(o=t.topright,e=1):(o=1,e=t.righttop);break;case 5:n&c?(o=1,e=t.rightbottom):(o=t.topright,e=1);break;case 6:n&c?(o=t.topright,e=1):(o=t.bottomright,e=0);break;case 7:n&b?(o=t.bottomleft,e=0):(o=t.topright,e=1);break;case 8:n&c?(o=1,e=t.righttop):(o=t.bottomright,e=0);break;case 9:n&b?(o=t.bottomleft,e=0):(o=1,e=t.righttop);break;case 10:n&b?(o=1,e=t.righttop):(o=0,e=t.leftbottom);break;case 11:n&f?(o=0,e=t.lefttop):(o=1,e=t.righttop);break;case 12:n&c?(o=1,e=t.rightbottom):(o=t.bottomright,e=0);break;case 13:n&b?(o=t.bottomleft,e=0):(o=1,e=t.rightbottom);break;case 14:n&b?(o=1,e=t.rightbottom):(o=0,e=t.leftbottom);break;case 15:n&f?(o=0,e=t.lefttop):(o=1,e=t.rightbottom);break;case 16:n&c?(o=0,e=t.leftbottom):(o=t.bottomright,e=0);break;case 17:n&f?(o=0,e=t.lefttop):(o=t.bottomright,e=0);break;case 18:n&b?(o=t.bottomleft,e=0):(o=0,e=t.leftbottom);break;case 19:n&f?(o=0,e=t.lefttop):(o=t.bottomleft,e=0);break;case 20:n&f?(o=0,e=t.leftbottom):(o=t.topleft,e=1);break;case 21:n&a?(o=t.topright,e=1):(o=0,e=t.leftbottom);break;case 22:n&f?(o=0,e=t.lefttop):(o=t.topleft,e=1);break;case 23:n&a?(o=t.topright,e=1):(o=0,e=t.lefttop);break;default:return console.log("edge index out of range!"),console.log(t),null}void 0!==o&&void 0!==e&&void 0!==s&&void 0!==h&&void 0!==l||(console.log("undefined value!"),console.log(t),console.log(o+" "+e+" "+s+" "+h+" "+l));return{p:[o,e],x:s,y:h,o:l}}(t.cells[R][i],l.x,l.y,l.o)))break;if(p.push([n.p[0]+i,n.p[1]+R]),i+=n.x,R+=n.y,l=n,R<0||R>=e||i<0||i>=r||void 0===t.cells[R][i]){var U=function(t,o,e,r,p,u){var s=t.cells[e][o],h=s.cval_real,l=o+r,n=e+p,i=[],g=(t.rows,t.cols,!1);for(;!g;){if(void 0===t.cells[n]||void 0===t.cells[n][l])if(n-=p,l-=r,s=t.cells[n][l],h=s.cval_real,-1===p)if(0===u)if(h&b)i.push([l,n]),r=-1,p=0,u=0;else{if(!(h&c)){i.push([l+s.bottomright,n]),r=0,p=1,u=1,g=!0;break}i.push([l+1,n]),r=1,p=0,u=0}else{if(!(h&b)){if(h&c){i.push([l+s.bottomright,n]),r=0,p=1,u=1,g=!0;break}i.push([l+s.bottomleft,n]),r=0,p=1,u=0,g=!0;break}i.push([l,n]),r=-1,p=0,u=0}else if(1===p)if(0===u){if(!(h&a)){if(h&f){i.push([l+s.topleft,n+1]),r=0,p=-1,u=0,g=!0;break}i.push([l+s.topright,n+1]),r=0,p=-1,u=1,g=!0;break}i.push([l+1,n+1]),r=1,p=0,u=1}else i.push([l+1,n+1]),r=1,p=0,u=1;else if(-1===r)if(0===u){if(!(h&f)){if(h&b){i.push([l,n+s.leftbottom]),r=1,p=0,u=0,g=!0;break}i.push([l,n+s.lefttop]),r=1,p=0,u=1,g=!0;break}i.push([l,n+1]),r=0,p=1,u=0}else{if(!(h&f)){console.log("wtf");break}i.push([l,n+1]),r=0,p=1,u=0}else{if(1!==r){console.log("we came from nowhere!");break}if(0===u){if(!(h&c)){i.push([l+1,n+s.rightbottom]),r=-1,p=0,u=0,g=!0;break}i.push([l+1,n]),r=0,p=-1,u=1}else{if(!(h&c)){if(h&a){i.push([l+1,n+s.righttop]),r=-1,p=0,u=1;break}i.push([l+1,n+s.rightbottom]),r=-1,p=0,u=0,g=!0;break}i.push([l+1,n]),r=0,p=-1,u=1}}else if(s=t.cells[n][l],h=s.cval_real,-1===r)if(0===u)if(void 0!==t.cells[n-1]&&void 0!==t.cells[n-1][l])r=0,p=-1,u=1;else{if(!(h&b)){i.push([l+s.bottomright,n]),r=0,p=1,u=1,g=!0;break}i.push([l,n])}else{if(!(h&f)){console.log("found entry from top at "+l+","+n);break}console.log("proceeding in x-direction!")}else if(1===r){if(0===u){console.log("wtf");break}if(void 0!==t.cells[n+1]&&void 0!==t.cells[n+1][l])r=0,p=1,u=0;else{if(!(h&a)){i.push([l+s.topleft,n+1]),r=0,p=-1,u=0,g=!0;break}i.push([l+1,n+1]),r=1,p=0,u=1}}else if(-1===p){if(1!==u){console.log("wtf");break}if(void 0!==t.cells[n][l+1])r=1,p=0,u=1;else{if(!(h&c)){i.push([l+1,n+s.righttop]),r=-1,p=0,u=1,g=!0;break}i.push([l+1,n]),r=0,p=-1,u=1}}else{if(1!==p){console.log("where did we came from???");break}if(0!==u){console.log("wtf");break}if(void 0!==t.cells[n][l-1])r=-1,p=0,u=0;else{if(!(h&f)){i.push([l,n+s.leftbottom]),r=1,p=0,u=0,g=!0;break}i.push([l,n+1]),r=0,p=1,u=0}}if(l+=r,n+=p,l===o&&n===e)break}return{path:i,i:l,j:n,x:r,y:p,o:u}}(t,i-=n.x,R-=n.y,n.x,n.y,n.o);if(null===U)break;U.path.forEach(function(t){p.push(t)}),i=U.i,R=U.j,l=U}}while(void 0!==t.cells[R][i]&&t.cells[R][i].edges.length>0);o.push(p),p=[],t.cells[u][s].edges.length>0&&s--}return o}function r(t,o,e){return(t-o)/(e-o)}function p(t){return 0===t.cval||15==t.cval}function u(t){p(t)||5==t.cval||10==t.cval||(t.cval=15)}function s(t,o){return"top"===o?[t.top,1]:"bottom"===o?[t.bottom,0]:"right"===o?[1,t.right]:"left"===o?[0,t.left]:void 0}function h(t){var o=[],e=0;t.rows,t.cols;return t.cells.forEach(function(r,h){r.forEach(function(r,l){if(void 0!==r&&!function(t){return 5==t.cval||10==t.cval}(r)&&!p(r)){var n=function(t,o,e){var r,p,h=t.length,l=[],n=[0,0,1,1,0,0,0,0,-1,0,1,1,-1,0,-1,0],i=[0,-1,0,0,1,1,1,1,0,-1,0,0,0,-1,0,0],f=["none","bottom","right","right","top","top","top","top","left","bottom","right","right","left","bottom","left","none"],a=(t[o][e],t[o][e]),c=a.cval,b=["none","left","bottom","left","right","none","bottom","left","top","top","none","top","right","right","bottom","none"][c],g=s(a,b);l.push([e+g[0],o+g[1]]),g=s(a,b=f[c]),l.push([e+g[0],o+g[1]]),u(a);var m=e+n[c],v=o+i[c],d=c;for(;m>=0&&v>=0&&v<h&&(m!=e||v!=o)&&void 0!==(a=t[v][m]);){if(0===(c=a.cval)||15===c)return{path:l,info:"mergeable"};b=f[c],r=n[c],p=i[c],5!=c&&10!=c||(5==c?a.flipped?-1==i[d]?(b="left",r=-1,p=0):(b="right",r=1,p=0):-1==n[d]&&(b="bottom",r=0,p=-1):10==c&&(a.flipped?-1==n[d]?(b="top",r=0,p=1):(b="bottom",r=0,p=-1):1==i[d]&&(b="left",r=-1,p=0))),g=s(a,b),l.push([m+g[0],v+g[1]]),u(a),m+=r,v+=p,d=c}return{path:l,info:"closed"}}(t.cells,h,l),i=!1;if("mergeable"==n.info)for(var f=n.path[n.path.length-1][0],a=n.path[n.path.length-1][1],c=e-1;c>=0;c--)if(Math.abs(o[c][0][0]-f)<=1e-7&&Math.abs(o[c][0][1]-a)<=1e-7){for(var b=n.path.length-2;b>=0;--b)o[c].unshift(n.path[b]);i=!0;break}i||(o[e++]=n.path)}})}),o}var l=function(t,o,e,r){if(typeof o!=typeof new Array||6!=o.length)throw new Error("GeoTransform must be a 6 elements array");for(var p=i(t,e,r),u=0;u<p.length;u++)for(var s=0;s<p[u].length;s++){var h=n(p[u][s][0],p[u][s][1],o);p[u][s][0]=h[0],p[u][s][1]=h[1]}return p},n=function(t,o,e){return[e[0]+t*e[1]+o*e[2],e[3]+t*e[4]+o*e[5]]},i=function(t,o,r,p){var u={},s={successCallback:null,progressCallback:null,verbose:!1};p=p||{};for(var h=Object.keys(s),l=0;l<h.length;l++){var n=h[l],i=p[n];i=void 0!==i&&null!==i?i:s[n],u[n]=i}u.verbose&&console.log("computing isobands for ["+o+":"+(o+r)+"]");return e(Pt(t,o,r))},f=64,a=16,c=4,b=1,g=[],m=[],v=[],d=[],y=[],k=[],x=[],w=[],N=[],j=[],C=[],_=[],E=[],M=[],F=[],O=[],I=[],A=[],G=[],P=[],T=[],V=[],L=[],S=[];x[85]=j[85]=-1,w[85]=C[85]=0,N[85]=_[85]=1,G[85]=V[85]=1,P[85]=L[85]=0,T[85]=S[85]=1,g[85]=d[85]=0,m[85]=y[85]=-1,v[85]=F[85]=0,O[85]=E[85]=0,I[85]=M[85]=1,k[85]=A[85]=1,V[1]=V[169]=0,L[1]=L[169]=-1,S[1]=S[169]=0,E[1]=E[169]=-1,M[1]=M[169]=0,F[1]=F[169]=0,j[4]=j[166]=0,C[4]=C[166]=-1,_[4]=_[166]=1,O[4]=O[166]=1,I[4]=I[166]=0,A[4]=A[166]=0,x[16]=x[154]=0,w[16]=w[154]=1,N[16]=N[154]=1,d[16]=d[154]=1,y[16]=y[154]=0,k[16]=k[154]=1,G[64]=G[106]=0,P[64]=P[106]=1,T[64]=T[106]=0,g[64]=g[106]=-1,m[64]=m[106]=0,v[64]=v[106]=1,G[2]=G[168]=0,P[2]=P[168]=-1,T[2]=T[168]=1,V[2]=V[168]=0,L[2]=L[168]=-1,S[2]=S[168]=0,E[2]=E[168]=-1,M[2]=M[168]=0,F[2]=F[168]=0,O[2]=O[168]=-1,I[2]=I[168]=0,A[2]=A[168]=1,x[8]=x[162]=0,w[8]=w[162]=-1,N[8]=N[162]=0,j[8]=j[162]=0,C[8]=C[162]=-1,_[8]=_[162]=1,E[8]=E[162]=1,M[8]=M[162]=0,F[8]=F[162]=1,O[8]=O[162]=1,I[8]=I[162]=0,A[8]=A[162]=0,x[32]=x[138]=0,w[32]=w[138]=1,N[32]=N[138]=1,j[32]=j[138]=0,C[32]=C[138]=1,_[32]=_[138]=0,g[32]=g[138]=1,m[32]=m[138]=0,v[32]=v[138]=0,d[32]=d[138]=1,y[32]=y[138]=0,k[32]=k[138]=1,V[128]=V[42]=0,L[128]=L[42]=1,S[128]=S[42]=1,G[128]=G[42]=0,P[128]=P[42]=1,T[128]=T[42]=0,g[128]=g[42]=-1,m[128]=m[42]=0,v[128]=v[42]=1,d[128]=d[42]=-1,y[128]=y[42]=0,k[128]=k[42]=0,j[5]=j[165]=-1,C[5]=C[165]=0,_[5]=_[165]=0,V[5]=V[165]=1,L[5]=L[165]=0,S[5]=S[165]=0,O[20]=O[150]=0,I[20]=I[150]=1,A[20]=A[150]=1,d[20]=d[150]=0,y[20]=y[150]=-1,k[20]=k[150]=1,x[80]=x[90]=-1,w[80]=w[90]=0,N[80]=N[90]=1,G[80]=G[90]=1,P[80]=P[90]=0,T[80]=T[90]=1,E[65]=E[105]=0,M[65]=M[105]=1,F[65]=F[105]=0,g[65]=g[105]=0,m[65]=m[105]=-1,v[65]=v[105]=0,x[160]=x[10]=-1,w[160]=w[10]=0,N[160]=N[10]=1,j[160]=j[10]=-1,C[160]=C[10]=0,_[160]=_[10]=0,V[160]=V[10]=1,L[160]=L[10]=0,S[160]=S[10]=0,G[160]=G[10]=1,P[160]=P[10]=0,T[160]=T[10]=1,O[130]=O[40]=0,I[130]=I[40]=1,A[130]=A[40]=1,E[130]=E[40]=0,M[130]=M[40]=1,F[130]=F[40]=0,g[130]=g[40]=0,m[130]=m[40]=-1,v[130]=v[40]=0,d[130]=d[40]=0,y[130]=y[40]=-1,k[130]=k[40]=1,j[37]=j[133]=0,C[37]=C[133]=1,_[37]=_[133]=1,V[37]=V[133]=0,L[37]=L[133]=1,S[37]=S[133]=0,g[37]=g[133]=-1,m[37]=m[133]=0,v[37]=v[133]=0,d[37]=d[133]=1,y[37]=y[133]=0,k[37]=k[133]=0,O[148]=O[22]=-1,I[148]=I[22]=0,A[148]=A[22]=0,V[148]=V[22]=0,L[148]=L[22]=-1,S[148]=S[22]=1,G[148]=G[22]=0,P[148]=P[22]=1,T[148]=T[22]=1,d[148]=d[22]=-1,y[148]=y[22]=0,k[148]=k[22]=1,x[82]=x[88]=0,w[82]=w[88]=-1,N[82]=N[88]=1,O[82]=O[88]=1,I[82]=I[88]=0,A[82]=A[88]=1,E[82]=E[88]=-1,M[82]=M[88]=0,F[82]=F[88]=1,G[82]=G[88]=0,P[82]=P[88]=-1,T[82]=T[88]=0,x[73]=x[97]=0,w[73]=w[97]=1,N[73]=N[97]=0,j[73]=j[97]=0,C[73]=C[97]=-1,_[73]=_[97]=0,E[73]=E[97]=1,M[73]=M[97]=0,F[73]=F[97]=0,g[73]=g[97]=1,m[73]=m[97]=0,v[73]=v[97]=1,x[145]=x[25]=0,w[145]=w[25]=-1,N[145]=N[25]=0,E[145]=E[25]=1,M[145]=M[25]=0,F[145]=F[25]=1,V[145]=V[25]=0,L[145]=L[25]=1,S[145]=S[25]=1,d[145]=d[25]=-1,y[145]=y[25]=0,k[145]=k[25]=0,j[70]=j[100]=0,C[70]=C[100]=1,_[70]=_[100]=0,O[70]=O[100]=-1,I[70]=I[100]=0,A[70]=A[100]=1,G[70]=G[100]=0,P[70]=P[100]=-1,T[70]=T[100]=1,g[70]=g[100]=1,m[70]=m[100]=0,v[70]=v[100]=0,j[101]=j[69]=0,C[101]=C[69]=1,_[101]=_[69]=0,g[101]=g[69]=1,m[101]=m[69]=0,v[101]=v[69]=0,V[149]=V[21]=0,L[149]=L[21]=1,S[149]=S[21]=1,d[149]=d[21]=-1,y[149]=y[21]=0,k[149]=k[21]=0,O[86]=O[84]=-1,I[86]=I[84]=0,A[86]=A[84]=1,G[86]=G[84]=0,P[86]=P[84]=-1,T[86]=T[84]=1,x[89]=x[81]=0,w[89]=w[81]=-1,N[89]=N[81]=0,E[89]=E[81]=1,M[89]=M[81]=0,F[89]=F[81]=1,x[96]=x[74]=0,w[96]=w[74]=1,N[96]=N[74]=0,j[96]=j[74]=-1,C[96]=C[74]=0,_[96]=_[74]=1,G[96]=G[74]=1,P[96]=P[74]=0,T[96]=T[74]=0,g[96]=g[74]=1,m[96]=m[74]=0,v[96]=v[74]=1,x[24]=x[146]=0,w[24]=w[146]=-1,N[24]=N[146]=1,O[24]=O[146]=1,I[24]=I[146]=0,A[24]=A[146]=1,E[24]=E[146]=0,M[24]=M[146]=1,F[24]=F[146]=1,d[24]=d[146]=0,y[24]=y[146]=-1,k[24]=k[146]=0,j[6]=j[164]=-1,C[6]=C[164]=0,_[6]=_[164]=1,O[6]=O[164]=-1,I[6]=I[164]=0,A[6]=A[164]=0,V[6]=V[164]=0,L[6]=L[164]=-1,S[6]=S[164]=1,G[6]=G[164]=1,P[6]=P[164]=0,T[6]=T[164]=0,E[129]=E[41]=0,M[129]=M[41]=1,F[129]=F[41]=1,V[129]=V[41]=0,L[129]=L[41]=1,S[129]=S[41]=0,g[129]=g[41]=-1,m[129]=m[41]=0,v[129]=v[41]=0,d[129]=d[41]=0,y[129]=y[41]=-1,k[129]=k[41]=0,O[66]=O[104]=0,I[66]=I[104]=1,A[66]=A[104]=0,E[66]=E[104]=-1,M[66]=M[104]=0,F[66]=F[104]=1,G[66]=G[104]=0,P[66]=P[104]=-1,T[66]=T[104]=0,g[66]=g[104]=0,m[66]=m[104]=-1,v[66]=v[104]=1,x[144]=x[26]=-1,w[144]=w[26]=0,N[144]=N[26]=0,V[144]=V[26]=1,L[144]=L[26]=0,S[144]=S[26]=1,G[144]=G[26]=0,P[144]=P[26]=1,T[144]=T[26]=1,d[144]=d[26]=-1,y[144]=y[26]=0,k[144]=k[26]=1,j[36]=j[134]=0,C[36]=C[134]=1,_[36]=_[134]=1,O[36]=O[134]=0,I[36]=I[134]=1,A[36]=A[134]=0,g[36]=g[134]=0,m[36]=m[134]=-1,v[36]=v[134]=1,d[36]=d[134]=1,y[36]=y[134]=0,k[36]=k[134]=0,x[9]=x[161]=-1,w[9]=w[161]=0,N[9]=N[161]=0,j[9]=j[161]=0,C[9]=C[161]=-1,_[9]=_[161]=0,E[9]=E[161]=1,M[9]=M[161]=0,F[9]=F[161]=0,V[9]=V[161]=1,L[9]=L[161]=0,S[9]=S[161]=1,x[136]=0,w[136]=1,N[136]=1,j[136]=0,C[136]=1,_[136]=0,O[136]=-1,I[136]=0,A[136]=1,E[136]=-1,M[136]=0,F[136]=0,V[136]=0,L[136]=-1,S[136]=0,G[136]=0,P[136]=-1,T[136]=1,g[136]=1,m[136]=0,v[136]=0,d[136]=1,y[136]=0,k[136]=1,x[34]=0,w[34]=-1,N[34]=0,j[34]=0,C[34]=-1,_[34]=1,O[34]=1,I[34]=0,A[34]=0,E[34]=1,M[34]=0,F[34]=1,V[34]=0,L[34]=1,S[34]=1,G[34]=0,P[34]=1,T[34]=0,g[34]=-1,m[34]=0,v[34]=1,d[34]=-1,y[34]=0,k[34]=0,x[35]=0,w[35]=1,N[35]=1,j[35]=0,C[35]=-1,_[35]=1,O[35]=1,I[35]=0,A[35]=0,E[35]=-1,M[35]=0,F[35]=0,V[35]=0,L[35]=-1,S[35]=0,G[35]=0,P[35]=1,T[35]=0,g[35]=-1,m[35]=0,v[35]=1,d[35]=1,y[35]=0,k[35]=1,x[153]=0,w[153]=1,N[153]=1,E[153]=-1,M[153]=0,F[153]=0,V[153]=0,L[153]=-1,S[153]=0,d[153]=1,y[153]=0,k[153]=1,j[102]=0,C[102]=-1,_[102]=1,O[102]=1,I[102]=0,A[102]=0,G[102]=0,P[102]=1,T[102]=0,g[102]=-1,m[102]=0,v[102]=1,x[155]=0,w[155]=-1,N[155]=0,E[155]=1,M[155]=0,F[155]=1,V[155]=0,L[155]=1,S[155]=1,d[155]=-1,y[155]=0,k[155]=0,j[103]=0,C[103]=1,_[103]=0,O[103]=-1,I[103]=0,A[103]=1,G[103]=0,P[103]=-1,T[103]=1,g[103]=1,m[103]=0,v[103]=0,x[152]=0,w[152]=1,N[152]=1,O[152]=-1,I[152]=0,A[152]=1,E[152]=-1,M[152]=0,F[152]=0,V[152]=0,L[152]=-1,S[152]=0,G[152]=0,P[152]=-1,T[152]=1,d[152]=1,y[152]=0,k[152]=1,x[156]=0,w[156]=-1,N[156]=1,O[156]=1,I[156]=0,A[156]=1,E[156]=-1,M[156]=0,F[156]=0,V[156]=0,L[156]=-1,S[156]=0,G[156]=0,P[156]=1,T[156]=1,d[156]=-1,y[156]=0,k[156]=1,x[137]=0,w[137]=1,N[137]=1,j[137]=0,C[137]=1,_[137]=0,E[137]=-1,M[137]=0,F[137]=0,V[137]=0,L[137]=-1,S[137]=0,g[137]=1,m[137]=0,v[137]=0,d[137]=1,y[137]=0,k[137]=1,x[139]=0,w[139]=1,N[139]=1,j[139]=0,C[139]=-1,_[139]=0,E[139]=1,M[139]=0,F[139]=0,V[139]=0,L[139]=1,S[139]=0,g[139]=-1,m[139]=0,v[139]=0,d[139]=1,y[139]=0,k[139]=1,x[98]=0,w[98]=-1,N[98]=0,j[98]=0,C[98]=-1,_[98]=1,O[98]=1,I[98]=0,A[98]=0,E[98]=1,M[98]=0,F[98]=1,G[98]=0,P[98]=1,T[98]=0,g[98]=-1,m[98]=0,v[98]=1,x[99]=0,w[99]=1,N[99]=0,j[99]=0,C[99]=-1,_[99]=1,O[99]=1,I[99]=0,A[99]=0,E[99]=-1,M[99]=0,F[99]=1,G[99]=0,P[99]=-1,T[99]=0,g[99]=1,m[99]=0,v[99]=1,j[38]=0,C[38]=-1,_[38]=1,O[38]=1,I[38]=0,A[38]=0,V[38]=0,L[38]=1,S[38]=1,G[38]=0,P[38]=1,T[38]=0,g[38]=-1,m[38]=0,v[38]=1,d[38]=-1,y[38]=0,k[38]=0,j[39]=0,C[39]=1,_[39]=1,O[39]=-1,I[39]=0,A[39]=0,V[39]=0,L[39]=-1,S[39]=1,G[39]=0,P[39]=1,T[39]=0,g[39]=-1,m[39]=0,v[39]=1,d[39]=1,y[39]=0,k[39]=0;var q=[],z=[],B=[],D=[],H=[],J=[],K=[],Q=[];D[1]=H[1]=18,D[169]=H[169]=18,B[4]=z[4]=12,B[166]=z[166]=12,q[16]=Q[16]=4,q[154]=Q[154]=4,J[64]=K[64]=22,J[106]=K[106]=22,B[2]=J[2]=17,D[2]=H[2]=18,B[168]=J[168]=17,D[168]=H[168]=18,q[8]=D[8]=9,z[8]=B[8]=12,q[162]=D[162]=9,z[162]=B[162]=12,q[32]=Q[32]=4,z[32]=K[32]=1,q[138]=Q[138]=4,z[138]=K[138]=1,H[128]=Q[128]=21,J[128]=K[128]=22,H[42]=Q[42]=21,J[42]=K[42]=22,z[5]=H[5]=14,z[165]=H[165]=14,B[20]=Q[20]=6,B[150]=Q[150]=6,q[80]=J[80]=11,q[90]=J[90]=11,D[65]=K[65]=3,D[105]=K[105]=3,q[160]=J[160]=11,z[160]=H[160]=14,q[10]=J[10]=11,z[10]=H[10]=14,B[130]=Q[130]=6,D[130]=K[130]=3,B[40]=Q[40]=6,D[40]=K[40]=3,z[101]=K[101]=1,z[69]=K[69]=1,H[149]=Q[149]=21,H[21]=Q[21]=21,B[86]=J[86]=17,B[84]=J[84]=17,q[89]=D[89]=9,q[81]=D[81]=9,q[96]=K[96]=0,z[96]=J[96]=15,q[74]=K[74]=0,z[74]=J[74]=15,q[24]=B[24]=8,D[24]=Q[24]=7,q[146]=B[146]=8,D[146]=Q[146]=7,z[6]=J[6]=15,B[6]=H[6]=16,z[164]=J[164]=15,B[164]=H[164]=16,D[129]=Q[129]=7,H[129]=K[129]=20,D[41]=Q[41]=7,H[41]=K[41]=20,B[66]=K[66]=2,D[66]=J[66]=19,B[104]=K[104]=2,D[104]=J[104]=19,q[144]=H[144]=10,J[144]=Q[144]=23,q[26]=H[26]=10,J[26]=Q[26]=23,z[36]=Q[36]=5,B[36]=K[36]=2,z[134]=Q[134]=5,B[134]=K[134]=2,q[9]=H[9]=10,z[9]=D[9]=13,q[161]=H[161]=10,z[161]=D[161]=13,z[37]=Q[37]=5,H[37]=K[37]=20,z[133]=Q[133]=5,H[133]=K[133]=20,B[148]=H[148]=16,J[148]=Q[148]=23,B[22]=H[22]=16,J[22]=Q[22]=23,q[82]=B[82]=8,D[82]=J[82]=19,q[88]=B[88]=8,D[88]=J[88]=19,q[73]=K[73]=0,z[73]=D[73]=13,q[97]=K[97]=0,z[97]=D[97]=13,q[145]=D[145]=9,H[145]=Q[145]=21,q[25]=D[25]=9,H[25]=Q[25]=21,z[70]=K[70]=1,B[70]=J[70]=17,z[100]=K[100]=1,B[100]=J[100]=17,q[34]=D[34]=9,z[34]=B[34]=12,H[34]=Q[34]=21,J[34]=K[34]=22,q[136]=Q[136]=4,z[136]=K[136]=1,B[136]=J[136]=17,D[136]=H[136]=18,q[35]=Q[35]=4,z[35]=B[35]=12,D[35]=H[35]=18,J[35]=K[35]=22,q[153]=Q[153]=4,D[153]=H[153]=18,z[102]=B[102]=12,J[102]=K[102]=22,q[155]=D[155]=9,H[155]=Q[155]=23,z[103]=K[103]=1,B[103]=J[103]=17,q[152]=Q[152]=4,B[152]=J[152]=17,D[152]=H[152]=18,q[156]=B[156]=8,D[156]=H[156]=18,J[156]=Q[156]=23,q[137]=Q[137]=4,z[137]=K[137]=1,D[137]=H[137]=18,q[139]=Q[139]=4,z[139]=D[139]=13,H[139]=K[139]=20,q[98]=D[98]=9,z[98]=B[98]=12,J[98]=K[98]=22,q[99]=K[99]=0,z[99]=B[99]=12,D[99]=J[99]=19,z[38]=B[38]=12,H[38]=Q[38]=21,J[38]=K[38]=22,z[39]=Q[39]=5,B[39]=H[39]=16,J[39]=K[39]=22;var R=[];R[1]=R[169]=U,R[4]=R[166]=W,R[16]=R[154]=X,R[64]=R[106]=Y,R[168]=R[2]=Z,R[162]=R[8]=$,R[138]=R[32]=tt,R[42]=R[128]=ot,R[5]=R[165]=et,R[20]=R[150]=rt,R[80]=R[90]=pt,R[65]=R[105]=ut,R[160]=R[10]=st,R[130]=R[40]=ht,R[85]=lt,R[101]=R[69]=nt,R[149]=R[21]=it,R[86]=R[84]=ft,R[89]=R[81]=at,R[96]=R[74]=ct,R[24]=R[146]=bt,R[6]=R[164]=gt,R[129]=R[41]=mt,R[66]=R[104]=vt,R[144]=R[26]=dt,R[36]=R[134]=yt,R[9]=R[161]=kt,R[37]=R[133]=xt,R[148]=R[22]=wt,R[82]=R[88]=Nt,R[73]=R[97]=jt,R[145]=R[25]=Ct,R[70]=R[100]=_t,R[34]=function(t){return[ot(t),$(t)]},R[35]=Et,R[136]=function(t){return[tt(t),Z(t)]},R[153]=function(t){return[X(t),U(t)]},R[102]=function(t){return[W(t),Y(t)]},R[155]=Mt,R[103]=Ft,R[152]=function(t){return[X(t),Z(t)]},R[156]=Ot,R[137]=function(t){return[tt(t),U(t)]},R[139]=It,R[98]=function(t){return[$(t),Y(t)]},R[99]=At,R[38]=function(t){return[W(t),ot(t)]},R[39]=Gt;var U=function(t){return[[t.bottomleft,0],[0,0],[0,t.leftbottom]]},W=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0]]},X=function(t){return[[t.topright,1],[1,1],[1,t.righttop]]},Y=function(t){return[[0,t.lefttop],[0,1],[t.topleft,1]]},Z=function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop]]},$=function(t){return[[t.bottomright,0],[t.bottomleft,0],[1,t.righttop],[1,t.rightbottom]]},tt=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.topleft,1],[t.topright,1]]},ot=function(t){return[[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},et=function(t){return[[0,0],[0,t.leftbottom],[1,t.rightbottom],[1,0]]},rt=function(t){return[[1,0],[t.bottomright,0],[t.topright,1],[1,1]]},pt=function(t){return[[1,1],[1,t.righttop],[0,t.lefttop],[0,1]]},ut=function(t){return[[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]},st=function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.leftbottom],[0,t.lefttop]]},ht=function(t){return[[t.topleft,1],[t.topright,1],[t.bottomright,0],[t.bottomleft,0]]},lt=function(t){return[[0,0],[0,1],[1,1],[1,0]]},nt=function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,1],[t.topleft,1]]},it=function(t){return[[t.topright,1],[1,1],[1,0],[0,0],[0,t.leftbottom]]},ft=function(t){return[[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[1,1]]},at=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,1]]},ct=function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.lefttop],[0,1],[t.topleft,1]]},bt=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[t.topright,1]]},gt=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop]]},mt=function(t){return[[t.topright,1],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1]]},vt=function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]},dt=function(t){return[[1,1],[1,t.righttop],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},yt=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[t.topleft,1],[t.topright,1]]},kt=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom]]},xt=function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]},wt=function(t){return[[1,1],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},Nt=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1]]},jt=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]},Ct=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]},_t=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]},Et=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},Mt=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]},Ft=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]},Ot=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},It=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]},At=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]},Gt=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},Pt=function(t,e,r){for(var p=t.length-1,u=t[0].length-1,s={rows:p,cols:u,cells:[]},h=e+Math.abs(r),l=0;l<p;++l){s.cells[l]=[];for(var n=0;n<u;++n){var i=0,f=t[l+1][n],a=t[l+1][n+1],c=t[l][n+1],b=t[l][n];if(!(isNaN(f)||isNaN(a)||isNaN(c)||isNaN(b))){i|=f<e?0:f>h?128:64,i|=a<e?0:a>h?32:16,i|=c<e?0:c>h?8:4;var g=+(i|=b<e?0:b>h?2:1),m=0;if(17==i||18==i||33==i||34==i||38==i||68==i||72==i||98==i||102==i||132==i||136==i||137==i||152==i||153==i){var v=(f+a+c+b)/4;m=v>h?2:v<e?0:1,34===i?1===m?i=35:0===m&&(i=136):136===i?1===m?(i=35,m=4):0===m&&(i=34):17===i?1===m?(i=155,m=4):0===m&&(i=153):68===i?1===m?(i=103,m=4):0===m&&(i=102):153===i?1===m&&(i=155):102===i?1===m&&(i=103):152===i?m<2&&(i=156,m=1):137===i?m<2&&(i=139,m=1):98===i?m<2&&(i=99,m=1):38===i?m<2&&(i=39,m=1):18===i?m>0?(i=156,m=4):i=152:33===i?m>0?(i=139,m=4):i=137:72===i?m>0?(i=99,m=4):i=98:132===i&&(m>0?(i=39,m=4):i=38)}if(0!=i&&170!=i){var d,y,k,x,w,N,j,C;d=y=k=x=w=N=j=C=.5;var _=[];1===i?(k=1-o(e,c,b),C=1-o(e,f,b),_.push(D[i])):169===i?(k=o(h,b,c),C=o(h,b,f),_.push(D[i])):4===i?(N=1-o(e,a,c),x=o(e,b,c),_.push(z[i])):166===i?(N=o(h,c,a),x=1-o(h,c,b),_.push(z[i])):16===i?(w=o(e,c,a),y=o(e,f,a),_.push(q[i])):154===i?(w=1-o(h,a,c),y=1-o(h,a,f),_.push(q[i])):64===i?(j=o(e,b,f),d=1-o(e,a,f),_.push(J[i])):106===i?(j=1-o(h,f,b),d=o(h,f,a),_.push(J[i])):168===i?(x=o(h,b,c),k=o(e,b,c),C=o(e,b,f),j=o(h,b,f),_.push(B[i]),_.push(D[i])):2===i?(x=1-o(e,c,b),k=1-o(h,c,b),C=1-o(h,f,b),j=1-o(e,f,b),_.push(B[i]),_.push(D[i])):162===i?(w=o(h,c,a),N=o(e,c,a),x=1-o(e,c,b),k=1-o(h,c,b),_.push(B[i]),_.push(D[i])):8===i?(w=1-o(e,a,c),N=1-o(h,a,c),x=o(h,b,c),k=o(e,b,c),_.push(q[i]),_.push(z[i])):138===i?(w=1-o(e,a,c),N=1-o(h,a,c),d=1-o(h,a,f),y=1-o(e,a,f),_.push(q[i]),_.push(z[i])):32===i?(w=o(h,c,a),N=o(e,c,a),d=o(e,f,a),y=o(h,f,a),_.push(q[i]),_.push(z[i])):42===i?(C=1-o(h,f,b),j=1-o(e,f,b),d=o(e,f,a),y=o(h,f,a),_.push(H[i]),_.push(J[i])):128===i&&(C=o(e,b,f),j=o(h,b,f),d=1-o(h,a,f),y=1-o(e,a,f),_.push(H[i]),_.push(J[i])),5===i?(N=1-o(e,a,c),C=1-o(e,f,b),_.push(z[i])):165===i?(N=o(h,c,a),C=o(h,b,f),_.push(z[i])):20===i?(x=o(e,b,c),y=o(e,f,a),_.push(B[i])):150===i?(x=1-o(h,c,b),y=1-o(h,a,f),_.push(B[i])):80===i?(w=o(e,c,a),j=o(e,b,f),_.push(q[i])):90===i?(w=1-o(h,a,c),j=1-o(h,f,b),_.push(q[i])):65===i?(k=1-o(e,c,b),d=1-o(e,a,f),_.push(D[i])):105===i?(k=o(h,b,c),d=o(h,f,a),_.push(D[i])):160===i?(w=o(h,c,a),N=o(e,c,a),C=o(e,b,f),j=o(h,b,f),_.push(q[i]),_.push(z[i])):10===i?(w=1-o(e,a,c),N=1-o(h,a,c),C=1-o(h,f,b),j=1-o(e,f,b),_.push(q[i]),_.push(z[i])):130===i?(x=1-o(e,c,b),k=1-o(h,c,b),d=1-o(h,a,f),y=1-o(e,a,f),_.push(B[i]),_.push(D[i])):40===i?(x=o(h,b,c),k=o(e,b,c),d=o(e,f,a),y=o(h,f,a),_.push(B[i]),_.push(D[i])):101===i?(N=o(h,c,a),d=o(h,f,a),_.push(z[i])):69===i?(N=1-o(e,a,c),d=1-o(e,a,f),_.push(z[i])):149===i?(C=o(h,b,f),y=1-o(h,a,f),_.push(H[i])):21===i?(C=1-o(e,f,b),y=o(e,f,a),_.push(H[i])):86===i?(x=1-o(h,c,b),j=1-o(h,f,b),_.push(B[i])):84===i?(x=o(e,b,c),j=o(e,b,f),_.push(B[i])):89===i?(w=1-o(h,a,c),k=o(h,b,c),_.push(D[i])):81===i?(w=o(e,c,a),k=1-o(e,c,b),_.push(D[i])):96===i?(w=o(h,c,a),N=o(e,c,a),j=o(e,b,f),d=o(h,f,a),_.push(q[i]),_.push(z[i])):74===i?(w=1-o(e,a,c),N=1-o(h,a,c),j=1-o(h,f,b),d=1-o(e,a,f),_.push(q[i]),_.push(z[i])):24===i?(w=1-o(h,a,c),x=o(h,b,c),k=o(e,b,c),y=o(e,f,a),_.push(q[i]),_.push(D[i])):146===i?(w=o(e,c,a),x=1-o(e,c,b),k=1-o(h,c,b),y=1-o(h,a,f),_.push(q[i]),_.push(D[i])):6===i?(N=1-o(e,a,c),x=1-o(h,c,b),C=1-o(h,f,b),j=1-o(e,f,b),_.push(z[i]),_.push(B[i])):164===i?(N=o(h,c,a),x=o(e,b,c),C=o(e,b,f),j=o(h,b,f),_.push(z[i]),_.push(B[i])):129===i?(k=1-o(e,c,b),C=o(h,b,f),d=1-o(h,a,f),y=1-o(e,a,f),_.push(D[i]),_.push(H[i])):41===i?(k=o(h,b,c),C=1-o(e,f,b),d=o(e,f,a),y=o(h,f,a),_.push(D[i]),_.push(H[i])):66===i?(x=1-o(e,c,b),k=1-o(h,c,b),j=1-o(h,f,b),d=1-o(e,a,f),_.push(B[i]),_.push(D[i])):104===i?(x=o(h,b,c),k=o(e,b,c),j=o(e,b,f),d=o(h,f,a),_.push(D[i]),_.push(K[i])):144===i?(w=o(e,c,a),C=o(e,b,f),j=o(h,b,f),y=1-o(h,a,f),_.push(q[i]),_.push(J[i])):26===i?(w=1-o(h,a,c),C=1-o(h,f,b),j=1-o(e,f,b),y=o(e,f,a),_.push(q[i]),_.push(J[i])):36===i?(N=o(h,c,a),x=o(e,b,c),d=o(e,f,a),y=o(h,f,a),_.push(z[i]),_.push(B[i])):134===i?(N=1-o(e,a,c),x=1-o(h,c,b),d=1-o(h,a,f),y=1-o(e,a,f),_.push(z[i]),_.push(B[i])):9===i?(w=1-o(e,a,c),N=1-o(h,a,c),k=o(h,b,c),C=1-o(e,f,b),_.push(q[i]),_.push(z[i])):161===i?(w=o(h,c,a),N=o(e,c,a),k=1-o(e,c,b),C=o(h,b,f),_.push(q[i]),_.push(z[i])):37===i?(N=o(h,c,a),C=1-o(e,f,b),d=o(e,f,a),y=o(h,f,a),_.push(z[i]),_.push(H[i])):133===i?(N=1-o(e,a,c),C=o(h,b,f),d=1-o(h,a,f),y=1-o(e,a,f),_.push(z[i]),_.push(H[i])):148===i?(x=o(e,b,c),C=o(e,b,f),j=o(h,b,f),y=1-o(h,a,f),_.push(B[i]),_.push(J[i])):22===i?(x=1-o(h,c,b),C=1-o(h,f,b),j=1-o(e,f,b),y=o(e,f,a),_.push(B[i]),_.push(J[i])):82===i?(w=o(e,c,a),x=1-o(e,c,b),k=1-o(h,c,b),j=1-o(h,f,b),_.push(q[i]),_.push(D[i])):88===i?(w=1-o(h,a,c),x=o(h,b,c),k=o(e,b,c),j=o(e,b,f),_.push(q[i]),_.push(D[i])):73===i?(w=1-o(e,a,c),N=1-o(h,a,c),k=o(h,b,c),d=1-o(e,a,f),_.push(q[i]),_.push(z[i])):97===i?(w=o(h,c,a),N=o(e,c,a),k=1-o(e,c,b),d=o(h,f,a),_.push(q[i]),_.push(z[i])):145===i?(w=o(e,c,a),k=1-o(e,c,b),C=o(h,b,f),y=1-o(h,a,f),_.push(q[i]),_.push(H[i])):25===i?(w=1-o(h,a,c),k=o(h,b,c),C=1-o(e,f,b),y=o(e,f,a),_.push(q[i]),_.push(H[i])):70===i?(N=1-o(e,a,c),x=1-o(h,c,b),j=1-o(h,f,b),d=1-o(e,a,f),_.push(z[i]),_.push(B[i])):100===i?(N=o(h,c,a),x=o(e,b,c),j=o(e,b,f),d=o(h,f,a),_.push(z[i]),_.push(B[i])):34===i?(0===m?(w=1-o(e,a,c),N=1-o(h,a,c),x=o(h,b,c),k=o(e,b,c),C=o(e,b,f),j=o(h,b,f),d=1-o(h,a,f),y=1-o(e,a,f)):(w=o(h,c,a),N=o(e,c,a),x=1-o(e,c,b),k=1-o(h,c,b),C=1-o(h,f,b),j=1-o(e,f,b),d=o(e,f,a),y=o(h,f,a)),_.push(q[i]),_.push(z[i]),_.push(H[i]),_.push(J[i])):35===i?(4===m?(w=1-o(e,a,c),N=1-o(h,a,c),x=o(h,b,c),k=o(e,b,c),C=o(e,b,f),j=o(h,b,f),d=1-o(h,a,f),y=1-o(e,a,f)):(w=o(h,c,a),N=o(e,c,a),x=1-o(e,c,b),k=1-o(h,c,b),C=1-o(h,f,b),j=1-o(e,f,b),d=o(e,f,a),y=o(h,f,a)),_.push(q[i]),_.push(z[i]),_.push(D[i]),_.push(J[i])):136===i?(0===m?(w=o(h,c,a),N=o(e,c,a),x=1-o(e,c,b),k=1-o(h,c,b),C=1-o(h,f,b),j=1-o(e,f,b),d=o(e,f,a),y=o(h,f,a)):(w=1-o(e,a,c),N=1-o(h,a,c),x=o(h,b,c),k=o(e,b,c),C=o(e,b,f),j=o(h,b,f),d=1-o(h,a,f),y=1-o(e,a,f)),_.push(q[i]),_.push(z[i]),_.push(H[i]),_.push(J[i])):153===i?(0===m?(w=o(e,c,a),k=1-o(e,c,b),C=1-o(e,f,b),y=o(e,f,a)):(w=1-o(h,a,c),k=o(h,b,c),C=o(h,b,f),y=1-o(h,a,f)),_.push(q[i]),_.push(D[i])):102===i?(0===m?(N=1-o(e,a,c),x=o(e,b,c),j=o(e,b,f),d=1-o(e,a,f)):(N=o(h,c,a),x=1-o(h,c,b),j=1-o(h,f,b),d=o(h,f,a)),_.push(z[i]),_.push(J[i])):155===i?(4===m?(w=o(e,c,a),k=1-o(e,c,b),C=1-o(e,f,b),y=o(e,f,a)):(w=1-o(h,a,c),k=o(h,b,c),C=o(h,b,f),y=1-o(h,a,f)),_.push(q[i]),_.push(H[i])):103===i?(4===m?(N=1-o(e,a,c),x=o(e,b,c),j=o(e,b,f),d=1-o(e,a,f)):(N=o(h,c,a),x=1-o(h,c,b),j=1-o(h,f,b),d=o(h,f,a)),_.push(z[i]),_.push(B[i])):152===i?(0===m?(w=o(e,c,a),x=1-o(e,c,b),k=1-o(h,c,b),C=1-o(h,f,b),j=1-o(e,f,b),y=o(e,f,a)):(w=1-o(h,a,c),x=o(h,b,c),k=o(e,b,c),C=o(e,b,f),j=o(h,b,f),y=1-o(h,a,f)),_.push(q[i]),_.push(B[i]),_.push(D[i])):156===i?(4===m?(w=o(e,c,a),x=1-o(e,c,b),k=1-o(h,c,b),C=1-o(h,f,b),j=1-o(e,f,b),y=o(e,f,a)):(w=1-o(h,a,c),x=o(h,b,c),k=o(e,b,c),C=o(e,b,f),j=o(h,b,f),y=1-o(h,a,f)),_.push(q[i]),_.push(D[i]),_.push(J[i])):137===i?(0===m?(w=o(h,c,a),N=o(e,c,a),k=1-o(e,c,b),C=1-o(e,f,b),d=o(e,f,a),y=o(h,f,a)):(w=1-o(e,a,c),N=1-o(h,a,c),k=o(h,b,c),C=o(h,b,f),d=1-o(h,a,f),y=1-o(e,a,f)),_.push(q[i]),_.push(z[i]),_.push(D[i])):139===i?(4===m?(w=o(h,c,a),N=o(e,c,a),k=1-o(e,c,b),C=1-o(e,f,b),d=o(e,f,a),y=o(h,f,a)):(w=1-o(e,a,c),N=1-o(h,a,c),k=o(h,b,c),C=o(h,b,f),d=1-o(h,a,f),y=1-o(e,a,f)),_.push(q[i]),_.push(z[i]),_.push(H[i])):98===i?(0===m?(w=1-o(e,a,c),N=1-o(h,a,c),x=o(h,b,c),k=o(e,b,c),j=o(e,b,f),d=1-o(e,a,f)):(w=o(h,c,a),N=o(e,c,a),x=1-o(e,c,b),k=1-o(h,c,b),j=1-o(h,f,b),d=o(h,f,a)),_.push(q[i]),_.push(z[i]),_.push(J[i])):99===i?(4===m?(w=1-o(e,a,c),N=1-o(h,a,c),x=o(h,b,c),k=o(e,b,c),j=o(e,b,f),d=1-o(e,a,f)):(w=o(h,c,a),N=o(e,c,a),x=1-o(e,c,b),k=1-o(h,c,b),j=1-o(h,f,b),d=o(h,f,a)),_.push(q[i]),_.push(z[i]),_.push(D[i])):38===i?(0===m?(N=1-o(e,a,c),x=o(e,b,c),C=o(e,b,f),j=o(h,b,f),d=1-o(h,a,f),y=1-o(e,a,f)):(N=o(h,c,a),x=1-o(h,c,b),C=1-o(h,f,b),j=1-o(e,f,b),d=o(e,f,a),y=o(h,f,a)),_.push(z[i]),_.push(H[i]),_.push(J[i])):39===i?(4===m?(N=1-o(e,a,c),x=o(e,b,c),C=o(e,b,f),j=o(h,b,f),d=1-o(h,a,f),y=1-o(e,a,f)):(N=o(h,c,a),x=1-o(h,c,b),C=1-o(h,f,b),j=1-o(e,f,b),d=o(e,f,a),y=o(h,f,a)),_.push(z[i]),_.push(B[i]),_.push(J[i])):85===i&&(w=1,N=0,x=1,k=0,C=0,j=1,d=0,y=1),(d<0||d>1||y<0||y>1||w<0||w>1||x<0||x>1||C<0||C>1||j<0||j>1)&&console.log(i+" "+g+" "+f+","+a+","+c+","+b+" "+m+" "+d+" "+y+" "+w+" "+N+" "+x+" "+k+" "+C+" "+j),s.cells[l][n]={cval:i,cval_real:g,flipped:m,topleft:d,topright:y,righttop:w,rightbottom:N,bottomright:x,bottomleft:k,leftbottom:C,lefttop:j,edges:_}}}}}return s},Tt=function(t,o,e){if(typeof o!=typeof new Array||6!=o.length)throw new Error("GeoTransform must be a 6 elements array");for(var r=Lt(t,e),p=0;p<r.length;p++)for(var u=0;u<r[p].length;u++){var s=Vt(r[p][u][0],r[p][u][1],o);r[p][u][0]=s[0],r[p][u][1]=s[1]}return r},Vt=function(t,o,e){return[e[0]+t*e[1]+o*e[2],e[3]+t*e[4]+o*e[5]]},Lt=function(t,o,e){var p={successCallback:null,progressCallback:null,verbose:!1},u={};e=e||{};for(var s=Object.keys(p),l=0;l<s.length;l++){var n=s[l],i=e[n];i=void 0!==i&&null!==i?i:p[n],u[n]=i}u.verbose&&console.log("computing isocontour for "+o);var f=h(function(t,o){for(var e=t.length-1,p=t[0].length-1,u={rows:e,cols:p,cells:[]},s=0;s<e;++s){u.cells[s]=[];for(var h=0;h<p;++h){var l=0,n=t[s+1][h],i=t[s+1][h+1],f=t[s][h+1],a=t[s][h];if(!(isNaN(n)||isNaN(i)||isNaN(f)||isNaN(a))){l|=n>=o?8:0,l|=i>=o?4:0,l|=f>=o?2:0;var c=!1;if(5==(l|=a>=o?1:0)||10==l){var b=(n+i+f+a)/4;5==l&&b<o?(l=10,c=!0):10==l&&b<o&&(l=5,c=!0)}if(0!==l&&15!==l){var g,m,v,d;g=m=v=d=.5,1==l?(v=1-r(o,n,a),m=1-r(o,f,a)):2==l?(m=r(o,a,f),d=1-r(o,i,f)):3==l?(v=1-r(o,n,a),d=1-r(o,i,f)):4==l?(g=r(o,n,i),d=r(o,f,i)):5==l?(g=r(o,n,i),d=r(o,f,i),m=1-r(o,f,a),v=1-r(o,n,a)):6==l?(m=r(o,a,f),g=r(o,n,i)):7==l?(v=1-r(o,n,a),g=r(o,n,i)):8==l?(v=r(o,a,n),g=1-r(o,i,n)):9==l?(m=1-r(o,f,a),g=1-r(o,i,n)):10==l?(g=1-r(o,i,n),d=1-r(o,i,f),m=r(o,a,f),v=r(o,a,n)):11==l?(g=1-r(o,i,n),d=1-r(o,i,f)):12==l?(v=r(o,a,n),d=r(o,f,i)):13==l?(m=1-r(o,f,a),d=r(o,f,i)):14==l?(v=r(o,a,n),m=r(o,a,f)):console.log("Illegal cval detected: "+l),u.cells[s][h]={cval:l,flipped:c,top:g,right:d,bottom:m,left:v}}}}}return u}(t,o));return"function"==typeof u.successCallback&&u.successCallback(f),f};t.isoband=i,t.projectedIsoband=l,t.isobands=function(t,o,e){for(var r={type:"FeatureCollection",features:[]},p=1;p<e.length;p++){for(var u=e[p-1],s=e[p],h=l(t,o,u,s-u),n=0;n<h.length;n++)h[n].reverse();r.features.push({type:"Feature",geometry:{type:"Polygon",coordinates:h},properties:[{lowerValue:u,upperValue:s}]})}return r},t.isoline=Lt,t.projectedIsoline=Tt,t.isolines=function(t,o,e){for(var r={type:"FeatureCollection",features:[]},p=0;p<e.length;p++){var u=e[p],s=Tt(t,o,u);r.features.push({type:"Feature",geometry:{type:"MultiLineString",coordinates:s},properties:[{value:u}]})}return r},Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports):"function"==typeof define&&define.amd?define(["exports"],o):o((t=t||self).rastertools={})}(this,function(t){"use strict";var n=function(t,o,e,r){if(typeof o!=typeof new Array||6!=o.length)throw new Error("GeoTransform must be a 6 elements array");for(var p=i(t,e,r),u=0;u<p.length;u++)for(var s=0;s<p[u].length;s++){var h=l(p[u][s][0],p[u][s][1],o);p[u][s][0]=h[0],p[u][s][1]=h[1]}return p},l=function(t,o,e){return[e[0]+t*e[1]+o*e[2],e[3]+t*e[4]+o*e[5]]},i=function(t,o,e,r){var p={},u={successCallback:null,progressCallback:null,verbose:!1};r=r||{};for(var s=Object.keys(u),h=0;h<s.length;h++){var l=s[h],n=r[l];n=null!=n?n:u[l],p[l]=n}return p.verbose&&console.log("computing isobands for ["+o+":"+(o+e)+"]"),function(t){for(var o=[],e=t.rows,r=t.cols,p=[],u=0;u<e;u++)for(var s=0;s<r;s++)if(void 0!==t.cells[u][s]&&0<t.cells[u][s].edges.length){var h=t.cells[u][s],l=(h.cval,Ot(h)),n=null,i=s,f=u;null!==l&&p.push([l.p[0]+i,l.p[1]+f]);do{if(null===(n=It(t.cells[f][i],l.x,l.y,l.o)))break;if(p.push([n.p[0]+i,n.p[1]+f]),i+=n.x,f+=n.y,l=n,f<0||e<=f||i<0||r<=i||void 0===t.cells[f][i]){i-=n.x,f-=n.y;var a=Ft(t,i,f,n.x,n.y,n.o);if(null===a)break;a.path.forEach(function(t){p.push(t)}),i=a.i,f=a.j,l=a}}while(void 0!==t.cells[f][i]&&0<t.cells[f][i].edges.length);o.push(p),p=[],0<t.cells[u][s].edges.length&&s--}return o}(Mt(t,o,e))},a=64,c=16,b=4,g=1,f=[],m=[],v=[],d=[],y=[],k=[],x=[],w=[],N=[],j=[],C=[],_=[],E=[],M=[],F=[],O=[],I=[],A=[],G=[],P=[],T=[],V=[],L=[],S=[];x[85]=j[85]=-1,w[85]=C[85]=0,N[85]=_[85]=1,G[85]=V[85]=1,P[85]=L[85]=0,T[85]=S[85]=1,f[85]=d[85]=0,m[85]=y[85]=-1,v[85]=F[85]=0,O[85]=E[85]=0,I[85]=M[85]=1,k[85]=A[85]=1,V[1]=V[169]=0,L[1]=L[169]=-1,S[1]=S[169]=0,E[1]=E[169]=-1,M[1]=M[169]=0,F[1]=F[169]=0,j[4]=j[166]=0,C[4]=C[166]=-1,_[4]=_[166]=1,O[4]=O[166]=1,I[4]=I[166]=0,A[4]=A[166]=0,x[16]=x[154]=0,w[16]=w[154]=1,N[16]=N[154]=1,d[16]=d[154]=1,y[16]=y[154]=0,k[16]=k[154]=1,G[64]=G[106]=0,P[64]=P[106]=1,T[64]=T[106]=0,f[64]=f[106]=-1,m[64]=m[106]=0,v[64]=v[106]=1,G[2]=G[168]=0,P[2]=P[168]=-1,T[2]=T[168]=1,V[2]=V[168]=0,L[2]=L[168]=-1,S[2]=S[168]=0,E[2]=E[168]=-1,M[2]=M[168]=0,F[2]=F[168]=0,O[2]=O[168]=-1,I[2]=I[168]=0,A[2]=A[168]=1,x[8]=x[162]=0,w[8]=w[162]=-1,N[8]=N[162]=0,j[8]=j[162]=0,C[8]=C[162]=-1,_[8]=_[162]=1,E[8]=E[162]=1,M[8]=M[162]=0,F[8]=F[162]=1,O[8]=O[162]=1,I[8]=I[162]=0,A[8]=A[162]=0,x[32]=x[138]=0,w[32]=w[138]=1,N[32]=N[138]=1,j[32]=j[138]=0,C[32]=C[138]=1,_[32]=_[138]=0,f[32]=f[138]=1,m[32]=m[138]=0,v[32]=v[138]=0,d[32]=d[138]=1,y[32]=y[138]=0,k[32]=k[138]=1,V[128]=V[42]=0,L[128]=L[42]=1,S[128]=S[42]=1,G[128]=G[42]=0,P[128]=P[42]=1,T[128]=T[42]=0,f[128]=f[42]=-1,m[128]=m[42]=0,v[128]=v[42]=1,d[128]=d[42]=-1,y[128]=y[42]=0,k[128]=k[42]=0,j[5]=j[165]=-1,C[5]=C[165]=0,_[5]=_[165]=0,V[5]=V[165]=1,L[5]=L[165]=0,S[5]=S[165]=0,O[20]=O[150]=0,I[20]=I[150]=1,A[20]=A[150]=1,d[20]=d[150]=0,y[20]=y[150]=-1,k[20]=k[150]=1,x[80]=x[90]=-1,w[80]=w[90]=0,N[80]=N[90]=1,G[80]=G[90]=1,P[80]=P[90]=0,T[80]=T[90]=1,E[65]=E[105]=0,M[65]=M[105]=1,F[65]=F[105]=0,f[65]=f[105]=0,m[65]=m[105]=-1,v[65]=v[105]=0,x[160]=x[10]=-1,w[160]=w[10]=0,N[160]=N[10]=1,j[160]=j[10]=-1,C[160]=C[10]=0,_[160]=_[10]=0,V[160]=V[10]=1,L[160]=L[10]=0,S[160]=S[10]=0,G[160]=G[10]=1,P[160]=P[10]=0,T[160]=T[10]=1,O[130]=O[40]=0,I[130]=I[40]=1,A[130]=A[40]=1,E[130]=E[40]=0,M[130]=M[40]=1,F[130]=F[40]=0,f[130]=f[40]=0,m[130]=m[40]=-1,v[130]=v[40]=0,d[130]=d[40]=0,y[130]=y[40]=-1,k[130]=k[40]=1,j[37]=j[133]=0,C[37]=C[133]=1,_[37]=_[133]=1,V[37]=V[133]=0,L[37]=L[133]=1,S[37]=S[133]=0,f[37]=f[133]=-1,m[37]=m[133]=0,v[37]=v[133]=0,d[37]=d[133]=1,y[37]=y[133]=0,k[37]=k[133]=0,O[148]=O[22]=-1,I[148]=I[22]=0,A[148]=A[22]=0,V[148]=V[22]=0,L[148]=L[22]=-1,S[148]=S[22]=1,G[148]=G[22]=0,P[148]=P[22]=1,T[148]=T[22]=1,d[148]=d[22]=-1,y[148]=y[22]=0,k[148]=k[22]=1,x[82]=x[88]=0,w[82]=w[88]=-1,N[82]=N[88]=1,O[82]=O[88]=1,I[82]=I[88]=0,A[82]=A[88]=1,E[82]=E[88]=-1,M[82]=M[88]=0,F[82]=F[88]=1,G[82]=G[88]=0,P[82]=P[88]=-1,T[82]=T[88]=0,x[73]=x[97]=0,w[73]=w[97]=1,N[73]=N[97]=0,j[73]=j[97]=0,C[73]=C[97]=-1,_[73]=_[97]=0,E[73]=E[97]=1,M[73]=M[97]=0,F[73]=F[97]=0,f[73]=f[97]=1,m[73]=m[97]=0,v[73]=v[97]=1,x[145]=x[25]=0,w[145]=w[25]=-1,N[145]=N[25]=0,E[145]=E[25]=1,M[145]=M[25]=0,F[145]=F[25]=1,V[145]=V[25]=0,L[145]=L[25]=1,S[145]=S[25]=1,d[145]=d[25]=-1,y[145]=y[25]=0,k[145]=k[25]=0,j[70]=j[100]=0,C[70]=C[100]=1,_[70]=_[100]=0,O[70]=O[100]=-1,I[70]=I[100]=0,A[70]=A[100]=1,G[70]=G[100]=0,P[70]=P[100]=-1,T[70]=T[100]=1,f[70]=f[100]=1,m[70]=m[100]=0,v[70]=v[100]=0,j[101]=j[69]=0,C[101]=C[69]=1,_[101]=_[69]=0,f[101]=f[69]=1,m[101]=m[69]=0,v[101]=v[69]=0,V[149]=V[21]=0,L[149]=L[21]=1,S[149]=S[21]=1,d[149]=d[21]=-1,y[149]=y[21]=0,k[149]=k[21]=0,O[86]=O[84]=-1,I[86]=I[84]=0,A[86]=A[84]=1,G[86]=G[84]=0,P[86]=P[84]=-1,T[86]=T[84]=1,x[89]=x[81]=0,w[89]=w[81]=-1,N[89]=N[81]=0,E[89]=E[81]=1,M[89]=M[81]=0,F[89]=F[81]=1,x[96]=x[74]=0,w[96]=w[74]=1,N[96]=N[74]=0,j[96]=j[74]=-1,C[96]=C[74]=0,_[96]=_[74]=1,G[96]=G[74]=1,P[96]=P[74]=0,T[96]=T[74]=0,f[96]=f[74]=1,m[96]=m[74]=0,v[96]=v[74]=1,x[24]=x[146]=0,w[24]=w[146]=-1,N[24]=N[146]=1,O[24]=O[146]=1,I[24]=I[146]=0,A[24]=A[146]=1,E[24]=E[146]=0,M[24]=M[146]=1,F[24]=F[146]=1,d[24]=d[146]=0,y[24]=y[146]=-1,k[24]=k[146]=0,j[6]=j[164]=-1,C[6]=C[164]=0,_[6]=_[164]=1,O[6]=O[164]=-1,I[6]=I[164]=0,A[6]=A[164]=0,V[6]=V[164]=0,L[6]=L[164]=-1,S[6]=S[164]=1,G[6]=G[164]=1,P[6]=P[164]=0,T[6]=T[164]=0,E[129]=E[41]=0,M[129]=M[41]=1,F[129]=F[41]=1,V[129]=V[41]=0,L[129]=L[41]=1,S[129]=S[41]=0,f[129]=f[41]=-1,m[129]=m[41]=0,v[129]=v[41]=0,d[129]=d[41]=0,y[129]=y[41]=-1,k[129]=k[41]=0,O[66]=O[104]=0,I[66]=I[104]=1,A[66]=A[104]=0,E[66]=E[104]=-1,M[66]=M[104]=0,F[66]=F[104]=1,G[66]=G[104]=0,P[66]=P[104]=-1,T[66]=T[104]=0,f[66]=f[104]=0,m[66]=m[104]=-1,v[66]=v[104]=1,x[144]=x[26]=-1,w[144]=w[26]=0,N[144]=N[26]=0,V[144]=V[26]=1,L[144]=L[26]=0,S[144]=S[26]=1,G[144]=G[26]=0,P[144]=P[26]=1,T[144]=T[26]=1,d[144]=d[26]=-1,y[144]=y[26]=0,k[144]=k[26]=1,j[36]=j[134]=0,C[36]=C[134]=1,_[36]=_[134]=1,O[36]=O[134]=0,I[36]=I[134]=1,A[36]=A[134]=0,f[36]=f[134]=0,m[36]=m[134]=-1,v[36]=v[134]=1,d[36]=d[134]=1,y[36]=y[134]=0,k[36]=k[134]=0,x[9]=x[161]=-1,w[9]=w[161]=0,N[9]=N[161]=0,j[9]=j[161]=0,C[9]=C[161]=-1,_[9]=_[161]=0,E[9]=E[161]=1,M[9]=M[161]=0,F[9]=F[161]=0,V[9]=V[161]=1,L[9]=L[161]=0,S[9]=S[161]=1,x[136]=0,w[136]=1,N[136]=1,j[136]=0,C[136]=1,_[136]=0,O[136]=-1,I[136]=0,A[136]=1,E[136]=-1,M[136]=0,F[136]=0,V[136]=0,L[136]=-1,S[136]=0,G[136]=0,P[136]=-1,T[136]=1,f[136]=1,m[136]=0,v[136]=0,d[136]=1,y[136]=0,k[136]=1,x[34]=0,w[34]=-1,N[34]=0,j[34]=0,C[34]=-1,_[34]=1,O[34]=1,I[34]=0,A[34]=0,E[34]=1,M[34]=0,F[34]=1,V[34]=0,L[34]=1,S[34]=1,G[34]=0,P[34]=1,T[34]=0,f[34]=-1,m[34]=0,v[34]=1,d[34]=-1,y[34]=0,k[34]=0,x[35]=0,w[35]=1,N[35]=1,j[35]=0,C[35]=-1,_[35]=1,O[35]=1,I[35]=0,A[35]=0,E[35]=-1,M[35]=0,F[35]=0,V[35]=0,L[35]=-1,S[35]=0,G[35]=0,P[35]=1,T[35]=0,f[35]=-1,m[35]=0,v[35]=1,d[35]=1,y[35]=0,k[35]=1,x[153]=0,w[153]=1,N[153]=1,E[153]=-1,M[153]=0,F[153]=0,V[153]=0,L[153]=-1,S[153]=0,d[153]=1,y[153]=0,k[153]=1,j[102]=0,C[102]=-1,_[102]=1,O[102]=1,I[102]=0,A[102]=0,G[102]=0,P[102]=1,T[102]=0,f[102]=-1,m[102]=0,v[102]=1,x[155]=0,w[155]=-1,N[155]=0,E[155]=1,M[155]=0,F[155]=1,V[155]=0,L[155]=1,S[155]=1,d[155]=-1,y[155]=0,k[155]=0,j[103]=0,C[103]=1,_[103]=0,O[103]=-1,I[103]=0,A[103]=1,G[103]=0,P[103]=-1,T[103]=1,f[103]=1,m[103]=0,v[103]=0,x[152]=0,w[152]=1,N[152]=1,O[152]=-1,I[152]=0,A[152]=1,E[152]=-1,M[152]=0,F[152]=0,V[152]=0,L[152]=-1,S[152]=0,G[152]=0,P[152]=-1,T[152]=1,d[152]=1,y[152]=0,k[152]=1,x[156]=0,w[156]=-1,N[156]=1,O[156]=1,I[156]=0,A[156]=1,E[156]=-1,M[156]=0,F[156]=0,V[156]=0,L[156]=-1,S[156]=0,G[156]=0,P[156]=1,T[156]=1,d[156]=-1,y[156]=0,k[156]=1,x[137]=0,w[137]=1,N[137]=1,j[137]=0,C[137]=1,_[137]=0,E[137]=-1,M[137]=0,F[137]=0,V[137]=0,L[137]=-1,S[137]=0,f[137]=1,m[137]=0,v[137]=0,d[137]=1,y[137]=0,k[137]=1,x[139]=0,w[139]=1,N[139]=1,j[139]=0,C[139]=-1,_[139]=0,E[139]=1,M[139]=0,F[139]=0,V[139]=0,L[139]=1,S[139]=0,f[139]=-1,m[139]=0,v[139]=0,d[139]=1,y[139]=0,k[139]=1,x[98]=0,w[98]=-1,N[98]=0,j[98]=0,C[98]=-1,_[98]=1,O[98]=1,I[98]=0,A[98]=0,E[98]=1,M[98]=0,F[98]=1,G[98]=0,P[98]=1,T[98]=0,f[98]=-1,m[98]=0,v[98]=1,x[99]=0,w[99]=1,N[99]=0,j[99]=0,C[99]=-1,_[99]=1,O[99]=1,I[99]=0,A[99]=0,E[99]=-1,M[99]=0,F[99]=1,G[99]=0,P[99]=-1,T[99]=0,f[99]=1,m[99]=0,v[99]=1,j[38]=0,C[38]=-1,_[38]=1,O[38]=1,I[38]=0,A[38]=0,V[38]=0,L[38]=1,S[38]=1,G[38]=0,P[38]=1,T[38]=0,f[38]=-1,m[38]=0,v[38]=1,d[38]=-1,y[38]=0,k[38]=0,j[39]=0,C[39]=1,_[39]=1,O[39]=-1,I[39]=0,A[39]=0,V[39]=0,L[39]=-1,S[39]=1,G[39]=0,P[39]=1,T[39]=0,f[39]=-1,m[39]=0,v[39]=1,d[39]=1,y[39]=0,k[39]=0;var q=[],z=[],B=[],D=[],H=[],J=[],K=[],Q=[];D[1]=H[1]=18,D[169]=H[169]=18,B[4]=z[4]=12,B[166]=z[166]=12,q[16]=Q[16]=4,q[154]=Q[154]=4,J[64]=K[64]=22,J[106]=K[106]=22,B[2]=J[2]=17,D[2]=H[2]=18,B[168]=J[168]=17,D[168]=H[168]=18,q[8]=D[8]=9,z[8]=B[8]=12,q[162]=D[162]=9,z[162]=B[162]=12,q[32]=Q[32]=4,z[32]=K[32]=1,q[138]=Q[138]=4,z[138]=K[138]=1,H[128]=Q[128]=21,J[128]=K[128]=22,H[42]=Q[42]=21,J[42]=K[42]=22,z[5]=H[5]=14,z[165]=H[165]=14,B[20]=Q[20]=6,B[150]=Q[150]=6,q[80]=J[80]=11,q[90]=J[90]=11,D[65]=K[65]=3,D[105]=K[105]=3,q[160]=J[160]=11,z[160]=H[160]=14,q[10]=J[10]=11,z[10]=H[10]=14,B[130]=Q[130]=6,D[130]=K[130]=3,B[40]=Q[40]=6,D[40]=K[40]=3,z[101]=K[101]=1,z[69]=K[69]=1,H[149]=Q[149]=21,H[21]=Q[21]=21,B[86]=J[86]=17,B[84]=J[84]=17,q[89]=D[89]=9,q[81]=D[81]=9,q[96]=K[96]=0,z[96]=J[96]=15,q[74]=K[74]=0,z[74]=J[74]=15,q[24]=B[24]=8,D[24]=Q[24]=7,q[146]=B[146]=8,D[146]=Q[146]=7,z[6]=J[6]=15,B[6]=H[6]=16,z[164]=J[164]=15,B[164]=H[164]=16,D[129]=Q[129]=7,H[129]=K[129]=20,D[41]=Q[41]=7,H[41]=K[41]=20,B[66]=K[66]=2,D[66]=J[66]=19,B[104]=K[104]=2,D[104]=J[104]=19,q[144]=H[144]=10,J[144]=Q[144]=23,q[26]=H[26]=10,J[26]=Q[26]=23,z[36]=Q[36]=5,B[36]=K[36]=2,z[134]=Q[134]=5,B[134]=K[134]=2,q[9]=H[9]=10,z[9]=D[9]=13,q[161]=H[161]=10,z[161]=D[161]=13,z[37]=Q[37]=5,H[37]=K[37]=20,z[133]=Q[133]=5,H[133]=K[133]=20,B[148]=H[148]=16,J[148]=Q[148]=23,B[22]=H[22]=16,J[22]=Q[22]=23,q[82]=B[82]=8,D[82]=J[82]=19,q[88]=B[88]=8,D[88]=J[88]=19,q[73]=K[73]=0,z[73]=D[73]=13,q[97]=K[97]=0,z[97]=D[97]=13,q[145]=D[145]=9,H[145]=Q[145]=21,q[25]=D[25]=9,H[25]=Q[25]=21,z[70]=K[70]=1,B[70]=J[70]=17,z[100]=K[100]=1,B[100]=J[100]=17,q[34]=D[34]=9,z[34]=B[34]=12,H[34]=Q[34]=21,J[34]=K[34]=22,q[136]=Q[136]=4,z[136]=K[136]=1,B[136]=J[136]=17,D[136]=H[136]=18,q[35]=Q[35]=4,z[35]=B[35]=12,D[35]=H[35]=18,J[35]=K[35]=22,q[153]=Q[153]=4,D[153]=H[153]=18,z[102]=B[102]=12,J[102]=K[102]=22,q[155]=D[155]=9,H[155]=Q[155]=23,z[103]=K[103]=1,B[103]=J[103]=17,q[152]=Q[152]=4,B[152]=J[152]=17,D[152]=H[152]=18,q[156]=B[156]=8,D[156]=H[156]=18,J[156]=Q[156]=23,q[137]=Q[137]=4,z[137]=K[137]=1,D[137]=H[137]=18,q[139]=Q[139]=4,z[139]=D[139]=13,H[139]=K[139]=20,q[98]=D[98]=9,z[98]=B[98]=12,J[98]=K[98]=22,q[99]=K[99]=0,z[99]=B[99]=12,D[99]=J[99]=19,z[38]=B[38]=12,H[38]=Q[38]=21,J[38]=K[38]=22,z[39]=Q[39]=5,B[39]=H[39]=16,J[39]=K[39]=22;var o=[];o[1]=o[169]=e,o[4]=o[166]=r,o[16]=o[154]=p,o[64]=o[106]=u,o[168]=o[2]=s,o[162]=o[8]=h,o[138]=o[32]=R,o[42]=o[128]=U,o[5]=o[165]=W,o[20]=o[150]=X,o[80]=o[90]=Y,o[65]=o[105]=Z,o[160]=o[10]=$,o[130]=o[40]=tt,o[85]=ot,o[101]=o[69]=et,o[149]=o[21]=rt,o[86]=o[84]=pt,o[89]=o[81]=ut,o[96]=o[74]=st,o[24]=o[146]=ht,o[6]=o[164]=lt,o[129]=o[41]=nt,o[66]=o[104]=it,o[144]=o[26]=ft,o[36]=o[134]=at,o[9]=o[161]=ct,o[37]=o[133]=bt,o[148]=o[22]=gt,o[82]=o[88]=mt,o[73]=o[97]=vt,o[145]=o[25]=dt,o[70]=o[100]=yt,o[34]=function(t){return[U(t),h(t)]},o[35]=kt,o[136]=function(t){return[R(t),s(t)]},o[153]=function(t){return[p(t),e(t)]},o[102]=function(t){return[r(t),u(t)]},o[155]=xt,o[103]=wt,o[152]=function(t){return[p(t),s(t)]},o[156]=Nt,o[137]=function(t){return[R(t),e(t)]},o[139]=jt,o[98]=function(t){return[h(t),u(t)]},o[99]=Ct,o[38]=function(t){return[r(t),U(t)]},o[39]=_t;var e=function(t){return[[t.bottomleft,0],[0,0],[0,t.leftbottom]]},r=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0]]},p=function(t){return[[t.topright,1],[1,1],[1,t.righttop]]},u=function(t){return[[0,t.lefttop],[0,1],[t.topleft,1]]},s=function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop]]},h=function(t){return[[t.bottomright,0],[t.bottomleft,0],[1,t.righttop],[1,t.rightbottom]]},R=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.topleft,1],[t.topright,1]]},U=function(t){return[[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},W=function(t){return[[0,0],[0,t.leftbottom],[1,t.rightbottom],[1,0]]},X=function(t){return[[1,0],[t.bottomright,0],[t.topright,1],[1,1]]},Y=function(t){return[[1,1],[1,t.righttop],[0,t.lefttop],[0,1]]},Z=function(t){return[[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]},$=function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.leftbottom],[0,t.lefttop]]},tt=function(t){return[[t.topleft,1],[t.topright,1],[t.bottomright,0],[t.bottomleft,0]]},ot=function(t){return[[0,0],[0,1],[1,1],[1,0]]},et=function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,1],[t.topleft,1]]},rt=function(t){return[[t.topright,1],[1,1],[1,0],[0,0],[0,t.leftbottom]]},pt=function(t){return[[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[1,1]]},ut=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,1]]},st=function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.lefttop],[0,1],[t.topleft,1]]},ht=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[t.topright,1]]},lt=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop]]},nt=function(t){return[[t.topright,1],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1]]},it=function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]},ft=function(t){return[[1,1],[1,t.righttop],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},at=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[t.topleft,1],[t.topright,1]]},ct=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom]]},bt=function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]},gt=function(t){return[[1,1],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},mt=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1]]},vt=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]},dt=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]},yt=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]},kt=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},xt=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]},wt=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]},Nt=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},jt=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]},Ct=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]},_t=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]};function Et(t,o,e){return(t-o)/(e-o)}var Mt=function(t,o,e){for(var r=t.length-1,p=t[0].length-1,u={rows:r,cols:p,cells:[]},s=o+Math.abs(e),h=0;h<r;++h){u.cells[h]=[];for(var l=0;l<p;++l){var n=0,i=t[h+1][l],f=t[h+1][l+1],a=t[h][l+1],c=t[h][l];if(!(isNaN(i)||isNaN(f)||isNaN(a)||isNaN(c))){n|=i<o?0:s<i?128:64,n|=f<o?0:s<f?32:16,n|=a<o?0:s<a?8:4;var b=+(n|=c<o?0:s<c?2:1),g=0;if(17==n||18==n||33==n||34==n||38==n||68==n||72==n||98==n||102==n||132==n||136==n||137==n||152==n||153==n){var m=(i+f+a+c)/4;g=s<m?2:m<o?0:1,34===n?1===g?n=35:0===g&&(n=136):136===n?1===g?(n=35,g=4):0===g&&(n=34):17===n?1===g?(n=155,g=4):0===g&&(n=153):68===n?1===g?(n=103,g=4):0===g&&(n=102):153===n?1===g&&(n=155):102===n?1===g&&(n=103):152===n?g<2&&(n=156,g=1):137===n?g<2&&(n=139,g=1):98===n?g<2&&(n=99,g=1):38===n?g<2&&(n=39,g=1):18===n?0<g?(n=156,g=4):n=152:33===n?0<g?(n=139,g=4):n=137:72===n?0<g?(n=99,g=4):n=98:132===n&&(0<g?(n=39,g=4):n=38)}if(0!=n&&170!=n){var v,d,y,k,x,w,N,j;v=d=y=k=x=w=N=j=.5;var C=[];1===n?(y=1-Et(o,a,c),j=1-Et(o,i,c),C.push(D[n])):169===n?(y=Et(s,c,a),j=Et(s,c,i),C.push(D[n])):4===n?(w=1-Et(o,f,a),k=Et(o,c,a),C.push(z[n])):166===n?(w=Et(s,a,f),k=1-Et(s,a,c),C.push(z[n])):16===n?(x=Et(o,a,f),d=Et(o,i,f),C.push(q[n])):154===n?(x=1-Et(s,f,a),d=1-Et(s,f,i),C.push(q[n])):64===n?(N=Et(o,c,i),v=1-Et(o,f,i),C.push(J[n])):106===n?(N=1-Et(s,i,c),v=Et(s,i,f),C.push(J[n])):168===n?(k=Et(s,c,a),y=Et(o,c,a),j=Et(o,c,i),N=Et(s,c,i),C.push(B[n]),C.push(D[n])):2===n?(k=1-Et(o,a,c),y=1-Et(s,a,c),j=1-Et(s,i,c),N=1-Et(o,i,c),C.push(B[n]),C.push(D[n])):162===n?(x=Et(s,a,f),w=Et(o,a,f),k=1-Et(o,a,c),y=1-Et(s,a,c),C.push(B[n]),C.push(D[n])):8===n?(x=1-Et(o,f,a),w=1-Et(s,f,a),k=Et(s,c,a),y=Et(o,c,a),C.push(q[n]),C.push(z[n])):138===n?(x=1-Et(o,f,a),w=1-Et(s,f,a),v=1-Et(s,f,i),d=1-Et(o,f,i),C.push(q[n]),C.push(z[n])):32===n?(x=Et(s,a,f),w=Et(o,a,f),v=Et(o,i,f),d=Et(s,i,f),C.push(q[n]),C.push(z[n])):42===n?(j=1-Et(s,i,c),N=1-Et(o,i,c),v=Et(o,i,f),d=Et(s,i,f),C.push(H[n]),C.push(J[n])):128===n&&(j=Et(o,c,i),N=Et(s,c,i),v=1-Et(s,f,i),d=1-Et(o,f,i),C.push(H[n]),C.push(J[n])),5===n?(w=1-Et(o,f,a),j=1-Et(o,i,c),C.push(z[n])):165===n?(w=Et(s,a,f),j=Et(s,c,i),C.push(z[n])):20===n?(k=Et(o,c,a),d=Et(o,i,f),C.push(B[n])):150===n?(k=1-Et(s,a,c),d=1-Et(s,f,i),C.push(B[n])):80===n?(x=Et(o,a,f),N=Et(o,c,i),C.push(q[n])):90===n?(x=1-Et(s,f,a),N=1-Et(s,i,c),C.push(q[n])):65===n?(y=1-Et(o,a,c),v=1-Et(o,f,i),C.push(D[n])):105===n?(y=Et(s,c,a),v=Et(s,i,f),C.push(D[n])):160===n?(x=Et(s,a,f),w=Et(o,a,f),j=Et(o,c,i),N=Et(s,c,i),C.push(q[n]),C.push(z[n])):10===n?(x=1-Et(o,f,a),w=1-Et(s,f,a),j=1-Et(s,i,c),N=1-Et(o,i,c),C.push(q[n]),C.push(z[n])):130===n?(k=1-Et(o,a,c),y=1-Et(s,a,c),v=1-Et(s,f,i),d=1-Et(o,f,i),C.push(B[n]),C.push(D[n])):40===n?(k=Et(s,c,a),y=Et(o,c,a),v=Et(o,i,f),d=Et(s,i,f),C.push(B[n]),C.push(D[n])):101===n?(w=Et(s,a,f),v=Et(s,i,f),C.push(z[n])):69===n?(w=1-Et(o,f,a),v=1-Et(o,f,i),C.push(z[n])):149===n?(j=Et(s,c,i),d=1-Et(s,f,i),C.push(H[n])):21===n?(j=1-Et(o,i,c),d=Et(o,i,f),C.push(H[n])):86===n?(k=1-Et(s,a,c),N=1-Et(s,i,c),C.push(B[n])):84===n?(k=Et(o,c,a),N=Et(o,c,i),C.push(B[n])):89===n?(x=1-Et(s,f,a),y=Et(s,c,a),C.push(D[n])):81===n?(x=Et(o,a,f),y=1-Et(o,a,c),C.push(D[n])):96===n?(x=Et(s,a,f),w=Et(o,a,f),N=Et(o,c,i),v=Et(s,i,f),C.push(q[n]),C.push(z[n])):74===n?(x=1-Et(o,f,a),w=1-Et(s,f,a),N=1-Et(s,i,c),v=1-Et(o,f,i),C.push(q[n]),C.push(z[n])):24===n?(x=1-Et(s,f,a),k=Et(s,c,a),y=Et(o,c,a),d=Et(o,i,f),C.push(q[n]),C.push(D[n])):146===n?(x=Et(o,a,f),k=1-Et(o,a,c),y=1-Et(s,a,c),d=1-Et(s,f,i),C.push(q[n]),C.push(D[n])):6===n?(w=1-Et(o,f,a),k=1-Et(s,a,c),j=1-Et(s,i,c),N=1-Et(o,i,c),C.push(z[n]),C.push(B[n])):164===n?(w=Et(s,a,f),k=Et(o,c,a),j=Et(o,c,i),N=Et(s,c,i),C.push(z[n]),C.push(B[n])):129===n?(y=1-Et(o,a,c),j=Et(s,c,i),v=1-Et(s,f,i),d=1-Et(o,f,i),C.push(D[n]),C.push(H[n])):41===n?(y=Et(s,c,a),j=1-Et(o,i,c),v=Et(o,i,f),d=Et(s,i,f),C.push(D[n]),C.push(H[n])):66===n?(k=1-Et(o,a,c),y=1-Et(s,a,c),N=1-Et(s,i,c),v=1-Et(o,f,i),C.push(B[n]),C.push(D[n])):104===n?(k=Et(s,c,a),y=Et(o,c,a),N=Et(o,c,i),v=Et(s,i,f),C.push(D[n]),C.push(K[n])):144===n?(x=Et(o,a,f),j=Et(o,c,i),N=Et(s,c,i),d=1-Et(s,f,i),C.push(q[n]),C.push(J[n])):26===n?(x=1-Et(s,f,a),j=1-Et(s,i,c),N=1-Et(o,i,c),d=Et(o,i,f),C.push(q[n]),C.push(J[n])):36===n?(w=Et(s,a,f),k=Et(o,c,a),v=Et(o,i,f),d=Et(s,i,f),C.push(z[n]),C.push(B[n])):134===n?(w=1-Et(o,f,a),k=1-Et(s,a,c),v=1-Et(s,f,i),d=1-Et(o,f,i),C.push(z[n]),C.push(B[n])):9===n?(x=1-Et(o,f,a),w=1-Et(s,f,a),y=Et(s,c,a),j=1-Et(o,i,c),C.push(q[n]),C.push(z[n])):161===n?(x=Et(s,a,f),w=Et(o,a,f),y=1-Et(o,a,c),j=Et(s,c,i),C.push(q[n]),C.push(z[n])):37===n?(w=Et(s,a,f),j=1-Et(o,i,c),v=Et(o,i,f),d=Et(s,i,f),C.push(z[n]),C.push(H[n])):133===n?(w=1-Et(o,f,a),j=Et(s,c,i),v=1-Et(s,f,i),d=1-Et(o,f,i),C.push(z[n]),C.push(H[n])):148===n?(k=Et(o,c,a),j=Et(o,c,i),N=Et(s,c,i),d=1-Et(s,f,i),C.push(B[n]),C.push(J[n])):22===n?(k=1-Et(s,a,c),j=1-Et(s,i,c),N=1-Et(o,i,c),d=Et(o,i,f),C.push(B[n]),C.push(J[n])):82===n?(x=Et(o,a,f),k=1-Et(o,a,c),y=1-Et(s,a,c),N=1-Et(s,i,c),C.push(q[n]),C.push(D[n])):88===n?(x=1-Et(s,f,a),k=Et(s,c,a),y=Et(o,c,a),N=Et(o,c,i),C.push(q[n]),C.push(D[n])):73===n?(x=1-Et(o,f,a),w=1-Et(s,f,a),y=Et(s,c,a),v=1-Et(o,f,i),C.push(q[n]),C.push(z[n])):97===n?(x=Et(s,a,f),w=Et(o,a,f),y=1-Et(o,a,c),v=Et(s,i,f),C.push(q[n]),C.push(z[n])):145===n?(x=Et(o,a,f),y=1-Et(o,a,c),j=Et(s,c,i),d=1-Et(s,f,i),C.push(q[n]),C.push(H[n])):25===n?(x=1-Et(s,f,a),y=Et(s,c,a),j=1-Et(o,i,c),d=Et(o,i,f),C.push(q[n]),C.push(H[n])):70===n?(w=1-Et(o,f,a),k=1-Et(s,a,c),N=1-Et(s,i,c),v=1-Et(o,f,i),C.push(z[n]),C.push(B[n])):100===n?(w=Et(s,a,f),k=Et(o,c,a),N=Et(o,c,i),v=Et(s,i,f),C.push(z[n]),C.push(B[n])):34===n?(d=0===g?(x=1-Et(o,f,a),w=1-Et(s,f,a),k=Et(s,c,a),y=Et(o,c,a),j=Et(o,c,i),N=Et(s,c,i),v=1-Et(s,f,i),1-Et(o,f,i)):(x=Et(s,a,f),w=Et(o,a,f),k=1-Et(o,a,c),y=1-Et(s,a,c),j=1-Et(s,i,c),N=1-Et(o,i,c),v=Et(o,i,f),Et(s,i,f)),C.push(q[n]),C.push(z[n]),C.push(H[n]),C.push(J[n])):35===n?(d=4===g?(x=1-Et(o,f,a),w=1-Et(s,f,a),k=Et(s,c,a),y=Et(o,c,a),j=Et(o,c,i),N=Et(s,c,i),v=1-Et(s,f,i),1-Et(o,f,i)):(x=Et(s,a,f),w=Et(o,a,f),k=1-Et(o,a,c),y=1-Et(s,a,c),j=1-Et(s,i,c),N=1-Et(o,i,c),v=Et(o,i,f),Et(s,i,f)),C.push(q[n]),C.push(z[n]),C.push(D[n]),C.push(J[n])):136===n?(d=0===g?(x=Et(s,a,f),w=Et(o,a,f),k=1-Et(o,a,c),y=1-Et(s,a,c),j=1-Et(s,i,c),N=1-Et(o,i,c),v=Et(o,i,f),Et(s,i,f)):(x=1-Et(o,f,a),w=1-Et(s,f,a),k=Et(s,c,a),y=Et(o,c,a),j=Et(o,c,i),N=Et(s,c,i),v=1-Et(s,f,i),1-Et(o,f,i)),C.push(q[n]),C.push(z[n]),C.push(H[n]),C.push(J[n])):153===n?(d=0===g?(x=Et(o,a,f),y=1-Et(o,a,c),j=1-Et(o,i,c),Et(o,i,f)):(x=1-Et(s,f,a),y=Et(s,c,a),j=Et(s,c,i),1-Et(s,f,i)),C.push(q[n]),C.push(D[n])):102===n?(v=0===g?(w=1-Et(o,f,a),k=Et(o,c,a),N=Et(o,c,i),1-Et(o,f,i)):(w=Et(s,a,f),k=1-Et(s,a,c),N=1-Et(s,i,c),Et(s,i,f)),C.push(z[n]),C.push(J[n])):155===n?(d=4===g?(x=Et(o,a,f),y=1-Et(o,a,c),j=1-Et(o,i,c),Et(o,i,f)):(x=1-Et(s,f,a),y=Et(s,c,a),j=Et(s,c,i),1-Et(s,f,i)),C.push(q[n]),C.push(H[n])):103===n?(v=4===g?(w=1-Et(o,f,a),k=Et(o,c,a),N=Et(o,c,i),1-Et(o,f,i)):(w=Et(s,a,f),k=1-Et(s,a,c),N=1-Et(s,i,c),Et(s,i,f)),C.push(z[n]),C.push(B[n])):152===n?(d=0===g?(x=Et(o,a,f),k=1-Et(o,a,c),y=1-Et(s,a,c),j=1-Et(s,i,c),N=1-Et(o,i,c),Et(o,i,f)):(x=1-Et(s,f,a),k=Et(s,c,a),y=Et(o,c,a),j=Et(o,c,i),N=Et(s,c,i),1-Et(s,f,i)),C.push(q[n]),C.push(B[n]),C.push(D[n])):156===n?(d=4===g?(x=Et(o,a,f),k=1-Et(o,a,c),y=1-Et(s,a,c),j=1-Et(s,i,c),N=1-Et(o,i,c),Et(o,i,f)):(x=1-Et(s,f,a),k=Et(s,c,a),y=Et(o,c,a),j=Et(o,c,i),N=Et(s,c,i),1-Et(s,f,i)),C.push(q[n]),C.push(D[n]),C.push(J[n])):137===n?(d=0===g?(x=Et(s,a,f),w=Et(o,a,f),y=1-Et(o,a,c),j=1-Et(o,i,c),v=Et(o,i,f),Et(s,i,f)):(x=1-Et(o,f,a),w=1-Et(s,f,a),y=Et(s,c,a),j=Et(s,c,i),v=1-Et(s,f,i),1-Et(o,f,i)),C.push(q[n]),C.push(z[n]),C.push(D[n])):139===n?(d=4===g?(x=Et(s,a,f),w=Et(o,a,f),y=1-Et(o,a,c),j=1-Et(o,i,c),v=Et(o,i,f),Et(s,i,f)):(x=1-Et(o,f,a),w=1-Et(s,f,a),y=Et(s,c,a),j=Et(s,c,i),v=1-Et(s,f,i),1-Et(o,f,i)),C.push(q[n]),C.push(z[n]),C.push(H[n])):98===n?(v=0===g?(x=1-Et(o,f,a),w=1-Et(s,f,a),k=Et(s,c,a),y=Et(o,c,a),N=Et(o,c,i),1-Et(o,f,i)):(x=Et(s,a,f),w=Et(o,a,f),k=1-Et(o,a,c),y=1-Et(s,a,c),N=1-Et(s,i,c),Et(s,i,f)),C.push(q[n]),C.push(z[n]),C.push(J[n])):99===n?(v=4===g?(x=1-Et(o,f,a),w=1-Et(s,f,a),k=Et(s,c,a),y=Et(o,c,a),N=Et(o,c,i),1-Et(o,f,i)):(x=Et(s,a,f),w=Et(o,a,f),k=1-Et(o,a,c),y=1-Et(s,a,c),N=1-Et(s,i,c),Et(s,i,f)),C.push(q[n]),C.push(z[n]),C.push(D[n])):38===n?(d=0===g?(w=1-Et(o,f,a),k=Et(o,c,a),j=Et(o,c,i),N=Et(s,c,i),v=1-Et(s,f,i),1-Et(o,f,i)):(w=Et(s,a,f),k=1-Et(s,a,c),j=1-Et(s,i,c),N=1-Et(o,i,c),v=Et(o,i,f),Et(s,i,f)),C.push(z[n]),C.push(H[n]),C.push(J[n])):39===n?(d=4===g?(w=1-Et(o,f,a),k=Et(o,c,a),j=Et(o,c,i),N=Et(s,c,i),v=1-Et(s,f,i),1-Et(o,f,i)):(w=Et(s,a,f),k=1-Et(s,a,c),j=1-Et(s,i,c),N=1-Et(o,i,c),v=Et(o,i,f),Et(s,i,f)),C.push(z[n]),C.push(B[n]),C.push(J[n])):85===n&&(v=j=y=w=0,d=N=k=x=1),(v<0||1<v||d<0||1<d||x<0||1<x||k<0||1<k||j<0||1<j||N<0||1<N)&&console.log(n+" "+b+" "+i+","+f+","+a+","+c+" "+g+" "+v+" "+d+" "+x+" "+w+" "+k+" "+y+" "+j+" "+N),u.cells[h][l]={cval:n,cval_real:b,flipped:g,topleft:v,topright:d,righttop:x,rightbottom:w,bottomright:k,bottomleft:y,leftbottom:j,lefttop:N,edges:C}}}}}return u};function Ft(t,o,e,r,p,u){for(var s=t.cells[e][o],h=s.cval_real,l=o+r,n=e+p,i=[],f=(t.rows,t.cols,!1);!f;){if(void 0===t.cells[n]||void 0===t.cells[n][l])if(n-=p,l-=r,h=(s=t.cells[n][l]).cval_real,-1===p)if(0===u)if(h&g)i.push([l,n]),r=-1,u=p=0;else{if(!(h&b)){i.push([l+s.bottomright,n]),u=p=1,f=!(r=0);break}i.push([l+1,n]),r=1,u=p=0}else{if(!(h&g)){if(h&b){i.push([l+s.bottomright,n]),u=p=1,f=!(r=0);break}i.push([l+s.bottomleft,n]),p=1,f=!(u=r=0);break}i.push([l,n]),r=-1,u=p=0}else if(1===p)if(0===u){if(!(h&c)){if(h&a){i.push([l+s.topleft,n+1]),p=-1,f=!(u=r=0);break}i.push([l+s.topright,n+1]),p=-1,u=1,f=!(r=0);break}i.push([l+1,n+1]),p=0,u=r=1}else u=r=(i.push([l+1,n+1]),p=0,1);else if(-1===r)if(0===u){if(!(h&a)){if(h&g){i.push([l,n+s.leftbottom]),r=1,f=!(u=p=0);break}i.push([l,n+s.lefttop]),u=r=1,f=!(p=0);break}i.push([l,n+1]),p=1,u=r=0}else{if(!(h&a)){console.log("wtf");break}i.push([l,n+1]),p=1,u=r=0}else{if(1!==r){console.log("we came from nowhere!");break}if(0===u){if(!(h&b)){i.push([l+1,n+s.rightbottom]),r=-1,f=!(u=p=0);break}i.push([l+1,n]),r=0,p=-1,u=1}else{if(!(h&b)){if(h&c){i.push([l+1,n+s.righttop]),r=-1,p=0,u=1;break}i.push([l+1,n+s.rightbottom]),r=-1,f=!(u=p=0);break}i.push([l+1,n]),r=0,p=-1,u=1}}else if(h=(s=t.cells[n][l]).cval_real,-1===r)if(0===u)if(void 0!==t.cells[n-1]&&void 0!==t.cells[n-1][l])r=0,p=-1,u=1;else{if(!(h&g)){i.push([l+s.bottomright,n]),u=p=1,f=!(r=0);break}i.push([l,n])}else{if(!(h&a)){console.log("found entry from top at "+l+","+n);break}console.log("proceeding in x-direction!")}else if(1===r){if(0===u){console.log("wtf");break}if(void 0!==t.cells[n+1]&&void 0!==t.cells[n+1][l])p=1,u=r=0;else{if(!(h&c)){i.push([l+s.topleft,n+1]),p=-1,f=!(u=r=0);break}i.push([l+1,n+1]),p=0,u=r=1}}else if(-1===p){if(1!==u){console.log("wtf");break}if(void 0!==t.cells[n][l+1])p=0,u=r=1;else{if(!(h&b)){i.push([l+1,n+s.righttop]),r=-1,u=1,f=!(p=0);break}i.push([l+1,n]),r=0,p=-1,u=1}}else{if(1!==p){console.log("where did we came from???");break}if(0!==u){console.log("wtf");break}if(void 0!==t.cells[n][l-1])r=-1,u=p=0;else{if(!(h&a)){i.push([l,n+s.leftbottom]),r=1,f=!(u=p=0);break}i.push([l,n+1]),p=1,u=r=0}}if(n+=p,(l+=r)===o&&n===e)break}return{path:i,i:l,j:n,x:r,y:p,o:u}}function Ot(t){if(0<t.edges.length){var o=t.edges[t.edges.length-1],e=t.cval_real;switch(o){case 0:return e&c?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 1:return e&b?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 2:return e&b?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 3:return e&g?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 4:return e&c?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 5:return e&b?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 6:return e&b?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 7:return e&g?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 8:return e&b?{p:[t.bottomright],x:0,y:1,o:1}:{p:[1,t.righttop],x:-1,y:0,o:1};case 9:return e&g?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 10:return e&g?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.righttop],x:-1,y:0,o:1};case 11:return e&a?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 12:return e&b?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 13:return e&g?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 14:return e&g?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 15:return e&a?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 16:return e&b?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 17:return e&a?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 18:return e&g?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 19:return e&a?{p:[t.bottomleft,0],x:0,y:1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 20:return e&a?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 21:return e&c?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.topright,1],x:0,y:-1,o:1};case 22:return e&a?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 23:return e&c?{p:[0,t.lefttop],x:1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};default:console.log("edge index out of range!"),console.log(t)}}return null}function It(t,o,e,r){var p,u,s,h,l,n=t.cval;switch(o){case-1:switch(r){case 0:p=z[n],s=j[n],h=C[n],l=_[n];break;default:p=q[n],s=x[n],h=w[n],l=N[n]}break;case 1:switch(r){case 0:p=H[n],s=V[n],h=L[n],l=S[n];break;default:p=J[n],s=G[n],h=P[n],l=T[n]}break;default:switch(e){case-1:switch(r){case 0:p=K[n],s=f[n],h=m[n],l=v[n];break;default:p=Q[n],s=d[n],h=y[n],l=k[n]}break;case 1:switch(r){case 0:p=D[n],s=E[n],h=M[n],l=F[n];break;default:p=B[n],s=O[n],h=I[n],l=A[n]}}}if(u=t.edges.indexOf(p),void 0===t.edges[u])return null;switch(function(t,o){delete t.edges[o];for(var e=o+1;e<t.edges.length;e++)t.edges[e-1]=t.edges[e];t.edges.pop()}(t,u),n=t.cval_real,p){case 0:e=n&c?(o=t.topleft,1):(o=1,t.righttop);break;case 1:e=n&b?(o=1,t.rightbottom):(o=t.topleft,1);break;case 2:e=n&b?(o=t.topleft,1):(o=t.bottomright,0);break;case 3:e=n&g?(o=t.bottomleft,0):(o=t.topleft,1);break;case 4:e=n&c?(o=t.topright,1):(o=1,t.righttop);break;case 5:e=n&b?(o=1,t.rightbottom):(o=t.topright,1);break;case 6:e=n&b?(o=t.topright,1):(o=t.bottomright,0);break;case 7:e=n&g?(o=t.bottomleft,0):(o=t.topright,1);break;case 8:e=n&b?(o=1,t.righttop):(o=t.bottomright,0);break;case 9:e=n&g?(o=t.bottomleft,0):(o=1,t.righttop);break;case 10:e=n&g?(o=1,t.righttop):(o=0,t.leftbottom);break;case 11:e=n&a?(o=0,t.lefttop):(o=1,t.righttop);break;case 12:e=n&b?(o=1,t.rightbottom):(o=t.bottomright,0);break;case 13:e=n&g?(o=t.bottomleft,0):(o=1,t.rightbottom);break;case 14:e=n&g?(o=1,t.rightbottom):(o=0,t.leftbottom);break;case 15:e=n&a?(o=0,t.lefttop):(o=1,t.rightbottom);break;case 16:e=n&b?(o=0,t.leftbottom):(o=t.bottomright,0);break;case 17:e=n&a?(o=0,t.lefttop):(o=t.bottomright,0);break;case 18:e=n&g?(o=t.bottomleft,0):(o=0,t.leftbottom);break;case 19:e=n&a?(o=0,t.lefttop):(o=t.bottomleft,0);break;case 20:e=n&a?(o=0,t.leftbottom):(o=t.topleft,1);break;case 21:e=n&c?(o=t.topright,1):(o=0,t.leftbottom);break;case 22:e=n&a?(o=0,t.lefttop):(o=t.topleft,1);break;case 23:e=n&c?(o=t.topright,1):(o=0,t.lefttop);break;default:return console.log("edge index out of range!"),console.log(t),null}return void 0!==o&&void 0!==e&&void 0!==s&&void 0!==h&&void 0!==l||(console.log("undefined value!"),console.log(t),console.log(o+" "+e+" "+s+" "+h+" "+l)),{p:[o,e],x:s,y:h,o:l}}var At=function(t,o,e){if(typeof o!=typeof new Array||6!=o.length)throw new Error("GeoTransform must be a 6 elements array");for(var r=Pt(t,e),p=0;p<r.length;p++)for(var u=0;u<r[p].length;u++){var s=Gt(r[p][u][0],r[p][u][1],o);r[p][u][0]=s[0],r[p][u][1]=s[1]}return r},Gt=function(t,o,e){return[e[0]+t*e[1]+o*e[2],e[3]+t*e[4]+o*e[5]]},Pt=function(t,o,e){var r={successCallback:null,progressCallback:null,verbose:!1},p={};e=e||{};for(var u=Object.keys(r),s=0;s<u.length;s++){var h=u[s],l=e[h];l=null!=l?l:r[h],p[h]=l}p.verbose&&console.log("computing isocontour for "+o);var n=function(n){var i=[],f=0;n.rows,n.cols;return n.cells.forEach(function(t,l){t.forEach(function(t,o){if(void 0!==t&&!function(t){return 5==t.cval||10==t.cval}(t)&&!Vt(t)){var e=function(t,o,e){var r,p,u=t.length,s=[],h=[0,0,1,1,0,0,0,0,-1,0,1,1,-1,0,-1,0],l=[0,-1,0,0,1,1,1,1,0,-1,0,0,0,-1,0,0],n=["none","bottom","right","right","top","top","top","top","left","bottom","right","right","left","bottom","left","none"],i=(t[o][e],t[o][e]),f=i.cval,a=["none","left","bottom","left","right","none","bottom","left","top","top","none","top","right","right","bottom","none"][f],c=St(i,a);s.push([e+c[0],o+c[1]]),c=St(i,a=n[f]),s.push([e+c[0],o+c[1]]),Lt(i);var b=e+h[f],g=o+l[f],m=f;for(;0<=b&&0<=g&&g<u&&(b!=e||g!=o)&&void 0!==(i=t[g][b]);){if(0===(f=i.cval)||15===f)return{path:s,info:"mergeable"};a=n[f],r=h[f],p=l[f],5!=f&&10!=f||(5==f?i.flipped?p=(r=-1==l[m]?(a="left",-1):(a="right",1),0):-1==h[m]&&(a="bottom",r=0,p=-1):10==f&&(i.flipped?p=-1==h[m]?(a="top",r=0,1):(a="bottom",r=0,-1):1==l[m]&&(a="left",r=-1,p=0))),c=St(i,a),s.push([b+c[0],g+c[1]]),Lt(i),b+=r,g+=p,m=f}return{path:s,info:"closed"}}(n.cells,l,o),r=!1;if("mergeable"==e.info)for(var p=e.path[e.path.length-1][0],u=e.path[e.path.length-1][1],s=f-1;0<=s;s--)if(Math.abs(i[s][0][0]-p)<=1e-7&&Math.abs(i[s][0][1]-u)<=1e-7){for(var h=e.path.length-2;0<=h;--h)i[s].unshift(e.path[h]);r=!0;break}r||(i[f++]=e.path)}})}),i}(function(t,o){for(var e=t.length-1,r=t[0].length-1,p={rows:e,cols:r,cells:[]},u=0;u<e;++u){p.cells[u]=[];for(var s=0;s<r;++s){var h=0,l=t[u+1][s],n=t[u+1][s+1],i=t[u][s+1],f=t[u][s];if(!(isNaN(l)||isNaN(n)||isNaN(i)||isNaN(f))){h|=o<=l?8:0,h|=o<=n?4:0,h|=o<=i?2:0;var a,c,b,g,m=!1;if(5==(h|=o<=f?1:0)||10==h){var v=(l+n+i+f)/4;5==h&&v<o?(h=10,m=!0):10==h&&v<o&&(h=5,m=!0)}if(0!==h&&15!==h)a=c=b=g=.5,1==h?(b=1-Tt(o,l,f),c=1-Tt(o,i,f)):2==h?(c=Tt(o,f,i),g=1-Tt(o,n,i)):3==h?(b=1-Tt(o,l,f),g=1-Tt(o,n,i)):4==h?(a=Tt(o,l,n),g=Tt(o,i,n)):5==h?(a=Tt(o,l,n),g=Tt(o,i,n),c=1-Tt(o,i,f),b=1-Tt(o,l,f)):6==h?(c=Tt(o,f,i),a=Tt(o,l,n)):7==h?(b=1-Tt(o,l,f),a=Tt(o,l,n)):8==h?(b=Tt(o,f,l),a=1-Tt(o,n,l)):9==h?(c=1-Tt(o,i,f),a=1-Tt(o,n,l)):10==h?(a=1-Tt(o,n,l),g=1-Tt(o,n,i),c=Tt(o,f,i),b=Tt(o,f,l)):11==h?(a=1-Tt(o,n,l),g=1-Tt(o,n,i)):12==h?(b=Tt(o,f,l),g=Tt(o,i,n)):13==h?(c=1-Tt(o,i,f),g=Tt(o,i,n)):14==h?(b=Tt(o,f,l),c=Tt(o,f,i)):console.log("Illegal cval detected: "+h),p.cells[u][s]={cval:h,flipped:m,top:a,right:g,bottom:c,left:b}}}}return p}(t,o));return"function"==typeof p.successCallback&&p.successCallback(n),n};function Tt(t,o,e){return(t-o)/(e-o)}function Vt(t){return 0===t.cval||15==t.cval}function Lt(t){Vt(t)||5==t.cval||10==t.cval||(t.cval=15)}function St(t,o){return"top"===o?[t.top,1]:"bottom"===o?[t.bottom,0]:"right"===o?[1,t.right]:"left"===o?[0,t.left]:void 0}t.isoband=i,t.isobands=function(t,o,e){for(var r={type:"FeatureCollection",features:[]},p=1;p<e.length;p++){for(var u=e[p-1],s=e[p],h=n(t,o,u,s-u),l=0;l<h.length;l++)h[l].reverse();r.features.push({type:"Feature",geometry:{type:"Polygon",coordinates:h},properties:[{lowerValue:u,upperValue:s}]})}return r},t.isoline=Pt,t.isolines=function(t,o,e){for(var r={type:"FeatureCollection",features:[]},p=0;p<e.length;p++){var u=e[p],s=At(t,o,u);r.features.push({type:"Feature",geometry:{type:"MultiLineString",coordinates:s},properties:[{value:u}]})}return r},t.projectedIsoband=n,t.projectedIsoline=At,Object.defineProperty(t,"__esModule",{value:!0})}); |
{ | ||
"name": "raster-marching-squares", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Create isobands and isolines directly from a Raster with the marching-squares algorithm", | ||
@@ -35,9 +35,9 @@ "keywords": [ | ||
"devDependencies": { | ||
"canvas": "1", | ||
"d3-array": "^1.2.1", | ||
"d3-geo": "^1.0.0", | ||
"d3-scale": "^1.0.7", | ||
"canvas": "2", | ||
"d3-array": "^2.2.0", | ||
"d3-geo": "^1.11.3", | ||
"d3-scale": "^3.0.0", | ||
"geotiff": "^0.4.1", | ||
"package-preamble": "0.1.0", | ||
"rollup": "0.52", | ||
"rollup": "1.14", | ||
"tape": "4", | ||
@@ -44,0 +44,0 @@ "topojson": "^3.0.2", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
334534
11
6192