m4-w-fast 1.0.7 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -1
- package/dist/index.js +1 -1
- package/dist/intersect.worker.js +2 -2
- package/dist/isoBands.worker.js +1 -1
- package/dist/m4-w-fast.umd.js +1 -0
- package/dist/readFile.d.ts +28 -83
- package/dist/readFile.js +1 -1
- package/dist/types.d.ts +157 -0
- package/dist/types.js +1 -0
- package/package.json +7 -3
package/dist/readFile.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function a3_0x3ba0(_0x52ce72,_0x12bc60){const _0x23fe86=a3_0x23fe();return a3_0x3ba0=function(_0x3ba044,_0x5b0bdd){_0x3ba044=_0x3ba044-0x1d9;let _0x1625ca=_0x23fe86[_0x3ba044];return _0x1625ca;},a3_0x3ba0(_0x52ce72,_0x12bc60);}const a3_0x410f6c=a3_0x3ba0;(function(_0x1f17c1,_0x50dce0){const _0x10a894=a3_0x3ba0,_0x2462cb=_0x1f17c1();while(!![]){try{const _0x5c7e03=-parseInt(_0x10a894(0x20b))/0x1+parseInt(_0x10a894(0x1ed))/0x2*(-parseInt(_0x10a894(0x1e2))/0x3)+-parseInt(_0x10a894(0x1f6))/0x4*(-parseInt(_0x10a894(0x1e0))/0x5)+parseInt(_0x10a894(0x1f3))/0x6*(-parseInt(_0x10a894(0x21d))/0x7)+-parseInt(_0x10a894(0x23b))/0x8*(parseInt(_0x10a894(0x1f9))/0x9)+-parseInt(_0x10a894(0x20f))/0xa+parseInt(_0x10a894(0x21a))/0xb;if(_0x5c7e03===_0x50dce0)break;else _0x2462cb['push'](_0x2462cb['shift']());}catch(_0x28fa01){_0x2462cb['push'](_0x2462cb['shift']());}}}(a3_0x23fe,0x6a623));import{contours}from'd3-contour';import a3_0x4e0606 from'@turf/area';import{featureCollection as a3_0x461e3a}from'@turf/helpers';import a3_0x1ddee9 from'decimal.js';export class readFileM4{['filePath']='';['nx']=0x0;['ny']=0x0;[a3_0x410f6c(0x227)]=0x0;['minLat']=0x0;[a3_0x410f6c(0x23c)]=0x0;[a3_0x410f6c(0x207)]=0x0;['values']=[];[a3_0x410f6c(0x230)]=-Infinity;[a3_0x410f6c(0x200)]=Infinity;[a3_0x410f6c(0x220)]='';[a3_0x410f6c(0x22c)]=new Map();constructor(_0x21fd05){const _0x2e4ed1=a3_0x410f6c;this[_0x2e4ed1(0x21b)]=_0x21fd05||'';}async[a3_0x410f6c(0x228)](_0x231152){const _0x5c11c9=a3_0x410f6c,_0x7ef2ef=await fetch(this[_0x5c11c9(0x21b)]);if(!_0x7ef2ef['ok'])return new Promise((_0x45b3aa,_0x41e9df)=>{_0x41e9df('该时次未获取到文件');});const _0x5db7e8=await _0x7ef2ef[_0x5c11c9(0x20c)](),_0x10d038=_0x5db7e8[_0x5c11c9(0x22d)](/\r\n/g,'\x0a')[_0x5c11c9(0x22d)](/\r/g,'\x0a')['split']('\x0a');if(_0x10d038[_0x5c11c9(0x236)]<0x4)return new Promise((_0x5e5474,_0x15df21)=>{const _0x1acc9a=_0x5c11c9;_0x15df21(_0x1acc9a(0x211));});const _0xdcf709=(_0x10d038[0x1]??'')[_0x5c11c9(0x233)]()[_0x5c11c9(0x209)](/\s+/);let _0x40f809=0x2;while(_0xdcf709[_0x5c11c9(0x236)]<0x13){_0xdcf709['push'](...(_0x10d038[_0x40f809]??'')[_0x5c11c9(0x233)]()[_0x5c11c9(0x209)](/\s+/)),_0x40f809++;}this[_0x5c11c9(0x23c)]=Number(_0xdcf709[0x6]);const _0x2a7a99=Number(_0xdcf709[0x8]),_0x1c6aae=Number(_0xdcf709[0xa]),_0x2c1c29=Number(_0xdcf709[0xb]);this['nx']=Number(_0xdcf709[0xc]),this['ny']=Number(_0xdcf709[0xd]),this[_0x5c11c9(0x227)]=_0x2a7a99,this[_0x5c11c9(0x224)]=_0x1c6aae,this[_0x5c11c9(0x207)]=Math[_0x5c11c9(0x223)](Number(_0xdcf709[0x7]))*(_0x1c6aae>_0x2c1c29?-0x1:0x1);const _0x55cc67=this['nx']*this['ny'];let _0x4d1008=0x0;for(let _0x43c282=_0x40f809;_0x43c282<_0x10d038[_0x5c11c9(0x236)]&&_0x4d1008<_0x55cc67;_0x43c282++){const _0x13975b=_0x10d038[_0x43c282][_0x5c11c9(0x233)]()??'',_0x4d46d1=_0x13975b[_0x5c11c9(0x209)](/\s+/);if(!_0x4d46d1||_0x4d46d1[_0x5c11c9(0x236)]===0x0)continue;for(let _0x19dc77=0x0;_0x19dc77<_0x4d46d1[_0x5c11c9(0x236)]&&_0x4d1008<_0x55cc67;_0x19dc77++){let _0xd8f0c8=Number(_0x4d46d1[_0x19dc77]);if(_0x231152?.['convertTemKtoC'])_0xd8f0c8=new a3_0x1ddee9(_0xd8f0c8)['minus'](272.15)['toNumber']();else _0x231152?.[_0x5c11c9(0x1dd)]&&(_0xd8f0c8=new a3_0x1ddee9(_0xd8f0c8)['plus'](_0x231152['plusOffset'])[_0x5c11c9(0x225)]());this['values'][_0x5c11c9(0x217)](_0xd8f0c8),this[_0x5c11c9(0x200)]=Math[_0x5c11c9(0x1f8)](this['minVal'],_0xd8f0c8),this[_0x5c11c9(0x230)]=Math[_0x5c11c9(0x222)](this[_0x5c11c9(0x230)],_0xd8f0c8),_0x4d1008++;}}}[a3_0x410f6c(0x232)](_0x15171b,_0x5d8530){const _0x309b78=a3_0x410f6c;this['nx']=_0x15171b['nx'],this['ny']=_0x15171b['ny'],this['minLng']=_0x15171b[_0x309b78(0x227)],this['minLat']=_0x15171b[_0x309b78(0x224)],this['gjLng']=_0x15171b['gjLng'],this[_0x309b78(0x207)]=_0x15171b[_0x309b78(0x207)];if(_0x5d8530?.[_0x309b78(0x221)])for(let _0x2b4a34=0x0;_0x2b4a34<_0x15171b['values'][_0x309b78(0x236)];_0x2b4a34++){_0x15171b[_0x309b78(0x21c)][_0x2b4a34]=new a3_0x1ddee9(_0x15171b[_0x309b78(0x21c)][_0x2b4a34])['minus'](272.15)[_0x309b78(0x225)]();}else{if(_0x5d8530?.[_0x309b78(0x1dd)])for(let _0x56c300=0x0;_0x56c300<_0x15171b[_0x309b78(0x21c)][_0x309b78(0x236)];_0x56c300++){_0x15171b[_0x309b78(0x21c)][_0x56c300]=new a3_0x1ddee9(_0x15171b[_0x309b78(0x21c)][_0x56c300])[_0x309b78(0x1e8)](_0x5d8530[_0x309b78(0x1dd)])[_0x309b78(0x225)]();}else this[_0x309b78(0x21c)]=_0x15171b[_0x309b78(0x21c)];}this[_0x309b78(0x237)]();}[a3_0x410f6c(0x20e)](_0x1c8c67){const _0x471b8b=a3_0x410f6c;if(this[_0x471b8b(0x21c)]['length']===0x0)return{'type':'FeatureCollection','features':[]};let _0x24f1c3=[];if(_0x1c8c67['length']===0x0)_0x1c8c67=this[_0x471b8b(0x1df)]();const _0x5e0ca4=[];for(let _0x48c5e5=0x0;_0x48c5e5<_0x1c8c67[_0x471b8b(0x236)];_0x48c5e5++){const _0x255f49=_0x1c8c67[_0x48c5e5],_0x2cc574=_0x48c5e5<_0x1c8c67[_0x471b8b(0x236)]-0x1?_0x1c8c67[_0x48c5e5+0x1]:Infinity;if(_0x255f49<this[_0x471b8b(0x200)]&&_0x2cc574<this[_0x471b8b(0x200)])continue;if(_0x255f49>this['maxVal']&&_0x2cc574>this[_0x471b8b(0x230)])continue;_0x5e0ca4[_0x471b8b(0x217)](_0x255f49);}const _0x52f30b=contours()[_0x471b8b(0x1e7)]([this['nx'],this['ny']])['thresholds'](_0x5e0ca4),_0x195d5e=_0x52f30b(this[_0x471b8b(0x21c)]);for(const _0x18f7b7 of _0x195d5e){for(const _0x5bb1bb of _0x18f7b7[_0x471b8b(0x201)]){if(Array[_0x471b8b(0x215)](_0x5bb1bb))for(const _0x3200cc of _0x5bb1bb){_0x3200cc[_0x471b8b(0x20d)](_0xa31996=>{const _0x2a3de9=_0x471b8b,_0x254ff0=_0xa31996[0x0],_0x542d23=_0xa31996[0x1];if(_0x254ff0==null||_0x542d23==null||Number[_0x2a3de9(0x1dc)](_0x254ff0)||Number[_0x2a3de9(0x1dc)](_0x542d23))return null;const _0x1fbf07=new a3_0x1ddee9(this[_0x2a3de9(0x227)])[_0x2a3de9(0x1e8)](new a3_0x1ddee9(_0x254ff0)[_0x2a3de9(0x22b)](this[_0x2a3de9(0x23c)]))[_0x2a3de9(0x225)](),_0x5bb007=new a3_0x1ddee9(this[_0x2a3de9(0x224)])['plus'](new a3_0x1ddee9(_0x542d23)['times'](this['gjLat']))['toNumber']();_0xa31996[0x0]=_0x1fbf07,_0xa31996[0x1]=_0x5bb007;});}}_0x24f1c3['push']({'type':_0x471b8b(0x1ee),'properties':{'z':_0x18f7b7[_0x471b8b(0x1e9)]},'geometry':_0x18f7b7});}return{'type':'FeatureCollection','features':_0x24f1c3};}[a3_0x410f6c(0x22e)](_0x2d5a1f,_0x381346){const _0x41325f=a3_0x410f6c;if(this[_0x41325f(0x21c)][_0x41325f(0x236)]===0x0)return{'type':_0x41325f(0x1e3),'features':[]};let _0x173847=[];if(_0x2d5a1f[_0x41325f(0x236)]===0x0)_0x2d5a1f=this[_0x41325f(0x1df)]();const _0x1023c3=[];for(let _0x436c9c=0x0;_0x436c9c<_0x2d5a1f['length'];_0x436c9c++){const _0x148186=_0x2d5a1f[_0x436c9c],_0x4b3597=_0x436c9c<_0x2d5a1f['length']-0x1?_0x2d5a1f[_0x436c9c+0x1]:Infinity;if(_0x148186<this['minVal']&&_0x4b3597<this[_0x41325f(0x200)])continue;if(_0x148186>this['maxVal']&&_0x4b3597>this[_0x41325f(0x230)])continue;_0x1023c3[_0x41325f(0x217)](_0x148186);}const _0x1c91fc=contours()[_0x41325f(0x1e7)]([this['nx'],this['ny']])[_0x41325f(0x1f2)](_0x1023c3),_0x22b651=_0x1c91fc(this['values']),_0x549d9f=this[_0x41325f(0x227)],_0x9b506a=this[_0x41325f(0x224)],_0x16ac35=_0x549d9f+this['nx']*this['gjLng'],_0x3e7f64=_0x9b506a+this['ny']*this['gjLat'],_0x321a24=_0x16ac35-_0x549d9f,_0x24e8fb=_0x3e7f64-_0x9b506a,_0x3a6c05=_0x381346?.['width']||0x400,_0x9062f7=_0x381346?.[_0x41325f(0x235)]||Math[_0x41325f(0x222)](0x1,Math['round'](_0x3a6c05*(_0x24e8fb/Math[_0x41325f(0x222)](1e-12,_0x321a24)))),_0x3d228c=_0x381346?.[_0x41325f(0x204)]||(typeof devicePixelRatio!=='undefined'?devicePixelRatio:0x1),_0x175d82=document[_0x41325f(0x1ea)](_0x41325f(0x1d9));if(!_0x175d82)return null;const _0x10dba1=_0x175d82['getContext']('2d');if(!_0x10dba1)return null;_0x175d82[_0x41325f(0x1e1)]=_0x3a6c05*_0x3d228c,_0x175d82[_0x41325f(0x235)]=_0x9062f7*_0x3d228c,_0x10dba1[_0x41325f(0x214)](_0x3d228c,_0x3d228c);for(const _0x388e5d of _0x22b651){const _0x2cf730=_0x388e5d['value'];_0x10dba1[_0x41325f(0x1e4)]();for(const _0xd99508 of _0x388e5d[_0x41325f(0x201)]){if(Array['isArray'](_0xd99508))for(const _0x2f9341 of _0xd99508){_0x2f9341[_0x41325f(0x20d)]((_0x5f1e14,_0x486b62)=>{const _0x2c609f=_0x41325f,_0x154f44=(_0x5f1e14[0x0]-_0x549d9f)/_0x321a24*_0x3a6c05,_0x59ef98=_0x9062f7-(_0x5f1e14[0x1]-_0x9b506a)/_0x24e8fb*_0x9062f7;_0x486b62===0x0?_0x10dba1[_0x2c609f(0x239)](_0x154f44,_0x59ef98):_0x10dba1[_0x2c609f(0x23a)](_0x154f44,_0x59ef98);});}}_0x10dba1[_0x41325f(0x216)](),_0x10dba1[_0x41325f(0x212)]=this[_0x41325f(0x206)](_0x2cf730,_0x2d5a1f,[]),_0x10dba1[_0x41325f(0x20a)]();}return _0x175d82;}[a3_0x410f6c(0x206)](_0x12a6b6,_0x2296b3,_0x398cab){const _0x21d15a=a3_0x410f6c;let _0x461f62='rgba(255,255,255,0)';const _0x999250=_0x2296b3[_0x21d15a(0x226)](_0x12a6b6);if(typeof _0x398cab[_0x999250]==_0x21d15a(0x21e))_0x461f62=_0x398cab[_0x999250];else _0x999250!==-0x1&&(_0x461f62='rgba('+_0x398cab[_0x999250][0x0]+','+_0x398cab[_0x999250][0x1]+','+_0x398cab[_0x999250][0x2]+','+(_0x398cab[_0x999250][0x3]||_0x398cab[_0x999250][0x3]===0x0?_0x398cab[_0x999250][0x3]:0x1)+')');return _0x461f62;}async[a3_0x410f6c(0x1e6)](_0x1056a0,_0x52d7b7,_0x24931,_0x7b5450){const _0x4888f3=a3_0x410f6c,_0x5db121=_0x7b5450?_0x7b5450:navigator[_0x4888f3(0x1fb)]-0x4||0x1,_0x2737e7=Math[_0x4888f3(0x1f8)](_0x5db121,Math[_0x4888f3(0x222)](0x1,_0x1056a0[_0x4888f3(0x238)][_0x4888f3(0x236)])),_0x306828=this['chunkArray'](_0x1056a0[_0x4888f3(0x238)],_0x2737e7),_0x59ee45=[],_0x22cea1=_0x306828[_0x4888f3(0x1f4)](_0xacfb8b=>{const _0x1da0fd=_0x4888f3,_0x1fdc13=new Worker(_0x24931,{'type':_0x1da0fd(0x1e5)});return _0x59ee45[_0x1da0fd(0x217)](_0x1fdc13),new Promise(_0x3e4d0c=>{const _0x589bd4=_0x1da0fd;_0x1fdc13[_0x589bd4(0x1fc)]=_0x5e29fd=>{const _0x146caf=_0x589bd4;_0x3e4d0c(_0x5e29fd[_0x146caf(0x203)]['features']);},_0x1fdc13['onerror']=_0x2d466b=>{const _0x57bff7=_0x589bd4;console[_0x57bff7(0x1f7)](_0x2d466b);},_0x1fdc13[_0x589bd4(0x1f1)]({'isoChunk':_0xacfb8b,'gansuFeatures':_0x52d7b7[_0x589bd4(0x238)]});});}),_0x2cb358=await Promise[_0x4888f3(0x205)](_0x22cea1);_0x59ee45[_0x4888f3(0x20d)](_0x1c1914=>_0x1c1914['terminate']());const _0x49ff41=_0x2cb358[_0x4888f3(0x208)]();return a3_0x461e3a(_0x49ff41);}async[a3_0x410f6c(0x1de)](_0x2436fb,_0x1450c0,_0x3bfd51){const _0x361dc7=a3_0x410f6c;if(this[_0x361dc7(0x21c)][_0x361dc7(0x236)]===0x0)return{'type':_0x361dc7(0x1e3),'features':[]};let _0x12a450=[];if(_0x2436fb[_0x361dc7(0x236)]===0x0)_0x2436fb=this[_0x361dc7(0x1df)]();const _0x2017aa=[],_0x257e9c=_0x3bfd51?_0x3bfd51:navigator['hardwareConcurrency']-0x4||0x1,_0x4df9b8=Math['min'](_0x257e9c,Math[_0x361dc7(0x222)](0x1,_0x2436fb[_0x361dc7(0x236)])),_0x18cdd6=this[_0x361dc7(0x1f0)](_0x2436fb,_0x4df9b8),_0x2bfce3=_0x18cdd6[_0x361dc7(0x1f4)](_0x5a4996=>{const _0x14037f=_0x361dc7,_0x2ed949=new Worker(_0x1450c0,{'type':_0x14037f(0x1e5)});return _0x2017aa['push'](_0x2ed949),new Promise(_0x26d955=>{const _0x29bcc3=_0x14037f;_0x2ed949['onmessage']=_0x529e23=>{const _0x2c93a7=a3_0x3ba0;_0x26d955(_0x529e23[_0x2c93a7(0x203)][_0x2c93a7(0x238)]);},_0x2ed949[_0x29bcc3(0x1fa)]=_0x227a23=>{const _0x482c2a=_0x29bcc3;console[_0x482c2a(0x1f7)](_0x227a23);},_0x2ed949[_0x29bcc3(0x1f1)]({'breaks':_0x5a4996,'values':this[_0x29bcc3(0x21c)],'nx':this['nx'],'ny':this['ny'],'minVal':this[_0x29bcc3(0x200)],'maxVal':this['maxVal'],'minLng':this[_0x29bcc3(0x227)],'minLat':this['minLat'],'gjLng':this[_0x29bcc3(0x23c)],'gjLat':this[_0x29bcc3(0x207)]});});}),_0xcfdae5=await Promise['all'](_0x2bfce3);return _0x2017aa[_0x361dc7(0x20d)](_0x25a002=>_0x25a002[_0x361dc7(0x210)]()),_0xcfdae5[_0x361dc7(0x20d)](_0x4aa6fa=>{const _0x3a5a8d=_0x361dc7;_0x12a450[_0x3a5a8d(0x217)](..._0x4aa6fa);}),_0x12a450=this[_0x361dc7(0x1db)](_0x12a450),{'type':_0x361dc7(0x1e3),'features':_0x12a450};}[a3_0x410f6c(0x1da)](){const _0x2f5c26=a3_0x410f6c;this[_0x2f5c26(0x22c)][_0x2f5c26(0x21f)]();}[a3_0x410f6c(0x231)](_0x20eca2=[],_0x22044b){const _0x156927=a3_0x410f6c;if(typeof _0x22044b!==_0x156927(0x1fd)&&this[_0x156927(0x22c)][_0x156927(0x1fe)](_0x22044b)){const _0x342f51=this[_0x156927(0x22c)][_0x156927(0x1fe)](_0x22044b)||[],_0x217c68=this['sortFeaturesByArea']?this['sortFeaturesByArea'](_0x342f51):_0x342f51;return{'type':_0x156927(0x1e3),'features':_0x217c68};}if(this[_0x156927(0x21c)][_0x156927(0x236)]===0x0)return{'type':_0x156927(0x1e3),'features':[]};if(_0x20eca2['length']===0x0)_0x20eca2=this[_0x156927(0x1df)]();const _0x508b02=_0x20eca2['join'](',');if(this[_0x156927(0x220)]!==_0x508b02){this[_0x156927(0x220)]=_0x508b02,this['_maskCache']['clear']();const _0x263530=this[_0x156927(0x227)],_0x4c67ca=this[_0x156927(0x224)],_0x12ad27=this[_0x156927(0x23c)],_0x19d22b=this[_0x156927(0x207)],_0x1c00f5=_0xe2d203=>{const _0x13685d=_0x156927;let _0x107f6d=0x0;for(let _0x1a08fd=0x0,_0x1c49f1=_0xe2d203[_0x13685d(0x236)];_0x1a08fd<_0x1c49f1;_0x1a08fd++){const _0x28cfe8=_0xe2d203[_0x1a08fd][0x0],_0x5e35a1=_0xe2d203[_0x1a08fd][0x1],_0x43536c=_0xe2d203[(_0x1a08fd+0x1)%_0x1c49f1][0x0],_0x3b04dd=_0xe2d203[(_0x1a08fd+0x1)%_0x1c49f1][0x1];if(_0x28cfe8==null||_0x5e35a1==null||_0x43536c==null||_0x3b04dd==null)continue;_0x107f6d+=_0x28cfe8*_0x3b04dd-_0x43536c*_0x5e35a1;}return _0x107f6d/0x2;},_0x56262d=(_0x106ba7,_0x1cc119)=>{const _0x4f0cae=_0x156927;if(!_0x106ba7)return![];const _0x49d99a=_0x106ba7[0x0],_0x521f1e=_0x106ba7[0x1];let _0x44600d=![];for(let _0x3c773a=0x0,_0x297bc5=_0x1cc119[_0x4f0cae(0x236)]-0x1;_0x3c773a<_0x1cc119[_0x4f0cae(0x236)];_0x297bc5=_0x3c773a++){const _0x14de8f=_0x1cc119[_0x3c773a][0x0],_0x100ddc=_0x1cc119[_0x3c773a][0x1],_0x485006=_0x1cc119[_0x297bc5][0x0],_0x549368=_0x1cc119[_0x297bc5][0x1],_0x378177=_0x100ddc>_0x521f1e!==_0x549368>_0x521f1e&&_0x49d99a<(_0x485006-_0x14de8f)*(_0x521f1e-_0x100ddc)/(_0x549368-_0x100ddc)+_0x14de8f;if(_0x378177)_0x44600d=!_0x44600d;}return _0x44600d;},_0x27e03b=_0x313fe5=>{const _0x90442=_0x156927,_0x15b2ee=[];let _0x1148b4=null,_0x373c6b=null;for(let _0x512db4=0x0;_0x512db4<_0x313fe5[_0x90442(0x236)];_0x512db4++){const _0x3b6234=_0x313fe5[_0x512db4];if(!_0x3b6234)continue;const _0x38dd84=_0x3b6234[0x0],_0x144abc=_0x3b6234[0x1];if(_0x38dd84==null||_0x144abc==null||Number[_0x90442(0x1dc)](_0x38dd84)||Number[_0x90442(0x1dc)](_0x144abc))continue;const _0x3d056f=_0x263530+_0x38dd84*_0x12ad27,_0x29c26e=_0x4c67ca+_0x144abc*_0x19d22b;if(_0x1148b4!==null&&_0x373c6b!==null&&_0x1148b4===_0x3d056f&&_0x373c6b===_0x29c26e){_0x1148b4=_0x3d056f,_0x373c6b=_0x29c26e;continue;}_0x15b2ee[_0x90442(0x217)]([_0x3d056f,_0x29c26e]),_0x1148b4=_0x3d056f,_0x373c6b=_0x29c26e;}if(_0x15b2ee['length']===0x0)return _0x15b2ee;const _0x3a3631=_0x15b2ee[0x0],_0x22847a=_0x15b2ee[_0x15b2ee['length']-0x1];if(_0x3a3631[0x0]!==_0x22847a[0x0]||_0x3a3631[0x1]!==_0x22847a[0x1])_0x15b2ee[_0x90442(0x217)]([_0x3a3631[0x0],_0x3a3631[0x1]]);return _0x15b2ee;},_0x24d44c=_0x20eca2['length']-0x1;for(let _0x2d77a8=0x0;_0x2d77a8<_0x20eca2[_0x156927(0x236)];_0x2d77a8++){const _0x33e734=_0x20eca2[_0x2d77a8],_0x1e695b=_0x2d77a8<_0x24d44c?_0x20eca2[_0x2d77a8+0x1]:Infinity,_0x2255b9=Array['from']({'length':this[_0x156927(0x21c)][_0x156927(0x236)]});let _0x5a4c57=![];for(let _0x2b934d=0x0;_0x2b934d<this[_0x156927(0x21c)]['length'];_0x2b934d++){const _0x95c1cd=this[_0x156927(0x21c)][_0x2b934d],_0x480860=_0x95c1cd>=_0x33e734&&_0x95c1cd<_0x1e695b?0x1:0x0;if(_0x480860)_0x5a4c57=!![];_0x2255b9[_0x2b934d]=_0x480860;}if(!_0x5a4c57)continue;const _0x20de04=contours()['size']([this['nx'],this['ny']])['thresholds']([0.5]),_0x5b2413=_0x20de04[_0x156927(0x1ef)]?_0x20de04[_0x156927(0x1ef)](_0x2255b9):_0x20de04(_0x2255b9);if(!_0x5b2413||_0x5b2413[_0x156927(0x236)]===0x0)continue;const _0x372551=[];for(const _0x5837e4 of _0x5b2413){const _0x5910db=_0x5837e4&&_0x5837e4[_0x156927(0x201)];if(!_0x5910db)continue;for(const _0x489fae of _0x5910db){let _0x1b146d=[];if(Array['isArray'](_0x489fae)&&_0x489fae['length']>0x0&&typeof _0x489fae[0x0][0x0]===_0x156927(0x1ff))_0x1b146d=[_0x489fae];else{if(Array[_0x156927(0x215)](_0x489fae))_0x1b146d=_0x489fae;else continue;}const _0x4d8787=_0x1b146d[_0x156927(0x1f4)](_0x53698a=>({'ring':_0x53698a,'area':Math[_0x156927(0x223)](_0x1c00f5(_0x53698a))}))[_0x156927(0x22f)]((_0x40bfb3,_0x11992e)=>_0x11992e['area']-_0x40bfb3['area']),_0x2a9691=Array[_0x156927(0x213)]({'length':_0x4d8787['length']})[_0x156927(0x20a)](![]);for(let _0x3202c7=0x0;_0x3202c7<_0x4d8787[_0x156927(0x236)];_0x3202c7++){if(_0x2a9691[_0x3202c7])continue;const _0x13b32d=_0x4d8787[_0x3202c7][_0x156927(0x234)];_0x2a9691[_0x3202c7]=!![];const _0x23c67d=[];for(let _0x5de863=0x0;_0x5de863<_0x4d8787[_0x156927(0x236)];_0x5de863++){if(_0x2a9691[_0x5de863])continue;const _0x58568b=_0x4d8787[_0x5de863][_0x156927(0x234)],_0x1ad908=_0x58568b[0x0];_0x1ad908&&_0x56262d(_0x1ad908,_0x13b32d)&&(_0x23c67d[_0x156927(0x217)](_0x58568b),_0x2a9691[_0x5de863]=!![]);}const _0x4313ad=_0x27e03b(_0x13b32d);if(_0x4313ad[_0x156927(0x236)]<0x4)continue;const _0x4a3428=[];for(const _0x1da59b of _0x23c67d){const _0x2a77c6=_0x27e03b(_0x1da59b);if(_0x2a77c6[_0x156927(0x236)]>=0x4)_0x4a3428[_0x156927(0x217)](_0x2a77c6);}_0x372551[_0x156927(0x217)]({'type':_0x156927(0x1ee),'properties':{'z':_0x33e734},'geometry':{'type':_0x156927(0x202),'coordinates':[_0x4313ad,..._0x4a3428]}});}}}_0x372551[_0x156927(0x236)]&&this[_0x156927(0x22c)][_0x156927(0x218)](_0x33e734,_0x372551);}}if(typeof _0x22044b!=='undefined'){const _0x40a3ac=this[_0x156927(0x22c)][_0x156927(0x1fe)](_0x22044b)||[],_0x38a1d5=this[_0x156927(0x1db)]?this[_0x156927(0x1db)](_0x40a3ac):_0x40a3ac;return{'type':'FeatureCollection','features':_0x38a1d5};}const _0x5c71ed=[];for(const _0x45fbe5 of this[_0x156927(0x22c)][_0x156927(0x21c)]()){_0x5c71ed[_0x156927(0x217)](..._0x45fbe5);}const _0x2c0765=this['sortFeaturesByArea']?this['sortFeaturesByArea'](_0x5c71ed):_0x5c71ed;return{'type':_0x156927(0x1e3),'features':_0x2c0765};}['getJsonData'](){const _0xf6a536=a3_0x410f6c,_0x2e7a8d=Array[_0xf6a536(0x213)]({'length':this['nx']});for(let _0x239ddf=0x0;_0x239ddf<this['nx'];_0x239ddf++){_0x2e7a8d[_0x239ddf]=new a3_0x1ddee9(this[_0xf6a536(0x227)])[_0xf6a536(0x1e8)](new a3_0x1ddee9(_0x239ddf)[_0xf6a536(0x22b)](this['gjLng']))[_0xf6a536(0x225)]();}const _0x2fe1d8=Array[_0xf6a536(0x213)]({'length':this['ny']});for(let _0x13bad3=0x0;_0x13bad3<this['ny'];_0x13bad3++){_0x2fe1d8[_0x13bad3]=new a3_0x1ddee9(this[_0xf6a536(0x224)])[_0xf6a536(0x1e8)](new a3_0x1ddee9(_0x13bad3)['times'](this['gjLat']))[_0xf6a536(0x225)]();}const _0x28d68a=Array[_0xf6a536(0x213)]({'length':this['nx']*this['ny']});for(let _0x473c3f=0x0;_0x473c3f<this[_0xf6a536(0x21c)][_0xf6a536(0x236)];_0x473c3f++){const _0x2c3cd5=Math[_0xf6a536(0x1eb)](_0x473c3f/this['nx']),_0x29b6cf=_0x473c3f%this['nx'],_0x5221c6=_0x2e7a8d[_0x29b6cf],_0x2aab5c=_0x2fe1d8[_0x2c3cd5],_0x21c19d=this['values'][_0x473c3f];_0x2aab5c&&_0x5221c6&&(_0x28d68a[_0x473c3f]={'lng':_0x5221c6,'lat':_0x2aab5c,'val':_0x21c19d});}return _0x28d68a;}[a3_0x410f6c(0x237)](){const _0x402c30=a3_0x410f6c;let _0x2fe8cf=-Infinity,_0x38efd9=Infinity;for(let _0x1cad6b=0x0;_0x1cad6b<this[_0x402c30(0x21c)][_0x402c30(0x236)];_0x1cad6b++){const _0x40a59c=this[_0x402c30(0x21c)][_0x1cad6b];if(_0x40a59c>_0x2fe8cf)_0x2fe8cf=_0x40a59c;if(_0x40a59c<_0x38efd9)_0x38efd9=_0x40a59c;}this['minVal']=_0x38efd9,this[_0x402c30(0x230)]=_0x2fe8cf;}[a3_0x410f6c(0x1df)](){const _0x2c60c9=a3_0x410f6c,_0x3d0f39=[];if(this[_0x2c60c9(0x200)]===Infinity||this[_0x2c60c9(0x230)]===-Infinity)return _0x3d0f39;for(let _0x1bc66e=this['minVal']-0x1;_0x1bc66e<=this[_0x2c60c9(0x230)]+0x1;_0x1bc66e++){_0x3d0f39[_0x2c60c9(0x217)](_0x1bc66e);}return _0x3d0f39;}['sortFeaturesByArea'](_0x25b453){const _0x58f845=a3_0x410f6c;return _0x25b453[_0x58f845(0x1f4)](_0x435633=>{const _0x433f7f=_0x58f845;try{const _0x473b60=a3_0x4e0606(_0x435633)||0x0;_0x435633[_0x433f7f(0x22a)]={..._0x435633[_0x433f7f(0x22a)]||{},'__area':_0x473b60};}catch{_0x435633['properties']={..._0x435633[_0x433f7f(0x22a)]||{},'__area':0x0};}return _0x435633;})[_0x58f845(0x22f)]((_0x125fdf,_0x421e04)=>_0x421e04[_0x58f845(0x22a)][_0x58f845(0x1f5)]-_0x125fdf[_0x58f845(0x22a)][_0x58f845(0x1f5)])[_0x58f845(0x219)](_0x57d05a=>_0x57d05a[_0x58f845(0x22a)]&&_0x58f845(0x1f5)in _0x57d05a[_0x58f845(0x22a)]&&_0x57d05a[_0x58f845(0x22a)][_0x58f845(0x1f5)]!==0x0)['map'](_0xa9b774=>{const _0x68c916=_0x58f845;if(_0xa9b774['properties']&&_0x68c916(0x1f5)in _0xa9b774[_0x68c916(0x22a)]){const {__area:_0x50cda6,..._0xc58d9d}=_0xa9b774[_0x68c916(0x22a)];_0xa9b774[_0x68c916(0x22a)]=_0xc58d9d;}return _0xa9b774;});}['chunkArray']=(_0x313142,_0x59aaf9)=>{const _0x2a0fa7=a3_0x410f6c,_0x43e1e1=[],_0x101c20=Math[_0x2a0fa7(0x222)](0x1,Math[_0x2a0fa7(0x229)](_0x313142[_0x2a0fa7(0x236)]/_0x59aaf9));for(let _0x15aae5=0x0;_0x15aae5<_0x59aaf9;_0x15aae5++){_0x43e1e1[_0x2a0fa7(0x217)](_0x313142[_0x2a0fa7(0x1ec)](_0x15aae5*_0x101c20,(_0x15aae5+0x1)*_0x101c20));}return _0x43e1e1;};}export default readFileM4;function a3_0x23fe(){const _0x211826=['27893052hAzBLR','filePath','values','56CAJmPQ','string','clear','_maskCacheKey','convertTemKtoC','max','abs','minLat','toNumber','indexOf','minLng','start','ceil','properties','times','_maskCache','replace','getIsoBandsImage','sort','maxVal','getIsoBandsByLayerBreak','setParams','trim','ring','height','length','getMinMax','features','moveTo','lineTo','8nkJYlS','gjLng','canvas','clearMaskCache','sortFeaturesByArea','isNaN','plusOffset','getIsoBandsFastByWorker','getBreaks','5RpDXGA','width','263964rFVGCI','FeatureCollection','beginPath','module','clipDataByJson','size','plus','value','createElement','floor','slice','16zFKSnk','Feature','contours','chunkArray','postMessage','thresholds','275838tgYOhb','map','__area','791228CZqnZW','error','min','5341509jEagbL','onerror','hardwareConcurrency','onmessage','undefined','get','number','minVal','coordinates','Polygon','data','pixelRatio','all','getColorFast','gjLat','flat','split','fill','62542DvTWqY','text','forEach','getIsoBandsFast','5700610bahaUS','terminate','该时次文件数据异常','fillStyle','from','scale','isArray','closePath','push','set','filter'];a3_0x23fe=function(){return _0x211826;};return a3_0x23fe();}
|
|
1
|
+
const a4_0x2336f7=a4_0x31a7;function a4_0x31a7(_0x248111,_0x505275){const _0xb37e80=a4_0xb37e();return a4_0x31a7=function(_0x31a75a,_0x15d066){_0x31a75a=_0x31a75a-0x175;let _0x4fe0f3=_0xb37e80[_0x31a75a];return _0x4fe0f3;},a4_0x31a7(_0x248111,_0x505275);}(function(_0x58a252,_0x55d39f){const _0x211742=a4_0x31a7,_0x1f26ff=_0x58a252();while(!![]){try{const _0x316b33=parseInt(_0x211742(0x1bb))/0x1+-parseInt(_0x211742(0x1e3))/0x2*(parseInt(_0x211742(0x1a4))/0x3)+parseInt(_0x211742(0x1e1))/0x4*(-parseInt(_0x211742(0x1b6))/0x5)+parseInt(_0x211742(0x1bf))/0x6*(parseInt(_0x211742(0x17f))/0x7)+parseInt(_0x211742(0x1e6))/0x8*(parseInt(_0x211742(0x1cf))/0x9)+-parseInt(_0x211742(0x1a3))/0xa+-parseInt(_0x211742(0x1ae))/0xb*(-parseInt(_0x211742(0x187))/0xc);if(_0x316b33===_0x55d39f)break;else _0x1f26ff['push'](_0x1f26ff['shift']());}catch(_0x522680){_0x1f26ff['push'](_0x1f26ff['shift']());}}}(a4_0xb37e,0x1b18c));import{contours}from'd3-contour';function a4_0xb37e(){const _0x1ce6b6=['getIsoBandsCanvasByMap','module','FeatureCollection','isNaN','9mBhuGl','text','fill','minus','from','_maskCache','filter','Feature','value','chunkArray','getJsonData','min','data','get','lineTo','buildGridCanvas','clip','area','344tVgttg','updateGridCanvas','376982KUkVop','lineWidth','contours','483736wvzhfm','getColorFast','length','start','all','gjLat','filePath','isArray','forEach','Polygon','map','strokeStyle','times','undefined','该时次文件数据异常','getBreaks','clearMaskCache','hardwareConcurrency','21vVtIKV','sort','string','onerror','clear','values','split','getIsoBandsCanvas','21720VuUQdO','lng','set','style','properties','getContext','beginPath','flat','thresholds','fillStyle','trim','plusOffset','plus','scale','number','rgba(','setParams','minLng','height','lat','floor','max','convertTemKtoC','minLat','onmessage','coordinates','moveTo','restore','13270GwpsIJ','3XqIidt','getIsoBandsByLayerBreak','terminate','ring','getAllGeo','getMinMax','stroke','toNumber','maxVal','clipDataByJson','132RArxEJ','features','__area','push','abs','createElement','size','val','2785HMVine','getIsoBandsFast','drawImage','geometry','createCanvas','134464pjvNBi','replace','width','sortFeaturesByArea','264114qLuHls','buildGridLineCanvas','closePath','save','gjLng','latLngToLayerPoint','#FFFFFF','postMessage','minVal','rgba(255,255,255,0)','round','_maskCacheKey'];a4_0xb37e=function(){return _0x1ce6b6;};return a4_0xb37e();}import a4_0x154eb7 from'@turf/area';import{featureCollection as a4_0x3fb78f,point,polygon}from'@turf/helpers';import{booleanPointInPolygon}from'@turf/boolean-point-in-polygon';import a4_0x30e44c from'decimal.js';export class readFileM4{[a4_0x2336f7(0x1ec)]='';['nx']=0x0;['ny']=0x0;[a4_0x2336f7(0x198)]=0x0;[a4_0x2336f7(0x19e)]=0x0;['gjLng']=0x0;[a4_0x2336f7(0x1eb)]=0x0;[a4_0x2336f7(0x184)]=[];[a4_0x2336f7(0x1ac)]=-Infinity;[a4_0x2336f7(0x1c7)]=Infinity;[a4_0x2336f7(0x1ca)]='';[a4_0x2336f7(0x1d4)]=new Map();constructor(_0x231ecc){const _0x5d0f63=a4_0x2336f7;this[_0x5d0f63(0x1ec)]=_0x231ecc||'';}async[a4_0x2336f7(0x1e9)](_0x17fedc){const _0x3abbcc=a4_0x2336f7,_0x189462=await fetch(this[_0x3abbcc(0x1ec)]);if(!_0x189462['ok'])return new Promise((_0x323055,_0x2bd222)=>{_0x2bd222(new Error('该时次未获取到文件'));});const _0x4104eb=await _0x189462[_0x3abbcc(0x1d0)](),_0x3113d9=_0x4104eb[_0x3abbcc(0x1bc)](/\r\n/g,'\x0a')[_0x3abbcc(0x1bc)](/\r/g,'\x0a')[_0x3abbcc(0x185)]('\x0a');if(_0x3113d9['length']<0x4)return new Promise((_0x8aa8f9,_0x4a3caf)=>{const _0x5907e1=_0x3abbcc;_0x4a3caf(new Error(_0x5907e1(0x17b)));});const _0x180dda=(_0x3113d9[0x1]??'')[_0x3abbcc(0x191)]()['split'](/\s+/);let _0x50df83=0x2;while(_0x180dda['length']<0x13){_0x180dda[_0x3abbcc(0x1b1)](...(_0x3113d9[_0x50df83]??'')[_0x3abbcc(0x191)]()['split'](/\s+/)),_0x50df83++;}this[_0x3abbcc(0x1c3)]=Number(_0x180dda[0x6]);const _0x2bf826=Number(_0x180dda[0x8]),_0x400a3c=Number(_0x180dda[0xa]),_0x52c691=Number(_0x180dda[0xb]);this['nx']=Number(_0x180dda[0xc]),this['ny']=Number(_0x180dda[0xd]),this['minLng']=_0x2bf826,this[_0x3abbcc(0x19e)]=_0x400a3c,this[_0x3abbcc(0x1eb)]=Math[_0x3abbcc(0x1b2)](Number(_0x180dda[0x7]))*(_0x400a3c>_0x52c691?-0x1:0x1);const _0x684313=this['nx']*this['ny'];let _0xffe61f=0x0;for(let _0x5d63fb=_0x50df83;_0x5d63fb<_0x3113d9[_0x3abbcc(0x1e8)]&&_0xffe61f<_0x684313;_0x5d63fb++){const _0x4477ad=_0x3113d9[_0x5d63fb]?.[_0x3abbcc(0x191)]()??'',_0x14c060=_0x4477ad[_0x3abbcc(0x185)](/\s+/);if(!_0x14c060||_0x14c060['length']===0x0)continue;for(let _0x3b2e2d=0x0;_0x3b2e2d<_0x14c060[_0x3abbcc(0x1e8)]&&_0xffe61f<_0x684313;_0x3b2e2d++){let _0x19df4c=Number(_0x14c060[_0x3b2e2d]);if(_0x17fedc?.['convertTemKtoC'])_0x19df4c=new a4_0x30e44c(_0x19df4c)[_0x3abbcc(0x1d2)](272.15)[_0x3abbcc(0x1ab)]();else _0x17fedc?.['plusOffset']&&(_0x19df4c=new a4_0x30e44c(_0x19df4c)[_0x3abbcc(0x193)](_0x17fedc[_0x3abbcc(0x192)])[_0x3abbcc(0x1ab)]());this['values']['push'](_0x19df4c),this[_0x3abbcc(0x1c7)]=Math[_0x3abbcc(0x1da)](this[_0x3abbcc(0x1c7)],_0x19df4c),this['maxVal']=Math['max'](this['maxVal'],_0x19df4c),_0xffe61f++;}}}[a4_0x2336f7(0x197)](_0x1611cd,_0x33deca){const _0x41ae0f=a4_0x2336f7;this['nx']=_0x1611cd['nx'],this['ny']=_0x1611cd['ny'],this[_0x41ae0f(0x198)]=_0x1611cd[_0x41ae0f(0x198)],this['minLat']=_0x1611cd['minLat'],this[_0x41ae0f(0x1c3)]=_0x1611cd['gjLng'],this[_0x41ae0f(0x1eb)]=_0x1611cd[_0x41ae0f(0x1eb)];if(_0x33deca?.[_0x41ae0f(0x19d)])for(let _0x40c23e=0x0;_0x40c23e<_0x1611cd[_0x41ae0f(0x184)][_0x41ae0f(0x1e8)];_0x40c23e++){if(typeof _0x1611cd[_0x41ae0f(0x184)][_0x40c23e]===_0x41ae0f(0x17a))continue;_0x1611cd[_0x41ae0f(0x184)][_0x40c23e]=new a4_0x30e44c(_0x1611cd[_0x41ae0f(0x184)][_0x40c23e])[_0x41ae0f(0x1d2)](272.15)[_0x41ae0f(0x1ab)]();}else{if(_0x33deca?.[_0x41ae0f(0x192)])for(let _0x37fdc9=0x0;_0x37fdc9<_0x1611cd[_0x41ae0f(0x184)]['length'];_0x37fdc9++){if(typeof _0x1611cd[_0x41ae0f(0x184)][_0x37fdc9]==='undefined')continue;_0x1611cd[_0x41ae0f(0x184)][_0x37fdc9]=new a4_0x30e44c(_0x1611cd[_0x41ae0f(0x184)][_0x37fdc9])[_0x41ae0f(0x193)](_0x33deca[_0x41ae0f(0x192)])[_0x41ae0f(0x1ab)]();}else this[_0x41ae0f(0x184)]=_0x1611cd[_0x41ae0f(0x184)];}this[_0x41ae0f(0x1a9)]();}[a4_0x2336f7(0x1b7)](_0x3e7178){const _0x16e5bb=a4_0x2336f7;if(this[_0x16e5bb(0x184)][_0x16e5bb(0x1e8)]===0x0)return{'type':'FeatureCollection','features':[]};const _0x524564=[],_0x25cf55=this['getAllGeo'](_0x3e7178),_0x3875a3=new a4_0x30e44c(this[_0x16e5bb(0x198)]),_0x36aaf9=new a4_0x30e44c(this[_0x16e5bb(0x19e)]),_0x2fe4e4=new a4_0x30e44c(this[_0x16e5bb(0x1c3)]),_0x3ab158=new a4_0x30e44c(this[_0x16e5bb(0x1eb)]);for(const _0x198d37 of _0x25cf55){for(const _0x30ef84 of _0x198d37[_0x16e5bb(0x1a0)]){if(Array[_0x16e5bb(0x1ed)](_0x30ef84))for(const _0x9fa4 of _0x30ef84){_0x9fa4[_0x16e5bb(0x175)](_0x4eeae0=>{const _0x2b7d2c=_0x16e5bb,_0x4f86f0=_0x4eeae0[0x0],_0x221ac0=_0x4eeae0[0x1];if(_0x4f86f0==null||_0x221ac0==null||Number['isNaN'](_0x4f86f0)||Number[_0x2b7d2c(0x1ce)](_0x221ac0))return null;const _0x451901=_0x3875a3['plus'](_0x2fe4e4[_0x2b7d2c(0x179)](_0x4f86f0))['toNumber'](),_0x9cf4e7=_0x36aaf9[_0x2b7d2c(0x193)](_0x3ab158[_0x2b7d2c(0x179)](_0x221ac0))[_0x2b7d2c(0x1ab)]();_0x4eeae0[0x0]=_0x451901,_0x4eeae0[0x1]=_0x9cf4e7;});}}_0x524564[_0x16e5bb(0x1b1)]({'type':_0x16e5bb(0x1d6),'properties':{'z':_0x198d37[_0x16e5bb(0x1d7)]},'geometry':_0x198d37});}return{'type':_0x16e5bb(0x1cd),'features':_0x524564};}[a4_0x2336f7(0x186)](_0x521d22,_0x4a17ff,_0x2bbf80){const _0xdba749=a4_0x2336f7;if(this[_0xdba749(0x184)][_0xdba749(0x1e8)]===0x0)return null;const _0x375a2c=this[_0xdba749(0x1a8)](_0x521d22),{canvas:_0x5bfb91,ctx:_0x314b59,width:_0x57c740,height:_0x2bd538}=this[_0xdba749(0x1ba)](_0x2bbf80);if(!_0x314b59)return null;for(const _0xf94f14 of _0x375a2c){const _0x1c7890=_0xf94f14[_0xdba749(0x1d7)];_0x314b59[_0xdba749(0x18d)]();for(const _0xf2456b of _0xf94f14[_0xdba749(0x1a0)]){if(Array[_0xdba749(0x1ed)](_0xf2456b))for(const _0x38e2f3 of _0xf2456b){_0x38e2f3[_0xdba749(0x175)]((_0x2e2574,_0x10c7e6)=>{const _0x1f0006=_0xdba749,_0x1ebc3e=_0x2e2574[0x0],_0x14601a=_0x2e2574[0x1];if(_0x1ebc3e==null||_0x14601a==null||Number['isNaN'](_0x1ebc3e)||Number[_0x1f0006(0x1ce)](_0x14601a))return null;const _0x1db3e6=_0x1ebc3e/this['nx']*_0x57c740,_0x248b7a=_0x2bd538-_0x14601a/this['ny']*_0x2bd538;_0x10c7e6===0x0?_0x314b59[_0x1f0006(0x1a1)](_0x1db3e6,_0x248b7a):_0x314b59[_0x1f0006(0x1dd)](_0x1db3e6,_0x248b7a);});}}_0x314b59['closePath'](),_0x314b59['fillStyle']=this[_0xdba749(0x1e7)](_0x1c7890,_0x521d22,_0x4a17ff),_0x314b59['fill']();}return _0x5bfb91;}[a4_0x2336f7(0x1cb)](_0x239213,_0x51a5d8,_0x4e30bf,_0x44d98c){const _0x337264=a4_0x2336f7;if(this[_0x337264(0x184)][_0x337264(0x1e8)]===0x0)return null;if(!_0x4e30bf)return null;const _0x64c054=this[_0x337264(0x198)],_0x308deb=this['minLat'],_0x11e844=_0x64c054+this['nx']*this[_0x337264(0x1c3)],_0x117713=_0x308deb+this['ny']*this['gjLat'],_0x41f35e=_0x4e30bf[_0x337264(0x1c4)]([_0x117713,_0x64c054]),_0xc87780=_0x4e30bf['latLngToLayerPoint']([_0x308deb,_0x11e844]),_0x1473ea=Math[_0x337264(0x19c)](0x1,Math[_0x337264(0x1c9)](_0xc87780['x']-_0x41f35e['x'])),_0x19b4dd=Math[_0x337264(0x19c)](0x1,Math[_0x337264(0x1c9)](_0xc87780['y']-_0x41f35e['y'])),_0x2c2cf0=_0x44d98c?.['pixelRatio']||(typeof devicePixelRatio!==_0x337264(0x17a)?devicePixelRatio:0x1),_0x1dbf6a=document[_0x337264(0x1b3)]('canvas'),_0x69d28e=_0x1dbf6a['getContext']('2d');_0x1dbf6a[_0x337264(0x1bd)]=Math[_0x337264(0x19c)](0x1,Math[_0x337264(0x19b)](_0x1473ea*_0x2c2cf0)),_0x1dbf6a['height']=Math['max'](0x1,Math[_0x337264(0x19b)](_0x19b4dd*_0x2c2cf0)),_0x1dbf6a[_0x337264(0x18a)]['width']=_0x1473ea+'px',_0x1dbf6a[_0x337264(0x18a)][_0x337264(0x199)]=_0x19b4dd+'px';if(_0x69d28e)_0x69d28e[_0x337264(0x194)](_0x2c2cf0,_0x2c2cf0);const _0x4aac13=this[_0x337264(0x1a8)](_0x239213);for(const _0x5616d5 of _0x4aac13){const _0x566968=_0x5616d5['value'];if(!_0x5616d5['coordinates'])continue;_0x69d28e[_0x337264(0x18d)]();for(const _0x3a54ba of _0x5616d5[_0x337264(0x1a0)]){if(Array[_0x337264(0x1ed)](_0x3a54ba))for(const _0x47280c of _0x3a54ba){_0x47280c['forEach']((_0x4bf905,_0x52e85c)=>{const _0x26eb6f=_0x337264,_0x4c4ac0=_0x4bf905[0x0],_0x161c26=_0x4bf905[0x1];if(_0x4c4ac0==null||_0x161c26==null||Number['isNaN'](_0x4c4ac0)||Number[_0x26eb6f(0x1ce)](_0x161c26))return;const _0x2fa7c=_0x64c054+_0x4c4ac0*this[_0x26eb6f(0x1c3)],_0x824b41=_0x308deb+_0x161c26*this[_0x26eb6f(0x1eb)],_0x4ffebb=_0x4e30bf[_0x26eb6f(0x1c4)]([_0x824b41,_0x2fa7c]),_0x584c00=_0x4ffebb['x']-_0x41f35e['x'],_0xb2b0a7=_0x4ffebb['y']-_0x41f35e['y'];if(_0x52e85c===0x0)_0x69d28e[_0x26eb6f(0x1a1)](_0x584c00,_0xb2b0a7);else _0x69d28e[_0x26eb6f(0x1dd)](_0x584c00,_0xb2b0a7);});}}_0x69d28e[_0x337264(0x1c1)](),_0x69d28e[_0x337264(0x190)]=this['getColorFast'](_0x566968,_0x239213,_0x51a5d8),_0x69d28e[_0x337264(0x1d1)]();}return _0x1dbf6a;}[a4_0x2336f7(0x1e7)](_0x1770f1,_0x5a907a,_0x316edb){const _0x390a3e=a4_0x2336f7;let _0x5126be=_0x390a3e(0x1c8);const _0x2293cf=_0x5a907a['indexOf'](_0x1770f1);if(typeof _0x316edb[_0x2293cf]=='string')_0x5126be=_0x316edb[_0x2293cf];else _0x2293cf!==-0x1&&(_0x5126be='rgba('+_0x316edb[_0x2293cf][0x0]+','+_0x316edb[_0x2293cf][0x1]+','+_0x316edb[_0x2293cf][0x2]+','+(_0x316edb[_0x2293cf][0x3]||_0x316edb[_0x2293cf][0x3]===0x0?_0x316edb[_0x2293cf][0x3]:0x1)+')');return _0x5126be;}async[a4_0x2336f7(0x1ad)](_0x2959db,_0x55bfd9,_0x8e7cee,_0x41f102){const _0x2afb63=a4_0x2336f7,_0x4e5b4e=_0x41f102||(navigator[_0x2afb63(0x17e)]-0x4||0x1),_0x20f9ba=Math[_0x2afb63(0x1da)](_0x4e5b4e,Math['max'](0x1,_0x2959db[_0x2afb63(0x1af)][_0x2afb63(0x1e8)])),_0x56e4f4=this[_0x2afb63(0x1d8)](_0x2959db['features'],_0x20f9ba),_0x4465b3=[],_0x3fa8b3=_0x56e4f4['map'](_0x140d8b=>{const _0x180ba9=_0x2afb63,_0x34b89a=new Worker(_0x8e7cee,{'type':'module'});return _0x4465b3[_0x180ba9(0x1b1)](_0x34b89a),new Promise(_0x3bace2=>{const _0x3087f3=_0x180ba9;_0x34b89a[_0x3087f3(0x19f)]=_0x2bcec6=>{const _0x2ddb89=_0x3087f3;_0x3bace2(_0x2bcec6[_0x2ddb89(0x1db)]['features']);},_0x34b89a[_0x3087f3(0x182)]=_0x44971a=>{console['error'](_0x44971a);},_0x34b89a[_0x3087f3(0x1c6)]({'isoChunk':_0x140d8b,'gansuFeatures':_0x55bfd9[_0x3087f3(0x1af)]});});}),_0x3c8feb=await Promise[_0x2afb63(0x1ea)](_0x3fa8b3);_0x4465b3[_0x2afb63(0x175)](_0x22bf12=>_0x22bf12[_0x2afb63(0x1a6)]());const _0x58b3a6=_0x3c8feb[_0x2afb63(0x18e)]();return a4_0x3fb78f(_0x58b3a6);}async['getIsoBandsFastByWorker'](_0x1cea57,_0x3a72fc,_0x2b6d98){const _0x3b343b=a4_0x2336f7;if(this['values'][_0x3b343b(0x1e8)]===0x0)return{'type':_0x3b343b(0x1cd),'features':[]};let _0x5ed8d6=[];if(_0x1cea57['length']===0x0)_0x1cea57=this[_0x3b343b(0x17c)]();const _0x2703a6=[],_0x59d34a=_0x2b6d98||(navigator[_0x3b343b(0x17e)]-0x4||0x1),_0x316027=Math[_0x3b343b(0x1da)](_0x59d34a,Math[_0x3b343b(0x19c)](0x1,_0x1cea57[_0x3b343b(0x1e8)])),_0x273727=this[_0x3b343b(0x1d8)](_0x1cea57,_0x316027),_0x263ddd=_0x273727[_0x3b343b(0x177)](_0x11c670=>{const _0x5eee91=_0x3b343b,_0x4bee38=new Worker(_0x3a72fc,{'type':_0x5eee91(0x1cc)});return _0x2703a6['push'](_0x4bee38),new Promise(_0x55ff08=>{const _0xe31962=_0x5eee91;_0x4bee38['onmessage']=_0x47d62e=>{const _0x5ea133=a4_0x31a7;_0x55ff08(_0x47d62e['data'][_0x5ea133(0x1af)]);},_0x4bee38[_0xe31962(0x182)]=_0x4935d0=>{console['error'](_0x4935d0);},_0x4bee38[_0xe31962(0x1c6)]({'breaks':_0x11c670,'values':this[_0xe31962(0x184)],'nx':this['nx'],'ny':this['ny'],'minVal':this['minVal'],'maxVal':this['maxVal'],'minLng':this[_0xe31962(0x198)],'minLat':this['minLat'],'gjLng':this[_0xe31962(0x1c3)],'gjLat':this[_0xe31962(0x1eb)]});});}),_0xa30cfd=await Promise[_0x3b343b(0x1ea)](_0x263ddd);return _0x2703a6[_0x3b343b(0x175)](_0x7e4757=>_0x7e4757['terminate']()),_0xa30cfd['forEach'](_0x150ce5=>{const _0x14ae73=_0x3b343b;_0x5ed8d6[_0x14ae73(0x1b1)](..._0x150ce5);}),_0x5ed8d6=this['sortFeaturesByArea'](_0x5ed8d6),{'type':_0x3b343b(0x1cd),'features':_0x5ed8d6};}[a4_0x2336f7(0x17d)](){const _0x31a550=a4_0x2336f7;this[_0x31a550(0x1d4)][_0x31a550(0x183)]();}[a4_0x2336f7(0x1a5)](_0x5a262c=[],_0x4700ad){const _0x2c6849=a4_0x2336f7;if(typeof _0x4700ad!==_0x2c6849(0x17a)&&this[_0x2c6849(0x1d4)][_0x2c6849(0x1dc)](_0x4700ad)){const _0x528995=this[_0x2c6849(0x1d4)][_0x2c6849(0x1dc)](_0x4700ad)||[],_0x342661=this[_0x2c6849(0x1be)]?this[_0x2c6849(0x1be)](_0x528995):_0x528995;return{'type':_0x2c6849(0x1cd),'features':_0x342661};}if(this['values'][_0x2c6849(0x1e8)]===0x0)return{'type':_0x2c6849(0x1cd),'features':[]};if(_0x5a262c[_0x2c6849(0x1e8)]===0x0)_0x5a262c=this[_0x2c6849(0x17c)]();const _0x57d837=_0x5a262c['join'](',');if(this[_0x2c6849(0x1ca)]!==_0x57d837){this[_0x2c6849(0x1ca)]=_0x57d837,this[_0x2c6849(0x1d4)][_0x2c6849(0x183)]();const _0x1c972a=this['minLng'],_0x47b5e5=this['minLat'],_0x5aa570=this['gjLng'],_0x4591=this[_0x2c6849(0x1eb)],_0x53a058=_0x50a95a=>{const _0x49490f=_0x2c6849;let _0x3371df=0x0;for(let _0x2320d1=0x0,_0x316e9c=_0x50a95a[_0x49490f(0x1e8)];_0x2320d1<_0x316e9c;_0x2320d1++){const _0xfec75e=_0x50a95a[_0x2320d1][0x0],_0x6bc0e6=_0x50a95a[_0x2320d1][0x1],_0x346cd1=_0x50a95a[(_0x2320d1+0x1)%_0x316e9c][0x0],_0x366288=_0x50a95a[(_0x2320d1+0x1)%_0x316e9c][0x1];if(_0xfec75e==null||_0x6bc0e6==null||_0x346cd1==null||_0x366288==null)continue;_0x3371df+=_0xfec75e*_0x366288-_0x346cd1*_0x6bc0e6;}return _0x3371df/0x2;},_0x4ccd25=(_0x30d845,_0x588ad2)=>{const _0x4d4448=_0x2c6849;if(!_0x30d845)return![];const _0x16c8c1=_0x30d845[0x0],_0x41766c=_0x30d845[0x1];let _0x49445f=![];for(let _0x149ee4=0x0,_0x418c56=_0x588ad2[_0x4d4448(0x1e8)]-0x1;_0x149ee4<_0x588ad2['length'];_0x418c56=_0x149ee4++){const _0xc7f7f2=_0x588ad2[_0x149ee4][0x0],_0x4f09ca=_0x588ad2[_0x149ee4][0x1],_0x302905=_0x588ad2[_0x418c56][0x0],_0x560da2=_0x588ad2[_0x418c56][0x1],_0x15d957=_0x4f09ca>_0x41766c!==_0x560da2>_0x41766c&&_0x16c8c1<(_0x302905-_0xc7f7f2)*(_0x41766c-_0x4f09ca)/(_0x560da2-_0x4f09ca)+_0xc7f7f2;if(_0x15d957)_0x49445f=!_0x49445f;}return _0x49445f;},_0x1421e3=_0x2cdacf=>{const _0x44824d=_0x2c6849,_0x2ef86b=[];let _0x88f054=null,_0x79efcd=null;for(let _0x57aa39=0x0;_0x57aa39<_0x2cdacf[_0x44824d(0x1e8)];_0x57aa39++){const _0x568707=_0x2cdacf[_0x57aa39];if(!_0x568707)continue;const _0x5199b8=_0x568707[0x0],_0x3ae631=_0x568707[0x1];if(_0x5199b8==null||_0x3ae631==null||Number['isNaN'](_0x5199b8)||Number[_0x44824d(0x1ce)](_0x3ae631))continue;const _0x2d1fcd=_0x1c972a+_0x5199b8*_0x5aa570,_0x264e17=_0x47b5e5+_0x3ae631*_0x4591;if(_0x88f054!==null&&_0x79efcd!==null&&_0x88f054===_0x2d1fcd&&_0x79efcd===_0x264e17){_0x88f054=_0x2d1fcd,_0x79efcd=_0x264e17;continue;}_0x2ef86b[_0x44824d(0x1b1)]([_0x2d1fcd,_0x264e17]),_0x88f054=_0x2d1fcd,_0x79efcd=_0x264e17;}if(_0x2ef86b[_0x44824d(0x1e8)]===0x0)return _0x2ef86b;const _0x5e9042=_0x2ef86b[0x0],_0x40fc2f=_0x2ef86b[_0x2ef86b[_0x44824d(0x1e8)]-0x1];if(_0x5e9042[0x0]!==_0x40fc2f[0x0]||_0x5e9042[0x1]!==_0x40fc2f[0x1])_0x2ef86b[_0x44824d(0x1b1)]([_0x5e9042[0x0],_0x5e9042[0x1]]);return _0x2ef86b;},_0x12216c=_0x5a262c[_0x2c6849(0x1e8)]-0x1;for(let _0x16c339=0x0;_0x16c339<_0x5a262c[_0x2c6849(0x1e8)];_0x16c339++){const _0x1d9d67=_0x5a262c[_0x16c339],_0x5952ac=_0x16c339<_0x12216c?_0x5a262c[_0x16c339+0x1]:Infinity,_0x320ccc=Array[_0x2c6849(0x1d3)]({'length':this[_0x2c6849(0x184)][_0x2c6849(0x1e8)]});let _0x50c8cd=![];for(let _0x19f2ac=0x0;_0x19f2ac<this[_0x2c6849(0x184)]['length'];_0x19f2ac++){const _0x361d15=this['values'][_0x19f2ac],_0x18ab1f=_0x361d15>=_0x1d9d67&&_0x361d15<_0x5952ac?0x1:0x0;if(_0x18ab1f)_0x50c8cd=!![];_0x320ccc[_0x19f2ac]=_0x18ab1f;}if(!_0x50c8cd)continue;const _0x306f36=contours()[_0x2c6849(0x1b4)]([this['nx'],this['ny']])[_0x2c6849(0x18f)]([0.5]),_0x376b34=_0x306f36[_0x2c6849(0x1e5)]?_0x306f36[_0x2c6849(0x1e5)](_0x320ccc):_0x306f36(_0x320ccc);if(!_0x376b34||_0x376b34[_0x2c6849(0x1e8)]===0x0)continue;const _0x2991b5=[];for(const _0x535129 of _0x376b34){const _0x500770=_0x535129&&_0x535129[_0x2c6849(0x1a0)];if(!_0x500770)continue;for(const _0x9b08c7 of _0x500770){let _0x13a47a=[];if(Array['isArray'](_0x9b08c7)&&_0x9b08c7['length']>0x0&&typeof _0x9b08c7[0x0][0x0]===_0x2c6849(0x195))_0x13a47a=[_0x9b08c7];else{if(Array[_0x2c6849(0x1ed)](_0x9b08c7))_0x13a47a=_0x9b08c7;else continue;}const _0x132a57=_0x13a47a[_0x2c6849(0x177)](_0xf0612f=>({'ring':_0xf0612f,'area':Math[_0x2c6849(0x1b2)](_0x53a058(_0xf0612f))}))[_0x2c6849(0x180)]((_0x400740,_0x171072)=>_0x171072['area']-_0x400740[_0x2c6849(0x1e0)]),_0x461aa3=Array[_0x2c6849(0x1d3)]({'length':_0x132a57['length']})[_0x2c6849(0x1d1)](![]);for(let _0x4f3d38=0x0;_0x4f3d38<_0x132a57[_0x2c6849(0x1e8)];_0x4f3d38++){if(_0x461aa3[_0x4f3d38])continue;const _0x3f029d=_0x132a57[_0x4f3d38][_0x2c6849(0x1a7)];_0x461aa3[_0x4f3d38]=!![];const _0x3ef24c=[];for(let _0x4374f9=0x0;_0x4374f9<_0x132a57[_0x2c6849(0x1e8)];_0x4374f9++){if(_0x461aa3[_0x4374f9])continue;const _0x43f19c=_0x132a57[_0x4374f9][_0x2c6849(0x1a7)],_0x39b956=_0x43f19c[0x0];_0x39b956&&_0x4ccd25(_0x39b956,_0x3f029d)&&(_0x3ef24c[_0x2c6849(0x1b1)](_0x43f19c),_0x461aa3[_0x4374f9]=!![]);}const _0x35151e=_0x1421e3(_0x3f029d);if(_0x35151e[_0x2c6849(0x1e8)]<0x4)continue;const _0x5b4563=[];for(const _0x195c5d of _0x3ef24c){const _0x57bb50=_0x1421e3(_0x195c5d);if(_0x57bb50[_0x2c6849(0x1e8)]>=0x4)_0x5b4563[_0x2c6849(0x1b1)](_0x57bb50);}_0x2991b5[_0x2c6849(0x1b1)]({'type':_0x2c6849(0x1d6),'properties':{'z':_0x1d9d67},'geometry':{'type':_0x2c6849(0x176),'coordinates':[_0x35151e,..._0x5b4563]}});}}}_0x2991b5[_0x2c6849(0x1e8)]&&this['_maskCache'][_0x2c6849(0x189)](_0x1d9d67,_0x2991b5);}}if(typeof _0x4700ad!=='undefined'){const _0x4c88c5=this[_0x2c6849(0x1d4)][_0x2c6849(0x1dc)](_0x4700ad)||[],_0xa57c2d=this[_0x2c6849(0x1be)]?this[_0x2c6849(0x1be)](_0x4c88c5):_0x4c88c5;return{'type':'FeatureCollection','features':_0xa57c2d};}const _0x5672d9=[];for(const _0x361edc of this[_0x2c6849(0x1d4)]['values']()){_0x5672d9[_0x2c6849(0x1b1)](..._0x361edc);}const _0x32f53f=this[_0x2c6849(0x1be)]?this[_0x2c6849(0x1be)](_0x5672d9):_0x5672d9;return{'type':_0x2c6849(0x1cd),'features':_0x32f53f};}[a4_0x2336f7(0x1d9)](){const _0x4fdad8=a4_0x2336f7,_0x6c983c=Array[_0x4fdad8(0x1d3)]({'length':this['nx']});for(let _0x2640c7=0x0;_0x2640c7<this['nx'];_0x2640c7++){_0x6c983c[_0x2640c7]=new a4_0x30e44c(this[_0x4fdad8(0x198)])['plus'](new a4_0x30e44c(_0x2640c7)[_0x4fdad8(0x179)](this[_0x4fdad8(0x1c3)]))[_0x4fdad8(0x1ab)]();}const _0x1df387=Array[_0x4fdad8(0x1d3)]({'length':this['ny']});for(let _0x40b4d3=0x0;_0x40b4d3<this['ny'];_0x40b4d3++){_0x1df387[_0x40b4d3]=new a4_0x30e44c(this['minLat'])['plus'](new a4_0x30e44c(_0x40b4d3)[_0x4fdad8(0x179)](this[_0x4fdad8(0x1eb)]))[_0x4fdad8(0x1ab)]();}const _0x39d8f3=Array[_0x4fdad8(0x1d3)]({'length':this['nx']*this['ny']});for(let _0x1eb56d=0x0;_0x1eb56d<this[_0x4fdad8(0x184)][_0x4fdad8(0x1e8)];_0x1eb56d++){const _0x487b16=Math[_0x4fdad8(0x19b)](_0x1eb56d/this['nx']),_0x2f20bc=_0x1eb56d%this['nx'],_0x8a4ae1=_0x6c983c[_0x2f20bc],_0x126f80=_0x1df387[_0x487b16],_0x31396a=this[_0x4fdad8(0x184)][_0x1eb56d];_0x126f80&&_0x8a4ae1&&(_0x39d8f3[_0x1eb56d]={'lng':_0x8a4ae1,'lat':_0x126f80,'val':_0x31396a});}return _0x39d8f3;}[a4_0x2336f7(0x1c0)](_0x30aee0){const _0x354855=a4_0x2336f7;if(this['nx']<=0x0||this['ny']<=0x0||this[_0x354855(0x1c3)]===0x0||this['gjLat']===0x0)return null;const {canvas:_0x33a9a9,ctx:_0x1cffe5,width:_0x150cef,height:_0x534405}=this['createCanvas'](_0x30aee0);if(!_0x1cffe5)return null;const _0xc68696=_0x150cef/this['nx'],_0x1e5334=_0x534405/this['ny'];_0x1cffe5[_0x354855(0x18d)](),_0x1cffe5[_0x354855(0x178)]=_0x30aee0?.[_0x354855(0x178)]||_0x354855(0x1c5),_0x1cffe5[_0x354855(0x1e4)]=_0x30aee0?.[_0x354855(0x1e4)]||0x1;for(let _0x56ddba=0x0;_0x56ddba<=this['nx'];_0x56ddba++){_0x1cffe5['moveTo'](_0xc68696*_0x56ddba,0x0),_0x1cffe5[_0x354855(0x1dd)](_0xc68696*_0x56ddba,_0x534405);}for(let _0x41ff05=0x0;_0x41ff05<=this['ny'];_0x41ff05++){_0x1cffe5[_0x354855(0x1a1)](0x0,_0x1e5334*_0x41ff05),_0x1cffe5[_0x354855(0x1dd)](_0x150cef,_0x1e5334*_0x41ff05);}return _0x1cffe5[_0x354855(0x1aa)](),_0x1cffe5[_0x354855(0x1c1)](),_0x33a9a9;}['buildGridCanvas'](_0x3609ea,_0x11e46d,_0x494b25){const _0x3a1f52=a4_0x2336f7;if(this['nx']<=0x0||this['ny']<=0x0||this['gjLng']===0x0||this['gjLat']===0x0)return null;const _0x4fd175=_0x3609ea&&_0x3609ea[_0x3a1f52(0x1e8)]?_0x3609ea:this['getBreaks'](),{canvas:_0x12565a,ctx:_0x118a31,width:_0x1ea299,height:_0x3729d6}=this['createCanvas'](_0x494b25);if(!_0x118a31)return null;const _0xa8d7ed=_0x1ea299/this['nx'],_0x351028=_0x3729d6/this['ny'],_0x33f5b7=_0x29912b=>{const _0x1d7769=_0x3a1f52;if(_0x29912b==null||Number[_0x1d7769(0x1ce)](_0x29912b))return'rgba(0,0,0,0)';for(let _0x1f5f02=0x0;_0x1f5f02<_0x4fd175[_0x1d7769(0x1e8)];_0x1f5f02++){const _0xcb39e4=_0x4fd175[_0x1f5f02],_0xf56762=_0x1f5f02<_0x4fd175[_0x1d7769(0x1e8)]-0x1?_0x4fd175[_0x1f5f02+0x1]:Infinity;if(_0x29912b>=_0xcb39e4&&_0x29912b<_0xf56762){const _0x496918=_0x11e46d[_0x1f5f02];if(typeof _0x496918===_0x1d7769(0x181))return _0x496918;return _0x1d7769(0x196)+_0x496918[0x0]+','+_0x496918[0x1]+','+_0x496918[0x2]+','+(_0x496918[0x3]||_0x496918[0x3]===0x0?_0x496918[0x3]:0x1)+')';}}return'rgba(0,0,0,0)';};for(let _0x49901e=0x0;_0x49901e<this['ny'];_0x49901e++){for(let _0x106eef=0x0;_0x106eef<this['nx'];_0x106eef++){const _0x46adf3=_0x49901e*this['nx']+_0x106eef,_0x206c8b=this['values'][_0x46adf3],_0xb928b5=_0x33f5b7(_0x206c8b),_0x2df71c=_0x106eef*_0xa8d7ed,_0x1ba214=_0x3729d6-(_0x49901e+0x1)*_0x351028;_0x118a31['fillStyle']=_0xb928b5,_0x118a31['fillRect'](_0x2df71c,_0x1ba214,_0xa8d7ed,_0x351028);}}if(!_0x494b25?.[_0x3a1f52(0x178)]&&!_0x494b25?.[_0x3a1f52(0x1e4)]||_0x494b25?.['lineWidth']===0x0)return _0x12565a;const _0x5bb895=this['buildGridLineCanvas'](_0x494b25);return _0x5bb895&&_0x118a31[_0x3a1f52(0x1b8)](_0x5bb895,0x0,0x0,_0x1ea299,_0x3729d6),_0x12565a;}['buildGridCanvasClipByJson'](_0x1aea02,_0x1a3ba4,_0x2d570b,_0x230533){const _0xfa37b6=a4_0x2336f7,_0x4ea4ac=this[_0xfa37b6(0x1de)](_0x1aea02,_0x1a3ba4,_0x230533);if(!_0x4ea4ac)return null;const {canvas:_0x1ea828,ctx:_0x291cb0,width:_0x22cf65,height:_0x5ea0ad}=this[_0xfa37b6(0x1ba)](_0x230533);if(!_0x291cb0)return null;const _0x2fe512=[];return _0x2d570b[_0xfa37b6(0x1af)][_0xfa37b6(0x177)](_0x37e8b5=>{const _0x40f397=_0xfa37b6,_0x5248b2=_0x37e8b5[_0x40f397(0x1b9)];if(_0x5248b2['type']===_0x40f397(0x176))_0x5248b2[_0x40f397(0x1a0)][_0x40f397(0x177)](_0x5ef50b=>{const _0x302448=_0x40f397,_0x1a1f9f=[];_0x5ef50b['map'](_0x210826=>{const _0x9cdd81=a4_0x31a7;_0x1a1f9f[_0x9cdd81(0x1b1)]([_0x210826[0x0],_0x210826[0x1]]);}),_0x2fe512[_0x302448(0x1b1)](_0x1a1f9f);});else _0x5248b2['type']==='MultiPolygon'&&_0x5248b2[_0x40f397(0x1a0)]['map'](_0x269054=>{const _0x2bee2e=_0x40f397;_0x269054[_0x2bee2e(0x177)](_0x248a3a=>{const _0x3151c4=_0x2bee2e,_0x551db0=[];_0x248a3a[_0x3151c4(0x177)](_0x203fce=>{const _0xb58345=_0x3151c4;_0x551db0[_0xb58345(0x1b1)]([_0x203fce[0x0],_0x203fce[0x1]]);}),_0x2fe512['push'](_0x551db0);});});}),_0x291cb0[_0xfa37b6(0x1c2)](),_0x291cb0['beginPath'](),_0x2fe512[_0xfa37b6(0x177)](_0x1dd45d=>{const _0x327f8d=_0xfa37b6;_0x1dd45d[_0x327f8d(0x175)]((_0x2039a8,_0xa7d860)=>{const _0x5f0889=_0x327f8d,_0x1272ed=_0x2039a8[0x0],_0xf1cd81=_0x2039a8[0x1],_0x4995e0=(_0x1272ed-this['minLng'])/(this['nx']*this[_0x5f0889(0x1c3)])*_0x22cf65,_0x299557=_0x5ea0ad-(_0xf1cd81-this['minLat'])/(this['ny']*this['gjLat'])*_0x5ea0ad;_0xa7d860===0x0?_0x291cb0['moveTo'](_0x4995e0,_0x299557):_0x291cb0['lineTo'](_0x4995e0,_0x299557);}),_0x291cb0['closePath']();}),_0x291cb0[_0xfa37b6(0x1df)](),_0x291cb0['drawImage'](_0x4ea4ac,0x0,0x0,_0x22cf65,_0x5ea0ad),_0x291cb0[_0xfa37b6(0x1a2)](),_0x1ea828;}[a4_0x2336f7(0x1e2)](_0x12395c,_0x8f3910){const _0x1d41ca=a4_0x2336f7,_0xb3149f=[];_0x12395c[_0x1d41ca(0x177)](_0x397f14=>{const _0x30cf32=_0x1d41ca;_0xb3149f[_0x30cf32(0x1b1)]([_0x397f14[_0x30cf32(0x188)],_0x397f14['lat']]);});_0xb3149f[_0x1d41ca(0x1e8)]>0x3&&_0x12395c['length']>0x3&&_0xb3149f[_0x1d41ca(0x1b1)]([_0x12395c[0x0]['lng'],_0x12395c[0x0][_0x1d41ca(0x19a)]]);const _0x56fb1c=polygon([_0xb3149f]),_0xf0bfed=[],_0x2462f7=this[_0x1d41ca(0x1d9)]();return _0x2462f7[_0x1d41ca(0x177)](_0x34c004=>{const _0x8efc1f=_0x1d41ca,_0x45c5a0=point([_0x34c004['lng'],_0x34c004[_0x8efc1f(0x19a)]]);booleanPointInPolygon(_0x45c5a0,_0x56fb1c)&&(_0xf0bfed['push']({'lat':_0x34c004[_0x8efc1f(0x19a)],'lng':_0x34c004[_0x8efc1f(0x188)]}),_0x34c004['val']=_0x8f3910);}),this['values']=_0x2462f7['map'](_0xf270a0=>_0xf270a0[_0x1d41ca(0x1b5)]),_0xf0bfed;}['getMinMax'](){const _0x3e48c8=a4_0x2336f7;let _0x32c276=-Infinity,_0x43aae6=Infinity;for(let _0x4284f3=0x0;_0x4284f3<this[_0x3e48c8(0x184)][_0x3e48c8(0x1e8)];_0x4284f3++){const _0x2c12fa=this[_0x3e48c8(0x184)][_0x4284f3];if(_0x2c12fa&&_0x2c12fa>_0x32c276)_0x32c276=_0x2c12fa;if(_0x2c12fa&&_0x2c12fa<_0x43aae6)_0x43aae6=_0x2c12fa;}this[_0x3e48c8(0x1c7)]=_0x43aae6,this['maxVal']=_0x32c276;}['sortFeaturesByArea'](_0x4b87b4){const _0x183e36=a4_0x2336f7;return _0x4b87b4[_0x183e36(0x177)](_0x3a31c6=>{const _0x4c2f12=_0x183e36;try{const _0x3b258b=a4_0x154eb7(_0x3a31c6)||0x0;_0x3a31c6[_0x4c2f12(0x18b)]={..._0x3a31c6['properties']||{},'__area':_0x3b258b};}catch{_0x3a31c6[_0x4c2f12(0x18b)]={..._0x3a31c6[_0x4c2f12(0x18b)]||{},'__area':0x0};}return _0x3a31c6;})['sort']((_0x15bb94,_0x3110f8)=>_0x3110f8['properties'][_0x183e36(0x1b0)]-_0x15bb94[_0x183e36(0x18b)][_0x183e36(0x1b0)])[_0x183e36(0x1d5)](_0x490f58=>_0x490f58[_0x183e36(0x18b)]&&'__area'in _0x490f58[_0x183e36(0x18b)]&&_0x490f58[_0x183e36(0x18b)][_0x183e36(0x1b0)]!==0x0)[_0x183e36(0x177)](_0x2a17fa=>{const _0x619903=_0x183e36;if(_0x2a17fa[_0x619903(0x18b)]&&_0x619903(0x1b0)in _0x2a17fa[_0x619903(0x18b)]){const {__area:_0x400d55,..._0xaff3ad}=_0x2a17fa[_0x619903(0x18b)];_0x2a17fa[_0x619903(0x18b)]=_0xaff3ad;}return _0x2a17fa;});}[a4_0x2336f7(0x1d8)]=(_0x196c2a,_0x4ac5ed)=>{const _0x30cb4c=a4_0x2336f7,_0x38f679=[],_0x59da21=Math[_0x30cb4c(0x19c)](0x1,Math['ceil'](_0x196c2a[_0x30cb4c(0x1e8)]/_0x4ac5ed));for(let _0x542d4a=0x0;_0x542d4a<_0x4ac5ed;_0x542d4a++){_0x38f679[_0x30cb4c(0x1b1)](_0x196c2a['slice'](_0x542d4a*_0x59da21,(_0x542d4a+0x1)*_0x59da21));}return _0x38f679;};[a4_0x2336f7(0x17c)](){const _0x3e0f57=a4_0x2336f7,_0x4b2157=[];if(this['minVal']===Infinity||this[_0x3e0f57(0x1ac)]===-Infinity)return _0x4b2157;for(let _0x262084=this[_0x3e0f57(0x1c7)]-0x1;_0x262084<=this[_0x3e0f57(0x1ac)]+0x1;_0x262084++){_0x4b2157[_0x3e0f57(0x1b1)](_0x262084);}return _0x4b2157;}[a4_0x2336f7(0x1a8)]=_0x5cb6e2=>{const _0x2f4e75=a4_0x2336f7;if(_0x5cb6e2['length']===0x0)_0x5cb6e2=this['getBreaks']();const _0x4fd326=[];for(let _0x4b85b5=0x0;_0x4b85b5<_0x5cb6e2[_0x2f4e75(0x1e8)];_0x4b85b5++){const _0x42c553=_0x5cb6e2[_0x4b85b5],_0x5cd0fa=_0x4b85b5<_0x5cb6e2[_0x2f4e75(0x1e8)]-0x1?_0x5cb6e2[_0x4b85b5+0x1]:Infinity;if(_0x42c553==null||_0x5cd0fa==null)continue;if(_0x42c553<this['minVal']&&_0x5cd0fa<this[_0x2f4e75(0x1c7)])continue;if(_0x42c553>this[_0x2f4e75(0x1ac)]&&_0x5cd0fa>this['maxVal'])continue;_0x4fd326[_0x2f4e75(0x1b1)](_0x42c553);}const _0x40da3b=contours()['size']([this['nx'],this['ny']])[_0x2f4e75(0x18f)](_0x4fd326);return _0x40da3b(this[_0x2f4e75(0x184)]);};[a4_0x2336f7(0x1ba)]=_0x4c60f6=>{const _0x5c35da=a4_0x2336f7,_0x4adf4b=Math[_0x5c35da(0x19b)]((_0x4c60f6?.['width']||Math[_0x5c35da(0x1c9)](this['nx']/0x400)*0x400*0x2)/this['nx'])*this['nx'],_0x172788=_0x4adf4b/this['nx']*this['ny'],_0xeff6c3=_0x4c60f6?.['pixelRatio']||(typeof devicePixelRatio!==_0x5c35da(0x17a)?devicePixelRatio:0x1),_0x336c04=document[_0x5c35da(0x1b3)]('canvas'),_0x5b54d8=_0x336c04[_0x5c35da(0x18c)]('2d');return _0x336c04[_0x5c35da(0x1bd)]=_0x4adf4b*_0xeff6c3,_0x336c04[_0x5c35da(0x199)]=_0x172788*_0xeff6c3,_0x5b54d8[_0x5c35da(0x194)](_0xeff6c3,_0xeff6c3),{'canvas':_0x336c04,'ctx':_0x5b54d8,'width':_0x4adf4b,'height':_0x172788};};}export default readFileM4;
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import type { FeatureCollection } from 'geojson';
|
|
2
|
+
export interface IReadFileM4 {
|
|
3
|
+
filePath: string;
|
|
4
|
+
nx: number;
|
|
5
|
+
ny: number;
|
|
6
|
+
minLng: number;
|
|
7
|
+
minLat: number;
|
|
8
|
+
gjLng: number;
|
|
9
|
+
gjLat: number;
|
|
10
|
+
values: number[];
|
|
11
|
+
maxVal: number;
|
|
12
|
+
minVal: number;
|
|
13
|
+
/**
|
|
14
|
+
* 开始解析文件
|
|
15
|
+
* @param config
|
|
16
|
+
*/
|
|
17
|
+
start: (config?: ReadConfig) => Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* 自定义数据, 使用他不需要接文件, 也不需要执行start(). 但是需要提供详细的数据
|
|
20
|
+
* @param params
|
|
21
|
+
* @param config
|
|
22
|
+
*/
|
|
23
|
+
setParams: (params: ParamsConfig, config?: ReadConfig) => void;
|
|
24
|
+
/**
|
|
25
|
+
* 获取等值带
|
|
26
|
+
* @param breaks
|
|
27
|
+
*/
|
|
28
|
+
getIsoBandsFast: (breaks: number[]) => FeatureCollection;
|
|
29
|
+
/**
|
|
30
|
+
* 获取等值带 Canvas
|
|
31
|
+
* @param breaks
|
|
32
|
+
* @param colors
|
|
33
|
+
* @param options : { width?: number, height?: number, pixelRatio?: number }
|
|
34
|
+
*/
|
|
35
|
+
getIsoBandsCanvas: (breaks: number[], colors: (number[] | string)[], options?: CanvasOptions) => HTMLCanvasElement | null;
|
|
36
|
+
/**
|
|
37
|
+
* 提取分级对应的颜色
|
|
38
|
+
* @param z 当前分级
|
|
39
|
+
* @param level 分级数组
|
|
40
|
+
* @param color 分级颜色数组
|
|
41
|
+
*/
|
|
42
|
+
getColorFast: (z: number | string, level: (number | string)[], color: (number[] | string)[]) => string;
|
|
43
|
+
/**
|
|
44
|
+
* 裁剪数据
|
|
45
|
+
* @param iosBands 等值带数据
|
|
46
|
+
* @param json 裁剪范围数据
|
|
47
|
+
* @param intersectWorkerUrl 裁剪 Worker 脚本 URL
|
|
48
|
+
* @param useCpuCount 可选,使用的 CPU 核心数
|
|
49
|
+
*/
|
|
50
|
+
clipDataByJson: (iosBands: FeatureCollection, json: FeatureCollection, intersectWorkerUrl: string, useCpuCount?: number) => Promise<FeatureCollection>;
|
|
51
|
+
/**
|
|
52
|
+
* 使用 Worker 多线程获取等值带
|
|
53
|
+
* @param breaks 等值带分级
|
|
54
|
+
* @param bandsWorkerUrl 等值带计算 Worker 脚本 URL
|
|
55
|
+
* @param useCpuCount 可选,使用的 CPU 核心数
|
|
56
|
+
* @deprecated 即将弃用, 请使用 `getIsoBandsFast`
|
|
57
|
+
*/
|
|
58
|
+
getIsoBandsFastByWorker: (breaks: number[], bandsWorkerUrl: string, useCpuCount?: number) => Promise<FeatureCollection>;
|
|
59
|
+
/**
|
|
60
|
+
* 清理等值带缓存 (缓存只在 getIsoBandsByLayerBreak 方法中使用)
|
|
61
|
+
* @deprecated 准备弃用, 分层使用canvas来做
|
|
62
|
+
*/
|
|
63
|
+
clearMaskCache: () => void;
|
|
64
|
+
/**
|
|
65
|
+
* 获取等值带 (支持按层获取或全部层合并获取)
|
|
66
|
+
* - 单层因为数据丢失可能不准确
|
|
67
|
+
* @param breaks
|
|
68
|
+
* @param layerLower
|
|
69
|
+
* @deprecated 准备弃用, 分层使用canvas来做
|
|
70
|
+
*/
|
|
71
|
+
getIsoBandsByLayerBreak: (breaks?: number[], layerLower?: number) => FeatureCollection;
|
|
72
|
+
/**
|
|
73
|
+
* 获取 JSON 数据数组
|
|
74
|
+
* @return JSONData[]
|
|
75
|
+
*/
|
|
76
|
+
getJsonData: () => JSONData[];
|
|
77
|
+
/**
|
|
78
|
+
* 构建一个网格网格 Canvas, 用于在融合模式下展示网格线, 网格的依据来源于数据的经纬度和分辨率
|
|
79
|
+
*/
|
|
80
|
+
buildGridLineCanvas: (options?: CanvasOptions) => HTMLCanvasElement | null;
|
|
81
|
+
/**
|
|
82
|
+
* 构建一个网格色块 Canvas 有填色
|
|
83
|
+
* @param breaks
|
|
84
|
+
* @param colors
|
|
85
|
+
* @param options
|
|
86
|
+
*/
|
|
87
|
+
buildGridCanvas(breaks: number[], colors: (number[] | string)[], options?: CanvasOptions): HTMLCanvasElement | null;
|
|
88
|
+
/**
|
|
89
|
+
* 构建一个裁剪后的网格色块 Canvas 有填色
|
|
90
|
+
* @param breaks
|
|
91
|
+
* @param colors
|
|
92
|
+
* @param json
|
|
93
|
+
* @param clipWorkerUrl
|
|
94
|
+
* @param options
|
|
95
|
+
*/
|
|
96
|
+
buildGridCanvasClipByJson(breaks: number[], colors: (number[] | string)[], json: FeatureCollection, options?: CanvasOptions): HTMLCanvasElement | null;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* 读取文件对数据的处理
|
|
100
|
+
*/
|
|
101
|
+
export interface ReadConfig {
|
|
102
|
+
/**
|
|
103
|
+
* 是否将温度从开尔文转换为摄氏度(如果数据确实是温度的话)
|
|
104
|
+
*/
|
|
105
|
+
convertTemKtoC?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* 附加偏移量 (如果需要对数值进行调整)
|
|
108
|
+
*/
|
|
109
|
+
plusOffset?: number;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* 设置数据参数
|
|
113
|
+
*/
|
|
114
|
+
export interface ParamsConfig {
|
|
115
|
+
/**
|
|
116
|
+
* 数据值数组
|
|
117
|
+
*/
|
|
118
|
+
values: number[];
|
|
119
|
+
/**
|
|
120
|
+
* 栅格列数
|
|
121
|
+
*/
|
|
122
|
+
nx: number;
|
|
123
|
+
/**
|
|
124
|
+
* 栅格行数
|
|
125
|
+
*/
|
|
126
|
+
ny: number;
|
|
127
|
+
/**
|
|
128
|
+
* 最小经度
|
|
129
|
+
*/
|
|
130
|
+
minLng: number;
|
|
131
|
+
/**
|
|
132
|
+
* 最小纬度
|
|
133
|
+
*/
|
|
134
|
+
minLat: number;
|
|
135
|
+
/**
|
|
136
|
+
* 经度分辨率
|
|
137
|
+
*/
|
|
138
|
+
gjLng: number;
|
|
139
|
+
/**
|
|
140
|
+
* 纬度分辨率
|
|
141
|
+
*/
|
|
142
|
+
gjLat: number;
|
|
143
|
+
}
|
|
144
|
+
export interface Point {
|
|
145
|
+
lat: number;
|
|
146
|
+
lng: number;
|
|
147
|
+
}
|
|
148
|
+
export interface JSONData extends Point {
|
|
149
|
+
val: number;
|
|
150
|
+
}
|
|
151
|
+
export interface CanvasOptions {
|
|
152
|
+
width?: number;
|
|
153
|
+
height?: number;
|
|
154
|
+
pixelRatio?: number;
|
|
155
|
+
strokeStyle?: string;
|
|
156
|
+
lineWidth?: number;
|
|
157
|
+
}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "m4-w-fast",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -16,10 +16,12 @@
|
|
|
16
16
|
"scripts": {
|
|
17
17
|
"build:types": "tsc -p tsconfig.build.json",
|
|
18
18
|
"obfuscate": "javascript-obfuscator dist --output dist",
|
|
19
|
-
"build": "npm run build:types && npm run build:rollup && npm run obfuscate",
|
|
19
|
+
"build": "npm run build:types && npm run build:rollup && npm run build:browser && npm run obfuscate",
|
|
20
20
|
"prepublishOnly": "npm run build",
|
|
21
|
-
"build:rollup": "rollup -c"
|
|
21
|
+
"build:rollup": "rollup -c",
|
|
22
|
+
"build:browser": "rollup -c rollup.config.browser.js"
|
|
22
23
|
},
|
|
24
|
+
"browser": "dist/m4-w-fast.umd.js",
|
|
23
25
|
"author": "wangrl",
|
|
24
26
|
"license": "ISC",
|
|
25
27
|
"type": "module",
|
|
@@ -41,9 +43,11 @@
|
|
|
41
43
|
},
|
|
42
44
|
"dependencies": {
|
|
43
45
|
"@turf/area": "^7.2.0",
|
|
46
|
+
"@turf/boolean-point-in-polygon": "^7.3.1",
|
|
44
47
|
"@turf/isobands": "^7.2.0",
|
|
45
48
|
"@turf/isolines": "^7.2.0",
|
|
46
49
|
"@turf/turf": "^6.5.0",
|
|
50
|
+
"@types/leaflet": "^1.9.21",
|
|
47
51
|
"d3-contour": "^4",
|
|
48
52
|
"decimal.js": "^10.6.0"
|
|
49
53
|
},
|