@loaders.gl/flatgeobuf 4.4.0-alpha.1 → 4.4.0-alpha.2
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/dist/dist.min.js +1 -1
- package/dist/flatgeobuf-loader.js +1 -1
- package/dist/flatgeobuf-worker.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/package.json +6 -6
package/dist/dist.min.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"use strict";var __exports__=(()=>{var Li=Object.create;var ie=Object.defineProperty;var Ci=Object.getOwnPropertyDescriptor;var Ti=Object.getOwnPropertyNames;var Bi=Object.getPrototypeOf,Gi=Object.prototype.hasOwnProperty;var Ui=(t,e,r)=>e in t?ie(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var zi=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),qi=(t,e)=>{for(var r in e)ie(t,r,{get:e[r],enumerable:!0})},ye=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ti(e))!Gi.call(t,i)&&i!==r&&ie(t,i,{get:()=>e[i],enumerable:!(s=Ci(e,i))||s.enumerable});return t},ge=(t,e,r)=>(ye(t,e,"default"),r&&ye(r,e,"default")),ji=(t,e,r)=>(r=t!=null?Li(Bi(t)):{},ye(e||!t||!t.__esModule?ie(r,"default",{value:t,enumerable:!0}):r,t)),Di=t=>ye(ie({},"__esModule",{value:!0}),t);var Ut=(t,e,r)=>(Ui(t,typeof e!="symbol"?e+"":e,r),r);var Ar=zi((Uh,Sr)=>{Sr.exports=globalThis.loaders});var _e={};qi(_e,{FlatGeobufFormat:()=>zt,FlatGeobufLoader:()=>ee,FlatGeobufWorkerLoader:()=>wr,_FlatGeobufSource:()=>Er});ge(_e,ji(Ar(),1));var zt={id:"flatgeobuf",name:"FlatGeobuf",module:"flatgeobuf",extensions:["fgb"],mimeTypes:["application/octet-stream"],category:"geometry"};function Nr(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}var st=1,it=2,Fr=4,ae=5,At=484813681109536e-20,b=Math.PI/2,Or=.16666666666666666,Rr=.04722222222222222,Lr=.022156084656084655,_=1e-10,G=.017453292519943295,at=57.29577951308232,E=Math.PI/4,ne=Math.PI*2,O=3.14159265359;var V={};V.greenwich=0;V.lisbon=-9.131906111111;V.paris=2.337229166667;V.bogota=-74.080916666667;V.madrid=-3.687938888889;V.rome=12.452333333333;V.bern=7.439583333333;V.jakarta=106.807719444444;V.ferro=-17.666666666667;V.brussels=4.367975;V.stockholm=18.058277777778;V.athens=23.7163375;V.oslo=10.722916666667;var Cr={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}};var Tr=/[\s_\-\/\(\)]/g;function K(t,e){if(t[e])return t[e];for(var r=Object.keys(t),s=e.toLowerCase().replace(Tr,""),i=-1,a,n;++i<r.length;)if(a=r[i],n=a.toLowerCase().replace(Tr,""),n===s)return t[a]}function oe(t){var e={},r=t.split("+").map(function(o){return o.trim()}).filter(function(o){return o}).reduce(function(o,h){var f=h.split("=");return f.push(!0),o[f[0].toLowerCase()]=f[1],o},{}),s,i,a,n={proj:"projName",datum:"datumCode",rf:function(o){e.rf=parseFloat(o)},lat_0:function(o){e.lat0=o*G},lat_1:function(o){e.lat1=o*G},lat_2:function(o){e.lat2=o*G},lat_ts:function(o){e.lat_ts=o*G},lon_0:function(o){e.long0=o*G},lon_1:function(o){e.long1=o*G},lon_2:function(o){e.long2=o*G},alpha:function(o){e.alpha=parseFloat(o)*G},lonc:function(o){e.longc=o*G},x_0:function(o){e.x0=parseFloat(o)},y_0:function(o){e.y0=parseFloat(o)},k_0:function(o){e.k0=parseFloat(o)},k:function(o){e.k0=parseFloat(o)},a:function(o){e.a=parseFloat(o)},b:function(o){e.b=parseFloat(o)},r_a:function(){e.R_A=!0},zone:function(o){e.zone=parseInt(o,10)},south:function(){e.utmSouth=!0},towgs84:function(o){e.datum_params=o.split(",").map(function(h){return parseFloat(h)})},to_meter:function(o){e.to_meter=parseFloat(o)},units:function(o){e.units=o;var h=K(Cr,o);h&&(e.to_meter=h.to_meter)},from_greenwich:function(o){e.from_greenwich=o*G},pm:function(o){var h=K(V,o);e.from_greenwich=(h||parseFloat(o))*G},nadgrids:function(o){o==="@null"?e.datumCode="none":e.nadgrids=o},axis:function(o){var h="ewnsud";o.length===3&&h.indexOf(o.substr(0,1))!==-1&&h.indexOf(o.substr(1,1))!==-1&&h.indexOf(o.substr(2,1))!==-1&&(e.axis=o)}};for(s in r)i=r[s],s in n?(a=n[s],typeof a=="function"?a(i):e[a]=i):e[s]=i;return typeof e.datumCode=="string"&&e.datumCode!=="WGS84"&&(e.datumCode=e.datumCode.toLowerCase()),e}var Br=Hi,he=1,Gr=2,Ur=3,Me=4,zr=5,rr=-1,ki=/\s/,Vi=/[A-Za-z]/,Wi=/[A-Za-z84_]/,xe=/[,\]]/,qr=/[\d\.E\-\+]/;function bt(t){if(typeof t!="string")throw new Error("not a string");this.text=t.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=he}bt.prototype.readCharicter=function(){var t=this.text[this.place++];if(this.state!==Me)for(;ki.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case he:return this.neutral(t);case Gr:return this.keyword(t);case Me:return this.quoted(t);case zr:return this.afterquote(t);case Ur:return this.number(t);case rr:return}};bt.prototype.afterquote=function(t){if(t==='"'){this.word+='"',this.state=Me;return}if(xe.test(t)){this.word=this.word.trim(),this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in afterquote yet, index '+this.place)};bt.prototype.afterItem=function(t){if(t===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=he;return}if(t==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=he,this.currentObject=this.stack.pop(),this.currentObject||(this.state=rr);return}};bt.prototype.number=function(t){if(qr.test(t)){this.word+=t;return}if(xe.test(t)){this.word=parseFloat(this.word),this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in number yet, index '+this.place)};bt.prototype.quoted=function(t){if(t==='"'){this.state=zr;return}this.word+=t};bt.prototype.keyword=function(t){if(Wi.test(t)){this.word+=t;return}if(t==="["){var e=[];e.push(this.word),this.level++,this.root===null?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,this.state=he;return}if(xe.test(t)){this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in keyword yet, index '+this.place)};bt.prototype.neutral=function(t){if(Vi.test(t)){this.word=t,this.state=Gr;return}if(t==='"'){this.word="",this.state=Me;return}if(qr.test(t)){this.word=t,this.state=Ur;return}if(xe.test(t)){this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in neutral yet, index '+this.place)};bt.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===rr)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function Hi(t){var e=new bt(t);return e.output()}function jr(t,e,r){Array.isArray(e)&&(r.unshift(e),e=null);var s=e?{}:t,i=r.reduce(function(a,n){return Nt(n,a),a},s);e&&(t[e]=i)}function Nt(t,e){if(!Array.isArray(t)){e[t]=!0;return}var r=t.shift();if(r==="PARAMETER"&&(r=t.shift()),t.length===1){if(Array.isArray(t[0])){e[r]={},Nt(t[0],e[r]);return}e[r]=t[0];return}if(!t.length){e[r]=!0;return}if(r==="TOWGS84"){e[r]=t;return}if(r==="AXIS"){r in e||(e[r]=[]),e[r].push(t);return}Array.isArray(r)||(e[r]={});var s;switch(r){case"UNIT":case"PRIMEM":case"VERT_DATUM":e[r]={name:t[0].toLowerCase(),convert:t[1]},t.length===3&&Nt(t[2],e[r]);return;case"SPHEROID":case"ELLIPSOID":e[r]={name:t[0],a:t[1],rf:t[2]},t.length===4&&Nt(t[3],e[r]);return;case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":t[0]=["name",t[0]],jr(e,r,t);return;default:for(s=-1;++s<t.length;)if(!Array.isArray(t[s]))return Nt(t,e[r]);return jr(e,r,t)}}var Xi=.017453292519943295;function Ji(t,e){var r=e[0],s=e[1];!(r in t)&&s in t&&(t[r]=t[s],e.length===3&&(t[r]=e[2](t[r])))}function ct(t){return t*Xi}function Zi(t){if(t.type==="GEOGCS"?t.projName="longlat":t.type==="LOCAL_CS"?(t.projName="identity",t.local=!0):typeof t.PROJECTION=="object"?t.projName=Object.keys(t.PROJECTION)[0]:t.projName=t.PROJECTION,t.AXIS){for(var e="",r=0,s=t.AXIS.length;r<s;++r){var i=[t.AXIS[r][0].toLowerCase(),t.AXIS[r][1].toLowerCase()];i[0].indexOf("north")!==-1||(i[0]==="y"||i[0]==="lat")&&i[1]==="north"?e+="n":i[0].indexOf("south")!==-1||(i[0]==="y"||i[0]==="lat")&&i[1]==="south"?e+="s":i[0].indexOf("east")!==-1||(i[0]==="x"||i[0]==="lon")&&i[1]==="east"?e+="e":(i[0].indexOf("west")!==-1||(i[0]==="x"||i[0]==="lon")&&i[1]==="west")&&(e+="w")}e.length===2&&(e+="u"),e.length===3&&(t.axis=e)}t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),t.units==="metre"&&(t.units="meter"),t.UNIT.convert&&(t.type==="GEOGCS"?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a):t.to_meter=t.UNIT.convert));var a=t.GEOGCS;t.type==="GEOGCS"&&(a=t),a&&(a.DATUM?t.datumCode=a.DATUM.name.toLowerCase():t.datumCode=a.name.toLowerCase(),t.datumCode.slice(0,2)==="d_"&&(t.datumCode=t.datumCode.slice(2)),(t.datumCode==="new_zealand_geodetic_datum_1949"||t.datumCode==="new_zealand_1949")&&(t.datumCode="nzgd49"),(t.datumCode==="wgs_1984"||t.datumCode==="world_geodetic_system_1984")&&(t.PROJECTION==="Mercator_Auxiliary_Sphere"&&(t.sphere=!0),t.datumCode="wgs84"),t.datumCode.slice(-6)==="_ferro"&&(t.datumCode=t.datumCode.slice(0,-6)),t.datumCode.slice(-8)==="_jakarta"&&(t.datumCode=t.datumCode.slice(0,-8)),~t.datumCode.indexOf("belge")&&(t.datumCode="rnb72"),a.DATUM&&a.DATUM.SPHEROID&&(t.ellps=a.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),t.ellps.toLowerCase().slice(0,13)==="international"&&(t.ellps="intl"),t.a=a.DATUM.SPHEROID.a,t.rf=parseFloat(a.DATUM.SPHEROID.rf,10)),a.DATUM&&a.DATUM.TOWGS84&&(t.datum_params=a.DATUM.TOWGS84),~t.datumCode.indexOf("osgb_1936")&&(t.datumCode="osgb36"),~t.datumCode.indexOf("osni_1952")&&(t.datumCode="osni52"),(~t.datumCode.indexOf("tm65")||~t.datumCode.indexOf("geodetic_datum_of_1965"))&&(t.datumCode="ire65"),t.datumCode==="ch1903+"&&(t.datumCode="ch1903"),~t.datumCode.indexOf("israel")&&(t.datumCode="isr93")),t.b&&!isFinite(t.b)&&(t.b=t.a);function n(f){var c=t.to_meter||1;return f*c}var o=function(f){return Ji(t,f)},h=[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",ct],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",ct],["x0","false_easting",n],["y0","false_northing",n],["long0","central_meridian",ct],["lat0","latitude_of_origin",ct],["lat0","standard_parallel_1",ct],["lat1","standard_parallel_1",ct],["lat2","standard_parallel_2",ct],["azimuth","Azimuth"],["alpha","azimuth",ct],["srsCode","name"]];h.forEach(o),!t.long0&&t.longc&&(t.projName==="Albers_Conic_Equal_Area"||t.projName==="Lambert_Azimuthal_Equal_Area")&&(t.long0=t.longc),!t.lat_ts&&t.lat1&&(t.projName==="Stereographic_South_Pole"||t.projName==="Polar Stereographic (variant B)")?(t.lat0=ct(t.lat1>0?90:-90),t.lat_ts=t.lat1):!t.lat_ts&&t.lat0&&t.projName==="Polar_Stereographic"&&(t.lat_ts=t.lat0,t.lat0=ct(t.lat0>0?90:-90))}function we(t){var e=Br(t),r=e.shift(),s=e.shift();e.unshift(["name",s]),e.unshift(["type",r]);var i={};return Nt(e,i),Zi(i),i}function tt(t){var e=this;if(arguments.length===2){var r=arguments[1];typeof r=="string"?r.charAt(0)==="+"?tt[t]=oe(arguments[1]):tt[t]=we(arguments[1]):tt[t]=r}else if(arguments.length===1){if(Array.isArray(t))return t.map(function(s){Array.isArray(s)?tt.apply(e,s):tt(s)});if(typeof t=="string"){if(t in tt)return tt[t]}else"EPSG"in t?tt["EPSG:"+t.EPSG]=t:"ESRI"in t?tt["ESRI:"+t.ESRI]=t:"IAU2000"in t?tt["IAU2000:"+t.IAU2000]=t:console.log(t);return}}Nr(tt);var qt=tt;function $i(t){return typeof t=="string"}function Ki(t){return t in qt}var Qi=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function Yi(t){return Qi.some(function(e){return t.indexOf(e)>-1})}var ta=["3857","900913","3785","102113"];function ea(t){var e=K(t,"authority");if(e){var r=K(e,"epsg");return r&&ta.indexOf(r)>-1}}function ra(t){var e=K(t,"extension");if(e)return K(e,"proj4")}function sa(t){return t[0]==="+"}function ia(t){if($i(t)){if(Ki(t))return qt[t];if(Yi(t)){var e=we(t);if(ea(e))return qt["EPSG:3857"];var r=ra(e);return r?oe(r):e}if(sa(t))return oe(t)}else return t}var Dr=ia;function sr(t,e){t=t||{};var r,s;if(!e)return t;for(s in e)r=e[s],r!==void 0&&(t[s]=r);return t}function k(t,e,r){var s=t*e;return r/Math.sqrt(1-s*s)}function ut(t){return t<0?-1:1}function y(t){return Math.abs(t)<=O?t:t-ut(t)*ne}function W(t,e,r){var s=t*r,i=.5*t;return s=Math.pow((1-s)/(1+s),i),Math.tan(.5*(b-e))/s}function vt(t,e){for(var r=.5*t,s,i,a=b-2*Math.atan(e),n=0;n<=15;n++)if(s=t*Math.sin(a),i=b-2*Math.atan(e*Math.pow((1-s)/(1+s),r))-a,a+=i,Math.abs(i)<=1e-10)return a;return-9999}function aa(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=k(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function na(t){var e=t.x,r=t.y;if(r*at>90&&r*at<-90&&e*at>180&&e*at<-180)return null;var s,i;if(Math.abs(Math.abs(r)-b)<=_)return null;if(this.sphere)s=this.x0+this.a*this.k0*y(e-this.long0),i=this.y0+this.a*this.k0*Math.log(Math.tan(E+.5*r));else{var a=Math.sin(r),n=W(this.e,r,a);s=this.x0+this.a*this.k0*y(e-this.long0),i=this.y0-this.a*this.k0*Math.log(n)}return t.x=s,t.y=i,t}function oa(t){var e=t.x-this.x0,r=t.y-this.y0,s,i;if(this.sphere)i=b-2*Math.atan(Math.exp(-r/(this.a*this.k0)));else{var a=Math.exp(-r/(this.a*this.k0));if(i=vt(this.e,a),i===-9999)return null}return s=y(this.long0+e/(this.a*this.k0)),t.x=s,t.y=i,t}var ha=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"],kr={init:aa,forward:na,inverse:oa,names:ha};function fa(){}function Vr(t){return t}var la=["longlat","identity"],Wr={init:fa,forward:Vr,inverse:Vr,names:la};var ca=[kr,Wr],Ie={},Pe=[];function Hr(t,e){var r=Pe.length;return t.names?(Pe[r]=t,t.names.forEach(function(s){Ie[s.toLowerCase()]=r}),this):(console.log(e),!0)}function ua(t){if(!t)return!1;var e=t.toLowerCase();if(typeof Ie[e]<"u"&&Pe[Ie[e]])return Pe[Ie[e]]}function da(){ca.forEach(Hr)}var Xr={start:da,add:Hr,get:ua};var w={};w.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"};w.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"};w.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"};w.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"};w.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"};w.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"};w.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"};w.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"};w.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"};w.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"};w.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"};w.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"};w.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"};w.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"};w.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."};w.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"};w.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"};w.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"};w.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"};w.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"};w.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"};w.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"};w.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"};w.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"};w.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"};w.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"};w.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"};w.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"};w.hough={a:6378270,rf:297,ellipseName:"Hough"};w.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"};w.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"};w.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"};w.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"};w.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"};w.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"};w.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"};w.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"};w.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"};w.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"};w.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"};w.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var Jr=w.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};w.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function Zr(t,e,r,s){var i=t*t,a=e*e,n=(i-a)/i,o=0;s?(t*=1-n*(Or+n*(Rr+n*Lr)),i=t*t,n=0):o=Math.sqrt(n);var h=(i-a)/a;return{es:n,e:o,ep2:h}}function $r(t,e,r,s,i){if(!t){var a=K(w,s);a||(a=Jr),t=a.a,e=a.b,r=a.rf}return r&&!e&&(e=(1-1/r)*t),(r===0||Math.abs(t-e)<_)&&(i=!0,e=t),{a:t,b:e,rf:r,sphere:i}}var U={};U.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"};U.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"};U.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"};U.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"};U.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"};U.potsdam={towgs84:"606.0,23.0,413.0",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"};U.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"};U.hermannskogel={towgs84:"653.0,-212.0,449.0",ellipse:"bessel",datumName:"Hermannskogel"};U.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"};U.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"};U.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"};U.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"};U.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"};U.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"};U.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"};U.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"};U.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};function ma(t,e,r,s,i,a){var n={};return t===void 0||t==="none"?n.datum_type=ae:n.datum_type=Fr,e&&(n.datum_params=e.map(parseFloat),(n.datum_params[0]!==0||n.datum_params[1]!==0||n.datum_params[2]!==0)&&(n.datum_type=st),n.datum_params.length>3&&(n.datum_params[3]!==0||n.datum_params[4]!==0||n.datum_params[5]!==0||n.datum_params[6]!==0)&&(n.datum_type=it,n.datum_params[3]*=At,n.datum_params[4]*=At,n.datum_params[5]*=At,n.datum_params[6]=n.datum_params[6]/1e6+1)),n.a=r,n.b=s,n.es=i,n.ep2=a,n}var Kr=ma;function jt(t,e){if(!(this instanceof jt))return new jt(t);e=e||function(h){if(h)throw h};var r=Dr(t);if(typeof r!="object"){e(t);return}var s=jt.projections.get(r.projName);if(!s){e(t);return}if(r.datumCode&&r.datumCode!=="none"){var i=K(U,r.datumCode);i&&(r.datum_params=i.towgs84?i.towgs84.split(","):null,r.ellps=i.ellipse,r.datumName=i.datumName?i.datumName:r.datumCode)}r.k0=r.k0||1,r.axis=r.axis||"enu",r.ellps=r.ellps||"wgs84";var a=$r(r.a,r.b,r.rf,r.ellps,r.sphere),n=Zr(a.a,a.b,a.rf,r.R_A),o=r.datum||Kr(r.datumCode,r.datum_params,a.a,a.b,n.es,n.ep2);sr(this,r),sr(this,s),this.a=a.a,this.b=a.b,this.rf=a.rf,this.sphere=a.sphere,this.es=n.es,this.e=n.e,this.ep2=n.ep2,this.datum=o,this.init(),e(null,this)}jt.projections=Xr;jt.projections.start();var wt=jt;function Qr(t,e){return t.datum_type!==e.datum_type||t.a!==e.a||Math.abs(t.es-e.es)>5e-11?!1:t.datum_type===st?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:t.datum_type===it?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6]:!0}function Ee(t,e,r){var s=t.x,i=t.y,a=t.z?t.z:0,n,o,h,f;if(i<-b&&i>-1.001*b)i=-b;else if(i>b&&i<1.001*b)i=b;else{if(i<-b)return{x:-1/0,y:-1/0,z:t.z};if(i>b)return{x:1/0,y:1/0,z:t.z}}return s>Math.PI&&(s-=2*Math.PI),o=Math.sin(i),f=Math.cos(i),h=o*o,n=r/Math.sqrt(1-e*h),{x:(n+a)*f*Math.cos(s),y:(n+a)*f*Math.sin(s),z:(n*(1-e)+a)*o}}function Se(t,e,r,s){var i=1e-12,a=i*i,n=30,o,h,f,c,l,u,m,d,p,v,g,x,M,S=t.x,I=t.y,P=t.z?t.z:0,B,N,Y;if(o=Math.sqrt(S*S+I*I),h=Math.sqrt(S*S+I*I+P*P),o/r<i){if(B=0,h/r<i)return N=b,Y=-s,{x:t.x,y:t.y,z:t.z}}else B=Math.atan2(I,S);f=P/h,c=o/h,l=1/Math.sqrt(1-e*(2-e)*c*c),d=c*(1-e)*l,p=f*l,M=0;do M++,m=r/Math.sqrt(1-e*p*p),Y=o*d+P*p-m*(1-e*p*p),u=e*m/(m+Y),l=1/Math.sqrt(1-u*(2-u)*c*c),v=c*(1-u)*l,g=f*l,x=g*d-v*p,d=v,p=g;while(x*x>a&&M<n);return N=Math.atan(g/Math.abs(v)),{x:B,y:N,z:Y}}function Yr(t,e,r){if(e===st)return{x:t.x+r[0],y:t.y+r[1],z:t.z+r[2]};if(e===it){var s=r[0],i=r[1],a=r[2],n=r[3],o=r[4],h=r[5],f=r[6];return{x:f*(t.x-h*t.y+o*t.z)+s,y:f*(h*t.x+t.y-n*t.z)+i,z:f*(-o*t.x+n*t.y+t.z)+a}}}function ts(t,e,r){if(e===st)return{x:t.x-r[0],y:t.y-r[1],z:t.z-r[2]};if(e===it){var s=r[0],i=r[1],a=r[2],n=r[3],o=r[4],h=r[5],f=r[6],c=(t.x-s)/f,l=(t.y-i)/f,u=(t.z-a)/f;return{x:c+h*l-o*u,y:-h*c+l+n*u,z:o*c-n*l+u}}}function Ae(t){return t===st||t===it}function es(t,e,r){return Qr(t,e)||t.datum_type===ae||e.datum_type===ae||t.es===e.es&&t.a===e.a&&!Ae(t.datum_type)&&!Ae(e.datum_type)?r:(r=Ee(r,t.es,t.a),Ae(t.datum_type)&&(r=Yr(r,t.datum_type,t.datum_params)),Ae(e.datum_type)&&(r=ts(r,e.datum_type,e.datum_params)),Se(r,e.es,e.a,e.b))}function ir(t,e,r){var s=r.x,i=r.y,a=r.z||0,n,o,h,f={};for(h=0;h<3;h++)if(!(e&&h===2&&r.z===void 0))switch(h===0?(n=s,"ew".indexOf(t.axis[h])!==-1?o="x":o="y"):h===1?(n=i,"ns".indexOf(t.axis[h])!==-1?o="y":o="x"):(n=a,o="z"),t.axis[h]){case"e":case"w":case"n":case"s":f[o]=n;break;case"u":r[o]!==void 0&&(f.z=n);break;case"d":r[o]!==void 0&&(f.z=-n);break;default:return null}return f}function Ne(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}function ss(t){rs(t.x),rs(t.y)}function rs(t){if(typeof Number.isFinite=="function"){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if(typeof t!="number"||t!==t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function pa(t,e){return(t.datum.datum_type===st||t.datum.datum_type===it)&&e.datumCode!=="WGS84"||(e.datum.datum_type===st||e.datum.datum_type===it)&&t.datumCode!=="WGS84"}function Ft(t,e,r){var s;if(Array.isArray(r)&&(r=Ne(r)),ss(r),t.datum&&e.datum&&pa(t,e)&&(s=new wt("WGS84"),r=Ft(t,s,r),t=s),t.axis!=="enu"&&(r=ir(t,!1,r)),t.projName==="longlat")r={x:r.x*G,y:r.y*G,z:r.z||0};else if(t.to_meter&&(r={x:r.x*t.to_meter,y:r.y*t.to_meter,z:r.z||0}),r=t.inverse(r),!r)return;return t.from_greenwich&&(r.x+=t.from_greenwich),r=es(t.datum,e.datum,r),e.from_greenwich&&(r={x:r.x-e.from_greenwich,y:r.y,z:r.z||0}),e.projName==="longlat"?r={x:r.x*at,y:r.y*at,z:r.z||0}:(r=e.forward(r),e.to_meter&&(r={x:r.x/e.to_meter,y:r.y/e.to_meter,z:r.z||0})),e.axis!=="enu"?ir(e,!0,r):r}var is=wt("WGS84");function ar(t,e,r){var s,i,a;return Array.isArray(r)?(s=Ft(t,e,r)||{x:NaN,y:NaN},r.length>2?typeof t.name<"u"&&t.name==="geocent"||typeof e.name<"u"&&e.name==="geocent"?typeof s.z=="number"?[s.x,s.y,s.z].concat(r.splice(3)):[s.x,s.y,r[2]].concat(r.splice(3)):[s.x,s.y].concat(r.splice(2)):[s.x,s.y]):(i=Ft(t,e,r),a=Object.keys(r),a.length===2||a.forEach(function(n){if(typeof t.name<"u"&&t.name==="geocent"||typeof e.name<"u"&&e.name==="geocent"){if(n==="x"||n==="y"||n==="z")return}else if(n==="x"||n==="y")return;i[n]=r[n]}),i)}function as(t){return t instanceof wt?t:t.oProj?t.oProj:wt(t)}function ba(t,e,r){t=as(t);var s=!1,i;return typeof e>"u"?(e=t,t=is,s=!0):(typeof e.x<"u"||Array.isArray(e))&&(r=e,e=t,t=is,s=!0),e=as(e),r?ar(t,e,r):(i={forward:function(a){return ar(t,e,a)},inverse:function(a){return ar(e,t,a)}},s&&(i.oProj=e),i)}var Q=ba;var ns=6,hs="AJSAJS",fs="AFAFAF",Dt=65,Z=73,et=79,fe=86,le=90,ls={forward:or,inverse:va,toPoint:hr};function or(t,e){return e=e||5,ga(_a({lat:t[1],lon:t[0]}),e)}function va(t){var e=fr(us(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]}function hr(t){var e=fr(us(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function nr(t){return t*(Math.PI/180)}function os(t){return 180*(t/Math.PI)}function _a(t){var e=t.lat,r=t.lon,s=6378137,i=.00669438,a=.9996,n,o,h,f,c,l,u,m=nr(e),d=nr(r),p,v;v=Math.floor((r+180)/6)+1,r===180&&(v=60),e>=56&&e<64&&r>=3&&r<12&&(v=32),e>=72&&e<84&&(r>=0&&r<9?v=31:r>=9&&r<21?v=33:r>=21&&r<33?v=35:r>=33&&r<42&&(v=37)),n=(v-1)*6-180+3,p=nr(n),o=i/(1-i),h=s/Math.sqrt(1-i*Math.sin(m)*Math.sin(m)),f=Math.tan(m)*Math.tan(m),c=o*Math.cos(m)*Math.cos(m),l=Math.cos(m)*(d-p),u=s*((1-i/4-3*i*i/64-5*i*i*i/256)*m-(3*i/8+3*i*i/32+45*i*i*i/1024)*Math.sin(2*m)+(15*i*i/256+45*i*i*i/1024)*Math.sin(4*m)-35*i*i*i/3072*Math.sin(6*m));var g=a*h*(l+(1-f+c)*l*l*l/6+(5-18*f+f*f+72*c-58*o)*l*l*l*l*l/120)+5e5,x=a*(u+h*Math.tan(m)*(l*l/2+(5-f+9*c+4*c*c)*l*l*l*l/24+(61-58*f+f*f+600*c-330*o)*l*l*l*l*l*l/720));return e<0&&(x+=1e7),{northing:Math.round(x),easting:Math.round(g),zoneNumber:v,zoneLetter:ya(e)}}function fr(t){var e=t.northing,r=t.easting,s=t.zoneLetter,i=t.zoneNumber;if(i<0||i>60)return null;var a=.9996,n=6378137,o=.00669438,h,f=(1-Math.sqrt(1-o))/(1+Math.sqrt(1-o)),c,l,u,m,d,p,v,g,x,M=r-5e5,S=e;s<"N"&&(S-=1e7),v=(i-1)*6-180+3,h=o/(1-o),p=S/a,g=p/(n*(1-o/4-3*o*o/64-5*o*o*o/256)),x=g+(3*f/2-27*f*f*f/32)*Math.sin(2*g)+(21*f*f/16-55*f*f*f*f/32)*Math.sin(4*g)+151*f*f*f/96*Math.sin(6*g),c=n/Math.sqrt(1-o*Math.sin(x)*Math.sin(x)),l=Math.tan(x)*Math.tan(x),u=h*Math.cos(x)*Math.cos(x),m=n*(1-o)/Math.pow(1-o*Math.sin(x)*Math.sin(x),1.5),d=M/(c*a);var I=x-c*Math.tan(x)/m*(d*d/2-(5+3*l+10*u-4*u*u-9*h)*d*d*d*d/24+(61+90*l+298*u+45*l*l-252*h-3*u*u)*d*d*d*d*d*d/720);I=os(I);var P=(d-(1+2*l+u)*d*d*d/6+(5-2*u+28*l-3*u*u+8*h+24*l*l)*d*d*d*d*d/120)/Math.cos(x);P=v+os(P);var B;if(t.accuracy){var N=fr({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});B={top:N.lat,right:N.lon,bottom:I,left:P}}else B={lat:I,lon:P};return B}function ya(t){var e="Z";return 84>=t&&t>=72?e="X":72>t&&t>=64?e="W":64>t&&t>=56?e="V":56>t&&t>=48?e="U":48>t&&t>=40?e="T":40>t&&t>=32?e="S":32>t&&t>=24?e="R":24>t&&t>=16?e="Q":16>t&&t>=8?e="P":8>t&&t>=0?e="N":0>t&&t>=-8?e="M":-8>t&&t>=-16?e="L":-16>t&&t>=-24?e="K":-24>t&&t>=-32?e="J":-32>t&&t>=-40?e="H":-40>t&&t>=-48?e="G":-48>t&&t>=-56?e="F":-56>t&&t>=-64?e="E":-64>t&&t>=-72?e="D":-72>t&&t>=-80&&(e="C"),e}function ga(t,e){var r="00000"+t.easting,s="00000"+t.northing;return t.zoneNumber+t.zoneLetter+Ma(t.easting,t.northing,t.zoneNumber)+r.substr(r.length-5,e)+s.substr(s.length-5,e)}function Ma(t,e,r){var s=cs(r),i=Math.floor(t/1e5),a=Math.floor(e/1e5)%20;return xa(i,a,s)}function cs(t){var e=t%ns;return e===0&&(e=ns),e}function xa(t,e,r){var s=r-1,i=hs.charCodeAt(s),a=fs.charCodeAt(s),n=i+t-1,o=a+e,h=!1;n>le&&(n=n-le+Dt-1,h=!0),(n===Z||i<Z&&n>Z||(n>Z||i<Z)&&h)&&n++,(n===et||i<et&&n>et||(n>et||i<et)&&h)&&(n++,n===Z&&n++),n>le&&(n=n-le+Dt-1),o>fe?(o=o-fe+Dt-1,h=!0):h=!1,(o===Z||a<Z&&o>Z||(o>Z||a<Z)&&h)&&o++,(o===et||a<et&&o>et||(o>et||a<et)&&h)&&(o++,o===Z&&o++),o>fe&&(o=o-fe+Dt-1);var f=String.fromCharCode(n)+String.fromCharCode(o);return f}function us(t){if(t&&t.length===0)throw"MGRSPoint coverting from nothing";for(var e=t.length,r=null,s="",i,a=0;!/[A-Z]/.test(i=t.charAt(a));){if(a>=2)throw"MGRSPoint bad conversion from: "+t;s+=i,a++}var n=parseInt(s,10);if(a===0||a+3>e)throw"MGRSPoint bad conversion from: "+t;var o=t.charAt(a++);if(o<="A"||o==="B"||o==="Y"||o>="Z"||o==="I"||o==="O")throw"MGRSPoint zone letter "+o+" not handled: "+t;r=t.substring(a,a+=2);for(var h=cs(n),f=wa(r.charAt(0),h),c=Ia(r.charAt(1),h);c<Pa(o);)c+=2e6;var l=e-a;if(l%2!==0)throw`MGRSPoint has to have an even number
|
|
8
8
|
of digits after the zone letter and two 100km letters - front
|
|
9
9
|
half for easting meters, second half for
|
|
10
|
-
northing meters`+t;var u=l/2,m=0,d=0,p,v,g,x,M;return u>0&&(p=1e5/Math.pow(10,u),v=t.substring(a,a+u),m=parseFloat(v)*p,g=t.substring(a+u),d=parseFloat(g)*p),x=m+f,M=d+c,{easting:x,northing:M,zoneLetter:o,zoneNumber:n,accuracy:p}}function wa(t,e){for(var r=hs.charCodeAt(e-1),s=1e5,i=!1;r!==t.charCodeAt(0);){if(r++,r===Z&&r++,r===et&&r++,r>le){if(i)throw"Bad character: "+t;r=Dt,i=!0}s+=1e5}return s}function Ia(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var r=fs.charCodeAt(e-1),s=0,i=!1;r!==t.charCodeAt(0);){if(r++,r===Z&&r++,r===et&&r++,r>fe){if(i)throw"Bad character: "+t;r=Dt,i=!0}s+=1e5}return s}function Pa(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}function kt(t,e,r){if(!(this instanceof kt))return new kt(t,e,r);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if(typeof t=="object")this.x=t.x,this.y=t.y,this.z=t.z||0;else if(typeof t=="string"&&typeof e>"u"){var s=t.split(",");this.x=parseFloat(s[0],10),this.y=parseFloat(s[1],10),this.z=parseFloat(s[2],10)||0}else this.x=t,this.y=e,this.z=r||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}kt.fromMGRS=function(t){return new kt(hr(t))};kt.prototype.toMGRS=function(t){return or([this.x,this.y],t)};var ds=kt;var Ea=1,Sa=.25,ms=.046875,ps=.01953125,bs=.01068115234375,Aa=.75,Na=.46875,Fa=.013020833333333334,Oa=.007120768229166667,Ra=.3645833333333333,La=.005696614583333333,Ca=.3076171875;function Fe(t){var e=[];e[0]=Ea-t*(Sa+t*(ms+t*(ps+t*bs))),e[1]=t*(Aa-t*(ms+t*(ps+t*bs)));var r=t*t;return e[2]=r*(Na-t*(Fa+t*Oa)),r*=t,e[3]=r*(Ra-t*La),e[4]=r*t*Ca,e}function Ot(t,e,r,s){return r*=e,e*=e,s[0]*t-r*(s[1]+e*(s[2]+e*(s[3]+e*s[4])))}var Ta=20;function Oe(t,e,r){for(var s=1/(1-e),i=t,a=Ta;a;--a){var n=Math.sin(i),o=1-e*n*n;if(o=(Ot(i,n,Math.cos(i),r)-t)*(o*Math.sqrt(o))*s,i-=o,Math.abs(o)<_)return i}return i}function Ba(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.es&&(this.en=Fe(this.es),this.ml0=Ot(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function Ga(t){var e=t.x,r=t.y,s=y(e-this.long0),i,a,n,o=Math.sin(r),h=Math.cos(r);if(this.es){var c=h*s,l=Math.pow(c,2),u=this.ep2*Math.pow(h,2),m=Math.pow(u,2),d=Math.abs(h)>_?Math.tan(r):0,p=Math.pow(d,2),v=Math.pow(p,2);i=1-this.es*Math.pow(o,2),c=c/Math.sqrt(i);var g=Ot(r,o,h,this.en);a=this.a*(this.k0*c*(1+l/6*(1-p+u+l/20*(5-18*p+v+14*u-58*p*u+l/42*(61+179*v-v*p-479*p)))))+this.x0,n=this.a*(this.k0*(g-this.ml0+o*s*c/2*(1+l/12*(5-p+9*u+4*m+l/30*(61+v-58*p+270*u-330*p*u+l/56*(1385+543*v-v*p-3111*p))))))+this.y0}else{var f=h*Math.sin(s);if(Math.abs(Math.abs(f)-1)<_)return 93;if(a=.5*this.a*this.k0*Math.log((1+f)/(1-f))+this.x0,n=h*Math.cos(s)/Math.sqrt(1-Math.pow(f,2)),f=Math.abs(n),f>=1){if(f-1>_)return 93;n=0}else n=Math.acos(n);r<0&&(n=-n),n=this.a*this.k0*(n-this.lat0)+this.y0}return t.x=a,t.y=n,t}function Ua(t){var e,r,s,i,a=(t.x-this.x0)*(1/this.a),n=(t.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+n/this.k0,r=Oe(e,this.es,this.en),Math.abs(r)<b){var l=Math.sin(r),u=Math.cos(r),m=Math.abs(u)>_?Math.tan(r):0,d=this.ep2*Math.pow(u,2),p=Math.pow(d,2),v=Math.pow(m,2),g=Math.pow(v,2);e=1-this.es*Math.pow(l,2);var x=a*Math.sqrt(e)/this.k0,M=Math.pow(x,2);e=e*m,s=r-e*M/(1-this.es)*.5*(1-M/12*(5+3*v-9*d*v+d-4*p-M/30*(61+90*v-252*d*v+45*g+46*d-M/56*(1385+3633*v+4095*g+1574*g*v)))),i=y(this.long0+x*(1-M/6*(1+2*v+d-M/20*(5+28*v+24*g+8*d*v+6*d-M/42*(61+662*v+1320*g+720*g*v))))/u)}else s=b*ut(n),i=0;else{var o=Math.exp(a/this.k0),h=.5*(o-1/o),f=this.lat0+n/this.k0,c=Math.cos(f);e=Math.sqrt((1-Math.pow(c,2))/(1+Math.pow(h,2))),s=Math.asin(e),n<0&&(s=-s),h===0&&c===0?i=0:i=y(Math.atan2(h,c)+this.long0)}return t.x=i,t.y=s,t}var za=["Transverse_Mercator","Transverse Mercator","tmerc"],vs={init:Ba,forward:Ga,inverse:Ua,names:za};function Re(t){var e=Math.exp(t);return e=(e-1/e)/2,e}function ce(t,e){t=Math.abs(t),e=Math.abs(e);var r=Math.max(t,e),s=Math.min(t,e)/(r||1);return r*Math.sqrt(1+Math.pow(s,2))}function _s(t){var e=1+t,r=e-1;return r===0?t:t*Math.log(e)/r}function ys(t){var e=Math.abs(t);return e=_s(e*(1+e/(ce(1,e)+1))),t<0?-e:e}function Le(t,e){for(var r=2*Math.cos(2*e),s=t.length-1,i=t[s],a=0,n;--s>=0;)n=-a+r*i+t[s],a=i,i=n;return e+n*Math.sin(2*e)}function gs(t,e){for(var r=2*Math.cos(e),s=t.length-1,i=t[s],a=0,n;--s>=0;)n=-a+r*i+t[s],a=i,i=n;return Math.sin(e)*n}function Ms(t){var e=Math.exp(t);return e=(e+1/e)/2,e}function lr(t,e,r){for(var s=Math.sin(e),i=Math.cos(e),a=Re(r),n=Ms(r),o=2*i*n,h=-2*s*a,f=t.length-1,c=t[f],l=0,u=0,m=0,d,p;--f>=0;)d=u,p=l,u=c,l=m,c=-d+o*u-h*l+t[f],m=-p+h*u+o*l;return o=s*n,h=i*a,[o*c-h*m,o*m+h*c]}function qa(){if(this.es===void 0||this.es<=0)throw new Error("incorrect elliptical usage");this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),r=e;this.cgb[0]=e*(2+e*(-2/3+e*(-2+e*(116/45+e*(26/45+e*(-2854/675)))))),this.cbg[0]=e*(-2+e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))),r=r*e,this.cgb[1]=r*(7/3+e*(-8/5+e*(-227/45+e*(2704/315+e*(2323/945))))),this.cbg[1]=r*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),r=r*e,this.cgb[2]=r*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=r*(-26/15+e*(34/21+e*(8/5+e*(-12686/2835)))),r=r*e,this.cgb[3]=r*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=r*(1237/630+e*(-12/5+e*(-24832/14175))),r=r*e,this.cgb[4]=r*(4174/315+e*(-144838/6237)),this.cbg[4]=r*(-734/315+e*(109598/31185)),r=r*e,this.cgb[5]=r*(601676/22275),this.cbg[5]=r*(444337/155925),r=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+r*(1/4+r*(1/64+r/256))),this.utg[0]=e*(-.5+e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=r*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=r*(13/48+e*(-3/5+e*(557/1440+e*(281/630+e*(-1983433/1935360))))),r=r*e,this.utg[2]=r*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=r*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),r=r*e,this.utg[3]=r*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=r*(49561/161280+e*(-179/168+e*(6601661/7257600))),r=r*e,this.utg[4]=r*(-4583/161280+e*(108847/3991680)),this.gtu[4]=r*(34729/80640+e*(-3418889/1995840)),r=r*e,this.utg[5]=r*(-20648693/638668800),this.gtu[5]=r*(212378941/319334400);var s=Le(this.cbg,this.lat0);this.Zb=-this.Qn*(s+gs(this.gtu,2*s))}function ja(t){var e=y(t.x-this.long0),r=t.y;r=Le(this.cbg,r);var s=Math.sin(r),i=Math.cos(r),a=Math.sin(e),n=Math.cos(e);r=Math.atan2(s,n*i),e=Math.atan2(a*i,ce(s,i*n)),e=ys(Math.tan(e));var o=lr(this.gtu,2*r,2*e);r=r+o[0],e=e+o[1];var h,f;return Math.abs(e)<=2.623395162778?(h=this.a*(this.Qn*e)+this.x0,f=this.a*(this.Qn*r+this.Zb)+this.y0):(h=1/0,f=1/0),t.x=h,t.y=f,t}function Da(t){var e=(t.x-this.x0)*(1/this.a),r=(t.y-this.y0)*(1/this.a);r=(r-this.Zb)/this.Qn,e=e/this.Qn;var s,i;if(Math.abs(e)<=2.623395162778){var a=lr(this.utg,2*r,2*e);r=r+a[0],e=e+a[1],e=Math.atan(Re(e));var n=Math.sin(r),o=Math.cos(r),h=Math.sin(e),f=Math.cos(e);r=Math.atan2(n*f,ce(h,f*o)),e=Math.atan2(h,f*o),s=y(e+this.long0),i=Le(this.cgb,r)}else s=1/0,i=1/0;return t.x=s,t.y=i,t}var ka=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc"],Vt={init:qa,forward:ja,inverse:Da,names:ka};function xs(t,e){if(t===void 0){if(t=Math.floor((y(e)+Math.PI)*30/Math.PI)+1,t<0)return 0;if(t>60)return 60}return t}var Va="etmerc";function Wa(){var t=xs(this.zone,this.long0);if(t===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*G,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Vt.init.apply(this),this.forward=Vt.forward,this.inverse=Vt.inverse}var Ha=["Universal Transverse Mercator System","utm"],ws={init:Wa,names:Ha,dependsOn:Va};function Ce(t,e){return Math.pow((1-t)/(1+t),e)}var Xa=20;function Ja(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+E)/(Math.pow(Math.tan(.5*this.lat0+E),this.C)*Ce(this.e*t,this.ratexp))}function Za(t){var e=t.x,r=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*r+E),this.C)*Ce(this.e*Math.sin(r),this.ratexp))-b,t.x=this.C*e,t}function $a(t){for(var e=1e-14,r=t.x/this.C,s=t.y,i=Math.pow(Math.tan(.5*s+E)/this.K,1/this.C),a=Xa;a>0&&(s=2*Math.atan(i*Ce(this.e*Math.sin(t.y),-.5*this.e))-b,!(Math.abs(s-t.y)<e));--a)t.y=s;return a?(t.x=r,t.y=s,t):null}var Ka=["gauss"],Te={init:Ja,forward:Za,inverse:$a,names:Ka};function Qa(){Te.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function Ya(t){var e,r,s,i;return t.x=y(t.x-this.long0),Te.forward.apply(this,[t]),e=Math.sin(t.y),r=Math.cos(t.y),s=Math.cos(t.x),i=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*r*s),t.x=i*r*Math.sin(t.x),t.y=i*(this.cosc0*e-this.sinc0*r*s),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function tn(t){var e,r,s,i,a;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,a=Math.sqrt(t.x*t.x+t.y*t.y)){var n=2*Math.atan2(a,this.R2);e=Math.sin(n),r=Math.cos(n),i=Math.asin(r*this.sinc0+t.y*e*this.cosc0/a),s=Math.atan2(t.x*e,a*this.cosc0*r-t.y*this.sinc0*e)}else i=this.phic0,s=0;return t.x=s,t.y=i,Te.inverse.apply(this,[t]),t.x=y(t.x+this.long0),t}var en=["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"],Is={init:Qa,forward:Ya,inverse:tn,names:en};function rn(t,e,r){return e*=r,Math.tan(.5*(b+t))*Math.pow((1-e)/(1+e),.5*r)}function sn(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=_&&(this.k0=.5*(1+ut(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=_&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=_&&(this.k0=.5*this.cons*k(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/W(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=k(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-b,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function an(t){var e=t.x,r=t.y,s=Math.sin(r),i=Math.cos(r),a,n,o,h,f,c,l=y(e-this.long0);return Math.abs(Math.abs(e-this.long0)-Math.PI)<=_&&Math.abs(r+this.lat0)<=_?(t.x=NaN,t.y=NaN,t):this.sphere?(a=2*this.k0/(1+this.sinlat0*s+this.coslat0*i*Math.cos(l)),t.x=this.a*a*i*Math.sin(l)+this.x0,t.y=this.a*a*(this.coslat0*s-this.sinlat0*i*Math.cos(l))+this.y0,t):(n=2*Math.atan(this.ssfn_(r,s,this.e))-b,h=Math.cos(n),o=Math.sin(n),Math.abs(this.coslat0)<=_?(f=W(this.e,r*this.con,this.con*s),c=2*this.a*this.k0*f/this.cons,t.x=this.x0+c*Math.sin(e-this.long0),t.y=this.y0-this.con*c*Math.cos(e-this.long0),t):(Math.abs(this.sinlat0)<_?(a=2*this.a*this.k0/(1+h*Math.cos(l)),t.y=a*o):(a=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*o+this.cosX0*h*Math.cos(l))),t.y=a*(this.cosX0*o-this.sinX0*h*Math.cos(l))+this.y0),t.x=a*h*Math.sin(l)+this.x0,t))}function nn(t){t.x-=this.x0,t.y-=this.y0;var e,r,s,i,a,n=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var o=2*Math.atan(n/(2*this.a*this.k0));return e=this.long0,r=this.lat0,n<=_?(t.x=e,t.y=r,t):(r=Math.asin(Math.cos(o)*this.sinlat0+t.y*Math.sin(o)*this.coslat0/n),Math.abs(this.coslat0)<_?this.lat0>0?e=y(this.long0+Math.atan2(t.x,-1*t.y)):e=y(this.long0+Math.atan2(t.x,t.y)):e=y(this.long0+Math.atan2(t.x*Math.sin(o),n*this.coslat0*Math.cos(o)-t.y*this.sinlat0*Math.sin(o))),t.x=e,t.y=r,t)}else if(Math.abs(this.coslat0)<=_){if(n<=_)return r=this.lat0,e=this.long0,t.x=e,t.y=r,t;t.x*=this.con,t.y*=this.con,s=n*this.cons/(2*this.a*this.k0),r=this.con*vt(this.e,s),e=this.con*y(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else i=2*Math.atan(n*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,n<=_?a=this.X0:(a=Math.asin(Math.cos(i)*this.sinX0+t.y*Math.sin(i)*this.cosX0/n),e=y(this.long0+Math.atan2(t.x*Math.sin(i),n*this.cosX0*Math.cos(i)-t.y*this.sinX0*Math.sin(i)))),r=-1*vt(this.e,Math.tan(.5*(b+a)));return t.x=e,t.y=r,t}var on=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],Ps={init:sn,forward:an,inverse:nn,names:on,ssfn_:rn};function hn(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),r=this.a,s=this.rf,i=1/s,a=2*i-Math.pow(i,2),n=this.e=Math.sqrt(a);this.R=this.k0*r*Math.sqrt(1-a)/(1-a*Math.pow(e,2)),this.alpha=Math.sqrt(1+a/(1-a)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),h=Math.log(Math.tan(Math.PI/4+t/2)),f=Math.log((1+n*e)/(1-n*e));this.K=o-this.alpha*h+this.alpha*n/2*f}function fn(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),r=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),s=-this.alpha*(e+r)+this.K,i=2*(Math.atan(Math.exp(s))-Math.PI/4),a=this.alpha*(t.x-this.lambda0),n=Math.atan(Math.sin(a)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(a))),o=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(a));return t.y=this.R/2*Math.log((1+Math.sin(o))/(1-Math.sin(o)))+this.y0,t.x=this.R*n+this.x0,t}function ln(t){for(var e=t.x-this.x0,r=t.y-this.y0,s=e/this.R,i=2*(Math.atan(Math.exp(r/this.R))-Math.PI/4),a=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(s)),n=Math.atan(Math.sin(s)/(Math.cos(this.b0)*Math.cos(s)-Math.sin(this.b0)*Math.tan(i))),o=this.lambda0+n/this.alpha,h=0,f=a,c=-1e3,l=0;Math.abs(f-c)>1e-7;){if(++l>20)return;h=1/this.alpha*(Math.log(Math.tan(Math.PI/4+a/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(f))/2)),c=f,f=2*Math.atan(Math.exp(h))-Math.PI/2}return t.x=o,t.y=f,t}var cn=["somerc"],Es={init:hn,forward:fn,inverse:ln,names:cn};function un(){this.no_off=this.no_off||!1,this.no_rot=this.no_rot||!1,isNaN(this.k0)&&(this.k0=1);var t=Math.sin(this.lat0),e=Math.cos(this.lat0),r=this.e*t;this.bl=Math.sqrt(1+this.es/(1-this.es)*Math.pow(e,4)),this.al=this.a*this.bl*this.k0*Math.sqrt(1-this.es)/(1-r*r);var s=W(this.e,this.lat0,t),i=this.bl/e*Math.sqrt((1-this.es)/(1-r*r));i*i<1&&(i=1);var a,n;if(!isNaN(this.longc))this.lat0>=0?a=i+Math.sqrt(i*i-1):a=i-Math.sqrt(i*i-1),this.el=a*Math.pow(s,this.bl),n=.5*(a-1/a),this.gamma0=Math.asin(Math.sin(this.alpha)/i),this.long0=this.longc-Math.asin(n*Math.tan(this.gamma0))/this.bl;else{var o=W(this.e,this.lat1,Math.sin(this.lat1)),h=W(this.e,this.lat2,Math.sin(this.lat2));this.lat0>=0?this.el=(i+Math.sqrt(i*i-1))*Math.pow(s,this.bl):this.el=(i-Math.sqrt(i*i-1))*Math.pow(s,this.bl);var f=Math.pow(o,this.bl),c=Math.pow(h,this.bl);a=this.el/f,n=.5*(a-1/a);var l=(this.el*this.el-c*f)/(this.el*this.el+c*f),u=(c-f)/(c+f),m=y(this.long1-this.long2);this.long0=.5*(this.long1+this.long2)-Math.atan(l*Math.tan(.5*this.bl*m)/u)/this.bl,this.long0=y(this.long0);var d=y(this.long1-this.long0);this.gamma0=Math.atan(Math.sin(this.bl*d)/n),this.alpha=Math.asin(i*Math.sin(this.gamma0))}this.no_off?this.uc=0:this.lat0>=0?this.uc=this.al/this.bl*Math.atan2(Math.sqrt(i*i-1),Math.cos(this.alpha)):this.uc=-1*this.al/this.bl*Math.atan2(Math.sqrt(i*i-1),Math.cos(this.alpha))}function dn(t){var e=t.x,r=t.y,s=y(e-this.long0),i,a,n;if(Math.abs(Math.abs(r)-b)<=_)r>0?n=-1:n=1,a=this.al/this.bl*Math.log(Math.tan(E+n*this.gamma0*.5)),i=-1*n*b*this.al/this.bl;else{var o=W(this.e,r,Math.sin(r)),h=this.el/Math.pow(o,this.bl),f=.5*(h-1/h),c=.5*(h+1/h),l=Math.sin(this.bl*s),u=(f*Math.sin(this.gamma0)-l*Math.cos(this.gamma0))/c;Math.abs(Math.abs(u)-1)<=_?a=Number.POSITIVE_INFINITY:a=.5*this.al*Math.log((1-u)/(1+u))/this.bl,Math.abs(Math.cos(this.bl*s))<=_?i=this.al*this.bl*s:i=this.al*Math.atan2(f*Math.cos(this.gamma0)+l*Math.sin(this.gamma0),Math.cos(this.bl*s))/this.bl}return this.no_rot?(t.x=this.x0+i,t.y=this.y0+a):(i-=this.uc,t.x=this.x0+a*Math.cos(this.alpha)+i*Math.sin(this.alpha),t.y=this.y0+i*Math.cos(this.alpha)-a*Math.sin(this.alpha)),t}function mn(t){var e,r;this.no_rot?(r=t.y-this.y0,e=t.x-this.x0):(r=(t.x-this.x0)*Math.cos(this.alpha)-(t.y-this.y0)*Math.sin(this.alpha),e=(t.y-this.y0)*Math.cos(this.alpha)+(t.x-this.x0)*Math.sin(this.alpha),e+=this.uc);var s=Math.exp(-1*this.bl*r/this.al),i=.5*(s-1/s),a=.5*(s+1/s),n=Math.sin(this.bl*e/this.al),o=(n*Math.cos(this.gamma0)+i*Math.sin(this.gamma0))/a,h=Math.pow(this.el/Math.sqrt((1+o)/(1-o)),1/this.bl);return Math.abs(o-1)<_?(t.x=this.long0,t.y=b):Math.abs(o+1)<_?(t.x=this.long0,t.y=-1*b):(t.y=vt(this.e,h),t.x=y(this.long0-Math.atan2(i*Math.cos(this.gamma0)-n*Math.sin(this.gamma0),Math.cos(this.bl*e/this.al))/this.bl)),t}var pn=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","omerc"],Ss={init:un,forward:dn,inverse:mn,names:pn};function bn(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<_)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var e=Math.sin(this.lat1),r=Math.cos(this.lat1),s=k(this.e,e,r),i=W(this.e,this.lat1,e),a=Math.sin(this.lat2),n=Math.cos(this.lat2),o=k(this.e,a,n),h=W(this.e,this.lat2,a),f=W(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>_?this.ns=Math.log(s/o)/Math.log(i/h):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=s/(this.ns*Math.pow(i,this.ns)),this.rh=this.a*this.f0*Math.pow(f,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function vn(t){var e=t.x,r=t.y;Math.abs(2*Math.abs(r)-Math.PI)<=_&&(r=ut(r)*(b-2*_));var s=Math.abs(Math.abs(r)-b),i,a;if(s>_)i=W(this.e,r,Math.sin(r)),a=this.a*this.f0*Math.pow(i,this.ns);else{if(s=r*this.ns,s<=0)return null;a=0}var n=this.ns*y(e-this.long0);return t.x=this.k0*(a*Math.sin(n))+this.x0,t.y=this.k0*(this.rh-a*Math.cos(n))+this.y0,t}function _n(t){var e,r,s,i,a,n=(t.x-this.x0)/this.k0,o=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(n*n+o*o),r=1):(e=-Math.sqrt(n*n+o*o),r=-1);var h=0;if(e!==0&&(h=Math.atan2(r*n,r*o)),e!==0||this.ns>0){if(r=1/this.ns,s=Math.pow(e/(this.a*this.f0),r),i=vt(this.e,s),i===-9999)return null}else i=-b;return a=y(h/this.ns+this.long0),t.x=a,t.y=i,t}var yn=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_2SP","lcc"],As={init:bn,forward:vn,inverse:_n,names:yn};function gn(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function Mn(t){var e,r,s,i,a,n,o,h=t.x,f=t.y,c=y(h-this.long0);return e=Math.pow((1+this.e*Math.sin(f))/(1-this.e*Math.sin(f)),this.alfa*this.e/2),r=2*(Math.atan(this.k*Math.pow(Math.tan(f/2+this.s45),this.alfa)/e)-this.s45),s=-c*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(r)+Math.sin(this.ad)*Math.cos(r)*Math.cos(s)),a=Math.asin(Math.cos(r)*Math.sin(s)/Math.cos(i)),n=this.n*a,o=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(i/2+this.s45),this.n),t.y=o*Math.cos(n)/1,t.x=o*Math.sin(n)/1,this.czech||(t.y*=-1,t.x*=-1),t}function xn(t){var e,r,s,i,a,n,o,h,f=t.x;t.x=t.y,t.y=f,this.czech||(t.y*=-1,t.x*=-1),n=Math.sqrt(t.x*t.x+t.y*t.y),a=Math.atan2(t.y,t.x),i=a/Math.sin(this.s0),s=2*(Math.atan(Math.pow(this.ro0/n,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(s)-Math.sin(this.ad)*Math.cos(s)*Math.cos(i)),r=Math.asin(Math.cos(s)*Math.sin(i)/Math.cos(e)),t.x=this.long0-r/this.alfa,o=e,h=0;var c=0;do t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-t.y)<1e-10&&(h=1),o=t.y,c+=1;while(h===0&&c<15);return c>=15?null:t}var wn=["Krovak","krovak"],Ns={init:gn,forward:Mn,inverse:xn,names:wn};function z(t,e,r,s,i){return t*i-e*Math.sin(2*i)+r*Math.sin(4*i)-s*Math.sin(6*i)}function _t(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function yt(t){return .375*t*(1+.25*t*(1+.46875*t))}function gt(t){return .05859375*t*t*(1+.75*t)}function Mt(t){return t*t*t*(35/3072)}function xt(t,e,r){var s=e*r;return t/Math.sqrt(1-s*s)}function nt(t){return Math.abs(t)<b?t:t-ut(t)*Math.PI}function Rt(t,e,r,s,i){var a,n;a=t/e;for(var o=0;o<15;o++)if(n=(t-(e*a-r*Math.sin(2*a)+s*Math.sin(4*a)-i*Math.sin(6*a)))/(e-2*r*Math.cos(2*a)+4*s*Math.cos(4*a)-6*i*Math.cos(6*a)),a+=n,Math.abs(n)<=1e-10)return a;return NaN}function In(){this.sphere||(this.e0=_t(this.es),this.e1=yt(this.es),this.e2=gt(this.es),this.e3=Mt(this.es),this.ml0=this.a*z(this.e0,this.e1,this.e2,this.e3,this.lat0))}function Pn(t){var e,r,s=t.x,i=t.y;if(s=y(s-this.long0),this.sphere)e=this.a*Math.asin(Math.cos(i)*Math.sin(s)),r=this.a*(Math.atan2(Math.tan(i),Math.cos(s))-this.lat0);else{var a=Math.sin(i),n=Math.cos(i),o=xt(this.a,this.e,a),h=Math.tan(i)*Math.tan(i),f=s*Math.cos(i),c=f*f,l=this.es*n*n/(1-this.es),u=this.a*z(this.e0,this.e1,this.e2,this.e3,i);e=o*f*(1-c*h*(1/6-(8-h+8*l)*c/120)),r=u-this.ml0+o*a/n*c*(.5+(5-h+6*l)*c/24)}return t.x=e+this.x0,t.y=r+this.y0,t}function En(t){t.x-=this.x0,t.y-=this.y0;var e=t.x/this.a,r=t.y/this.a,s,i;if(this.sphere){var a=r+this.lat0;s=Math.asin(Math.sin(a)*Math.cos(e)),i=Math.atan2(Math.tan(e),Math.cos(a))}else{var n=this.ml0/this.a+r,o=Rt(n,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(o)-b)<=_)return t.x=this.long0,t.y=b,r<0&&(t.y*=-1),t;var h=xt(this.a,this.e,Math.sin(o)),f=h*h*h/this.a/this.a*(1-this.es),c=Math.pow(Math.tan(o),2),l=e*this.a/h,u=l*l;s=o-h*Math.tan(o)/f*l*l*(.5-(1+3*c)*l*l/24),i=l*(1-u*(c/3+(1+3*c)*c*u/15))/Math.cos(o)}return t.x=y(i+this.long0),t.y=nt(s),t}var Sn=["Cassini","Cassini_Soldner","cass"],Fs={init:In,forward:Pn,inverse:En,names:Sn};function ot(t,e){var r;return t>1e-7?(r=t*e,(1-t*t)*(e/(1-r*r)-.5/t*Math.log((1-r)/(1+r)))):2*e}var An=1,Nn=2,Fn=3,On=4;function Rn(){var t=Math.abs(this.lat0);if(Math.abs(t-b)<_?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(t)<_?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0){var e;switch(this.qp=ot(this.e,1),this.mmf=.5/(1-this.es),this.apa=jn(this.es),this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=ot(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function Ln(t){var e,r,s,i,a,n,o,h,f,c,l=t.x,u=t.y;if(l=y(l-this.long0),this.sphere){if(a=Math.sin(u),c=Math.cos(u),s=Math.cos(l),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(r=this.mode===this.EQUIT?1+c*s:1+this.sinph0*a+this.cosph0*c*s,r<=_)return null;r=Math.sqrt(2/r),e=r*c*Math.sin(l),r*=this.mode===this.EQUIT?a:this.cosph0*a-this.sinph0*c*s}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(s=-s),Math.abs(u+this.lat0)<_)return null;r=E-u*.5,r=2*(this.mode===this.S_POLE?Math.cos(r):Math.sin(r)),e=r*Math.sin(l),r*=s}}else{switch(o=0,h=0,f=0,s=Math.cos(l),i=Math.sin(l),a=Math.sin(u),n=ot(this.e,a),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(o=n/this.qp,h=Math.sqrt(1-o*o)),this.mode){case this.OBLIQ:f=1+this.sinb1*o+this.cosb1*h*s;break;case this.EQUIT:f=1+h*s;break;case this.N_POLE:f=b+u,n=this.qp-n;break;case this.S_POLE:f=u-b,n=this.qp+n;break}if(Math.abs(f)<_)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:f=Math.sqrt(2/f),this.mode===this.OBLIQ?r=this.ymf*f*(this.cosb1*o-this.sinb1*h*s):r=(f=Math.sqrt(2/(1+h*s)))*o*this.ymf,e=this.xmf*f*h*i;break;case this.N_POLE:case this.S_POLE:n>=0?(e=(f=Math.sqrt(n))*i,r=s*(this.mode===this.S_POLE?f:-f)):e=r=0;break}}return t.x=this.a*e+this.x0,t.y=this.a*r+this.y0,t}function Cn(t){t.x-=this.x0,t.y-=this.y0;var e=t.x/this.a,r=t.y/this.a,s,i,a,n,o,h,f;if(this.sphere){var c=0,l,u=0;if(l=Math.sqrt(e*e+r*r),i=l*.5,i>1)return null;switch(i=2*Math.asin(i),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(u=Math.sin(i),c=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(l)<=_?0:Math.asin(r*u/l),e*=u,r=c*l;break;case this.OBLIQ:i=Math.abs(l)<=_?this.lat0:Math.asin(c*this.sinph0+r*u*this.cosph0/l),e*=u*this.cosph0,r=(c-Math.sin(i)*this.sinph0)*l;break;case this.N_POLE:r=-r,i=b-i;break;case this.S_POLE:i-=b;break}s=r===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(e,r)}else{if(f=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e/=this.dd,r*=this.dd,h=Math.sqrt(e*e+r*r),h<_)return t.x=this.long0,t.y=this.lat0,t;n=2*Math.asin(.5*h/this.rq),a=Math.cos(n),e*=n=Math.sin(n),this.mode===this.OBLIQ?(f=a*this.sinb1+r*n*this.cosb1/h,o=this.qp*f,r=h*this.cosb1*a-r*this.sinb1*n):(f=r*n/h,o=this.qp*f,r=h*a)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),o=e*e+r*r,!o)return t.x=this.long0,t.y=this.lat0,t;f=1-o/this.qp,this.mode===this.S_POLE&&(f=-f)}s=Math.atan2(e,r),i=Dn(Math.asin(f),this.apa)}return t.x=y(this.long0+s),t.y=i,t}var Tn=.3333333333333333,Bn=.17222222222222222,Gn=.10257936507936508,Un=.06388888888888888,zn=.0664021164021164,qn=.016415012942191543;function jn(t){var e,r=[];return r[0]=t*Tn,e=t*t,r[0]+=e*Bn,r[1]=e*Un,e*=t,r[0]+=e*Gn,r[1]+=e*zn,r[2]=e*qn,r}function Dn(t,e){var r=t+t;return t+e[0]*Math.sin(r)+e[1]*Math.sin(r+r)+e[2]*Math.sin(r+r+r)}var kn=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],Os={init:Rn,forward:Ln,inverse:Cn,names:kn,S_POLE:An,N_POLE:Nn,EQUIT:Fn,OBLIQ:On};function $(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}function Vn(){Math.abs(this.lat1+this.lat2)<_||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=k(this.e3,this.sin_po,this.cos_po),this.qs1=ot(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=k(this.e3,this.sin_po,this.cos_po),this.qs2=ot(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=ot(this.e3,this.sin_po,this.cos_po),Math.abs(this.lat1-this.lat2)>_?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function Wn(t){var e=t.x,r=t.y;this.sin_phi=Math.sin(r),this.cos_phi=Math.cos(r);var s=ot(this.e3,this.sin_phi,this.cos_phi),i=this.a*Math.sqrt(this.c-this.ns0*s)/this.ns0,a=this.ns0*y(e-this.long0),n=i*Math.sin(a)+this.x0,o=this.rh-i*Math.cos(a)+this.y0;return t.x=n,t.y=o,t}function Hn(t){var e,r,s,i,a,n;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),s=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),s=-1),i=0,e!==0&&(i=Math.atan2(s*t.x,s*t.y)),s=e*this.ns0/this.a,this.sphere?n=Math.asin((this.c-s*s)/(2*this.ns0)):(r=(this.c-s*s)/this.ns0,n=this.phi1z(this.e3,r)),a=y(i/this.ns0+this.long0),t.x=a,t.y=n,t}function Xn(t,e){var r,s,i,a,n,o=$(.5*e);if(t<_)return o;for(var h=t*t,f=1;f<=25;f++)if(r=Math.sin(o),s=Math.cos(o),i=t*r,a=1-i*i,n=.5*a*a/s*(e/(1-h)-r/a+.5/t*Math.log((1-i)/(1+i))),o=o+n,Math.abs(n)<=1e-7)return o;return null}var Jn=["Albers_Conic_Equal_Area","Albers","aea"],Rs={init:Vn,forward:Wn,inverse:Hn,names:Jn,phi1z:Xn};function Zn(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function $n(t){var e,r,s,i,a,n,o,h,f=t.x,c=t.y;return s=y(f-this.long0),e=Math.sin(c),r=Math.cos(c),i=Math.cos(s),n=this.sin_p14*e+this.cos_p14*r*i,a=1,n>0||Math.abs(n)<=_?(o=this.x0+this.a*a*r*Math.sin(s)/n,h=this.y0+this.a*a*(this.cos_p14*e-this.sin_p14*r*i)/n):(o=this.x0+this.infinity_dist*r*Math.sin(s),h=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*r*i)),t.x=o,t.y=h,t}function Kn(t){var e,r,s,i,a,n;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(i=Math.atan2(e,this.rc),r=Math.sin(i),s=Math.cos(i),n=$(s*this.sin_p14+t.y*r*this.cos_p14/e),a=Math.atan2(t.x*r,e*this.cos_p14*s-t.y*this.sin_p14*r),a=y(this.long0+a)):(n=this.phic0,a=0),t.x=a,t.y=n,t}var Qn=["gnom"],Ls={init:Zn,forward:$n,inverse:Kn,names:Qn};function Cs(t,e){var r=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-r)<1e-6)return e<0?-1*b:b;for(var s=Math.asin(.5*e),i,a,n,o,h=0;h<30;h++)if(a=Math.sin(s),n=Math.cos(s),o=t*a,i=Math.pow(1-o*o,2)/(2*n)*(e/(1-t*t)-a/(1-o*o)+.5/t*Math.log((1-o)/(1+o))),s+=i,Math.abs(i)<=1e-10)return s;return NaN}function Yn(){this.sphere||(this.k0=k(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function to(t){var e=t.x,r=t.y,s,i,a=y(e-this.long0);if(this.sphere)s=this.x0+this.a*a*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(r)/Math.cos(this.lat_ts);else{var n=ot(this.e,Math.sin(r));s=this.x0+this.a*this.k0*a,i=this.y0+this.a*n*.5/this.k0}return t.x=s,t.y=i,t}function eo(t){t.x-=this.x0,t.y-=this.y0;var e,r;return this.sphere?(e=y(this.long0+t.x/this.a/Math.cos(this.lat_ts)),r=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(r=Cs(this.e,2*t.y*this.k0/this.a),e=y(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=r,t}var ro=["cea"],Ts={init:Yn,forward:to,inverse:eo,names:ro};function so(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function io(t){var e=t.x,r=t.y,s=y(e-this.long0),i=nt(r-this.lat0);return t.x=this.x0+this.a*s*this.rc,t.y=this.y0+this.a*i,t}function ao(t){var e=t.x,r=t.y;return t.x=y(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=nt(this.lat0+(r-this.y0)/this.a),t}var no=["Equirectangular","Equidistant_Cylindrical","eqc"],Bs={init:so,forward:io,inverse:ao,names:no};var Gs=20;function oo(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=_t(this.es),this.e1=yt(this.es),this.e2=gt(this.es),this.e3=Mt(this.es),this.ml0=this.a*z(this.e0,this.e1,this.e2,this.e3,this.lat0)}function ho(t){var e=t.x,r=t.y,s,i,a,n=y(e-this.long0);if(a=n*Math.sin(r),this.sphere)Math.abs(r)<=_?(s=this.a*n,i=-1*this.a*this.lat0):(s=this.a*Math.sin(a)/Math.tan(r),i=this.a*(nt(r-this.lat0)+(1-Math.cos(a))/Math.tan(r)));else if(Math.abs(r)<=_)s=this.a*n,i=-1*this.ml0;else{var o=xt(this.a,this.e,Math.sin(r))/Math.tan(r);s=o*Math.sin(a),i=this.a*z(this.e0,this.e1,this.e2,this.e3,r)-this.ml0+o*(1-Math.cos(a))}return t.x=s+this.x0,t.y=i+this.y0,t}function fo(t){var e,r,s,i,a,n,o,h,f;if(s=t.x-this.x0,i=t.y-this.y0,this.sphere)if(Math.abs(i+this.a*this.lat0)<=_)e=y(s/this.a+this.long0),r=0;else{n=this.lat0+i/this.a,o=s*s/this.a/this.a+n*n,h=n;var c;for(a=Gs;a;--a)if(c=Math.tan(h),f=-1*(n*(h*c+1)-h-.5*(h*h+o)*c)/((h-n)/c-1),h+=f,Math.abs(f)<=_){r=h;break}e=y(this.long0+Math.asin(s*Math.tan(h)/this.a)/Math.sin(r))}else if(Math.abs(i+this.ml0)<=_)r=0,e=y(this.long0+s/this.a);else{n=(this.ml0+i)/this.a,o=s*s/this.a/this.a+n*n,h=n;var l,u,m,d,p;for(a=Gs;a;--a)if(p=this.e*Math.sin(h),l=Math.sqrt(1-p*p)*Math.tan(h),u=this.a*z(this.e0,this.e1,this.e2,this.e3,h),m=this.e0-2*this.e1*Math.cos(2*h)+4*this.e2*Math.cos(4*h)-6*this.e3*Math.cos(6*h),d=u/this.a,f=(n*(l*d+1)-d-.5*l*(d*d+o))/(this.es*Math.sin(2*h)*(d*d+o-2*n*d)/(4*l)+(n-d)*(l*m-2/Math.sin(2*h))-m),h-=f,Math.abs(f)<=_){r=h;break}l=Math.sqrt(1-this.es*Math.pow(Math.sin(r),2))*Math.tan(r),e=y(this.long0+Math.asin(s*l/this.a)/Math.sin(r))}return t.x=e,t.y=r,t}var lo=["Polyconic","poly"],Us={init:oo,forward:ho,inverse:fo,names:lo};function co(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function uo(t){var e,r=t.x,s=t.y,i=s-this.lat0,a=r-this.long0,n=i/At*1e-5,o=a,h=1,f=0;for(e=1;e<=10;e++)h=h*n,f=f+this.A[e]*h;var c=f,l=o,u=1,m=0,d,p,v=0,g=0;for(e=1;e<=6;e++)d=u*c-m*l,p=m*c+u*l,u=d,m=p,v=v+this.B_re[e]*u-this.B_im[e]*m,g=g+this.B_im[e]*u+this.B_re[e]*m;return t.x=g*this.a+this.x0,t.y=v*this.a+this.y0,t}function mo(t){var e,r=t.x,s=t.y,i=r-this.x0,a=s-this.y0,n=a/this.a,o=i/this.a,h=1,f=0,c,l,u=0,m=0;for(e=1;e<=6;e++)c=h*n-f*o,l=f*n+h*o,h=c,f=l,u=u+this.C_re[e]*h-this.C_im[e]*f,m=m+this.C_im[e]*h+this.C_re[e]*f;for(var d=0;d<this.iterations;d++){var p=u,v=m,g,x,M=n,S=o;for(e=2;e<=6;e++)g=p*u-v*m,x=v*u+p*m,p=g,v=x,M=M+(e-1)*(this.B_re[e]*p-this.B_im[e]*v),S=S+(e-1)*(this.B_im[e]*p+this.B_re[e]*v);p=1,v=0;var I=this.B_re[1],P=this.B_im[1];for(e=2;e<=6;e++)g=p*u-v*m,x=v*u+p*m,p=g,v=x,I=I+e*(this.B_re[e]*p-this.B_im[e]*v),P=P+e*(this.B_im[e]*p+this.B_re[e]*v);var B=I*I+P*P;u=(M*I+S*P)/B,m=(S*I-M*P)/B}var N=u,Y=m,q=1,rt=0;for(e=1;e<=9;e++)q=q*N,rt=rt+this.D[e]*q;var pt=this.lat0+rt*At*1e5,se=this.long0+Y;return t.x=se,t.y=pt,t}var po=["New_Zealand_Map_Grid","nzmg"],zs={init:co,forward:uo,inverse:mo,names:po};function bo(){}function vo(t){var e=t.x,r=t.y,s=y(e-this.long0),i=this.x0+this.a*s,a=this.y0+this.a*Math.log(Math.tan(Math.PI/4+r/2.5))*1.25;return t.x=i,t.y=a,t}function _o(t){t.x-=this.x0,t.y-=this.y0;var e=y(this.long0+t.x/this.a),r=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=e,t.y=r,t}var yo=["Miller_Cylindrical","mill"],qs={init:bo,forward:vo,inverse:_o,names:yo};var go=20;function Mo(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=Fe(this.es)}function xo(t){var e,r,s=t.x,i=t.y;if(s=y(s-this.long0),this.sphere){if(!this.m)i=this.n!==1?Math.asin(this.n*Math.sin(i)):i;else for(var a=this.n*Math.sin(i),n=go;n;--n){var o=(this.m*i+Math.sin(i)-a)/(this.m+Math.cos(i));if(i-=o,Math.abs(o)<_)break}e=this.a*this.C_x*s*(this.m+Math.cos(i)),r=this.a*this.C_y*i}else{var h=Math.sin(i),f=Math.cos(i);r=this.a*Ot(i,h,f,this.en),e=this.a*s*f/Math.sqrt(1-this.es*h*h)}return t.x=e,t.y=r,t}function wo(t){var e,r,s,i;return t.x-=this.x0,s=t.x/this.a,t.y-=this.y0,e=t.y/this.a,this.sphere?(e/=this.C_y,s=s/(this.C_x*(this.m+Math.cos(e))),this.m?e=$((this.m*e+Math.sin(e))/this.n):this.n!==1&&(e=$(Math.sin(e)/this.n)),s=y(s+this.long0),e=nt(e)):(e=Oe(t.y/this.a,this.es,this.en),i=Math.abs(e),i<b?(i=Math.sin(e),r=this.long0+t.x*Math.sqrt(1-this.es*i*i)/(this.a*Math.cos(e)),s=y(r)):i-_<b&&(s=this.long0)),t.x=s,t.y=e,t}var Io=["Sinusoidal","sinu"],js={init:Mo,forward:xo,inverse:wo,names:Io};function Po(){}function Eo(t){for(var e=t.x,r=t.y,s=y(e-this.long0),i=r,a=Math.PI*Math.sin(r);;){var n=-(i+Math.sin(i)-a)/(1+Math.cos(i));if(i+=n,Math.abs(n)<_)break}i/=2,Math.PI/2-Math.abs(r)<_&&(s=0);var o=.900316316158*this.a*s*Math.cos(i)+this.x0,h=1.4142135623731*this.a*Math.sin(i)+this.y0;return t.x=o,t.y=h,t}function So(t){var e,r;t.x-=this.x0,t.y-=this.y0,r=t.y/(1.4142135623731*this.a),Math.abs(r)>.999999999999&&(r=.999999999999),e=Math.asin(r);var s=y(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));s<-Math.PI&&(s=-Math.PI),s>Math.PI&&(s=Math.PI),r=(2*e+Math.sin(2*e))/Math.PI,Math.abs(r)>1&&(r=1);var i=Math.asin(r);return t.x=s,t.y=i,t}var Ao=["Mollweide","moll"],Ds={init:Po,forward:Eo,inverse:So,names:Ao};function No(){Math.abs(this.lat1+this.lat2)<_||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=_t(this.es),this.e1=yt(this.es),this.e2=gt(this.es),this.e3=Mt(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=k(this.e,this.sinphi,this.cosphi),this.ml1=z(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<_?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=k(this.e,this.sinphi,this.cosphi),this.ml2=z(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=z(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function Fo(t){var e=t.x,r=t.y,s;if(this.sphere)s=this.a*(this.g-r);else{var i=z(this.e0,this.e1,this.e2,this.e3,r);s=this.a*(this.g-i)}var a=this.ns*y(e-this.long0),n=this.x0+s*Math.sin(a),o=this.y0+this.rh-s*Math.cos(a);return t.x=n,t.y=o,t}function Oo(t){t.x-=this.x0,t.y=this.rh-t.y+this.y0;var e,r,s,i;this.ns>=0?(r=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(r=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var a=0;if(r!==0&&(a=Math.atan2(e*t.x,e*t.y)),this.sphere)return i=y(this.long0+a/this.ns),s=nt(this.g-r/this.a),t.x=i,t.y=s,t;var n=this.g-r/this.a;return s=Rt(n,this.e0,this.e1,this.e2,this.e3),i=y(this.long0+a/this.ns),t.x=i,t.y=s,t}var Ro=["Equidistant_Conic","eqdc"],ks={init:No,forward:Fo,inverse:Oo,names:Ro};function Lo(){this.R=this.a}function Co(t){var e=t.x,r=t.y,s=y(e-this.long0),i,a;Math.abs(r)<=_&&(i=this.x0+this.R*s,a=this.y0);var n=$(2*Math.abs(r/Math.PI));(Math.abs(s)<=_||Math.abs(Math.abs(r)-b)<=_)&&(i=this.x0,r>=0?a=this.y0+Math.PI*this.R*Math.tan(.5*n):a=this.y0+Math.PI*this.R*-Math.tan(.5*n));var o=.5*Math.abs(Math.PI/s-s/Math.PI),h=o*o,f=Math.sin(n),c=Math.cos(n),l=c/(f+c-1),u=l*l,m=l*(2/f-1),d=m*m,p=Math.PI*this.R*(o*(l-d)+Math.sqrt(h*(l-d)*(l-d)-(d+h)*(u-d)))/(d+h);s<0&&(p=-p),i=this.x0+p;var v=h+l;return p=Math.PI*this.R*(m*v-o*Math.sqrt((d+h)*(h+1)-v*v))/(d+h),r>=0?a=this.y0+p:a=this.y0-p,t.x=i,t.y=a,t}function To(t){var e,r,s,i,a,n,o,h,f,c,l,u,m;return t.x-=this.x0,t.y-=this.y0,l=Math.PI*this.R,s=t.x/l,i=t.y/l,a=s*s+i*i,n=-Math.abs(i)*(1+a),o=n-2*i*i+s*s,h=-2*n+1+2*i*i+a*a,m=i*i/h+(2*o*o*o/h/h/h-9*n*o/h/h)/27,f=(n-o*o/3/h)/h,c=2*Math.sqrt(-f/3),l=3*m/f/c,Math.abs(l)>1&&(l>=0?l=1:l=-1),u=Math.acos(l)/3,t.y>=0?r=(-c*Math.cos(u+Math.PI/3)-o/3/h)*Math.PI:r=-(-c*Math.cos(u+Math.PI/3)-o/3/h)*Math.PI,Math.abs(s)<_?e=this.long0:e=y(this.long0+Math.PI*(a-1+Math.sqrt(1+2*(s*s-i*i)+a*a))/2/s),t.x=e,t.y=r,t}var Bo=["Van_der_Grinten_I","VanDerGrinten","vandg"],Vs={init:Lo,forward:Co,inverse:To,names:Bo};function Go(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)}function Uo(t){var e=t.x,r=t.y,s=Math.sin(t.y),i=Math.cos(t.y),a=y(e-this.long0),n,o,h,f,c,l,u,m,d,p,v,g,x,M,S,I,P,B,N,Y,q,rt,pt;return this.sphere?Math.abs(this.sin_p12-1)<=_?(t.x=this.x0+this.a*(b-r)*Math.sin(a),t.y=this.y0-this.a*(b-r)*Math.cos(a),t):Math.abs(this.sin_p12+1)<=_?(t.x=this.x0+this.a*(b+r)*Math.sin(a),t.y=this.y0+this.a*(b+r)*Math.cos(a),t):(B=this.sin_p12*s+this.cos_p12*i*Math.cos(a),I=Math.acos(B),P=I?I/Math.sin(I):1,t.x=this.x0+this.a*P*i*Math.sin(a),t.y=this.y0+this.a*P*(this.cos_p12*s-this.sin_p12*i*Math.cos(a)),t):(n=_t(this.es),o=yt(this.es),h=gt(this.es),f=Mt(this.es),Math.abs(this.sin_p12-1)<=_?(c=this.a*z(n,o,h,f,b),l=this.a*z(n,o,h,f,r),t.x=this.x0+(c-l)*Math.sin(a),t.y=this.y0-(c-l)*Math.cos(a),t):Math.abs(this.sin_p12+1)<=_?(c=this.a*z(n,o,h,f,b),l=this.a*z(n,o,h,f,r),t.x=this.x0+(c+l)*Math.sin(a),t.y=this.y0+(c+l)*Math.cos(a),t):(u=s/i,m=xt(this.a,this.e,this.sin_p12),d=xt(this.a,this.e,s),p=Math.atan((1-this.es)*u+this.es*m*this.sin_p12/(d*i)),v=Math.atan2(Math.sin(a),this.cos_p12*Math.tan(p)-this.sin_p12*Math.cos(a)),v===0?N=Math.asin(this.cos_p12*Math.sin(p)-this.sin_p12*Math.cos(p)):Math.abs(Math.abs(v)-Math.PI)<=_?N=-Math.asin(this.cos_p12*Math.sin(p)-this.sin_p12*Math.cos(p)):N=Math.asin(Math.sin(a)*Math.cos(p)/Math.sin(v)),g=this.e*this.sin_p12/Math.sqrt(1-this.es),x=this.e*this.cos_p12*Math.cos(v)/Math.sqrt(1-this.es),M=g*x,S=x*x,Y=N*N,q=Y*N,rt=q*N,pt=rt*N,I=m*N*(1-Y*S*(1-S)/6+q/8*M*(1-2*S)+rt/120*(S*(4-7*S)-3*g*g*(1-7*S))-pt/48*M),t.x=this.x0+I*Math.sin(v),t.y=this.y0+I*Math.cos(v),t))}function zo(t){t.x-=this.x0,t.y-=this.y0;var e,r,s,i,a,n,o,h,f,c,l,u,m,d,p,v,g,x,M,S,I,P,B,N;return this.sphere?(e=Math.sqrt(t.x*t.x+t.y*t.y),e>2*b*this.a?void 0:(r=e/this.a,s=Math.sin(r),i=Math.cos(r),a=this.long0,Math.abs(e)<=_?n=this.lat0:(n=$(i*this.sin_p12+t.y*s*this.cos_p12/e),o=Math.abs(this.lat0)-b,Math.abs(o)<=_?this.lat0>=0?a=y(this.long0+Math.atan2(t.x,-t.y)):a=y(this.long0-Math.atan2(-t.x,t.y)):a=y(this.long0+Math.atan2(t.x*s,e*this.cos_p12*i-t.y*this.sin_p12*s))),t.x=a,t.y=n,t)):(h=_t(this.es),f=yt(this.es),c=gt(this.es),l=Mt(this.es),Math.abs(this.sin_p12-1)<=_?(u=this.a*z(h,f,c,l,b),e=Math.sqrt(t.x*t.x+t.y*t.y),m=u-e,n=Rt(m/this.a,h,f,c,l),a=y(this.long0+Math.atan2(t.x,-1*t.y)),t.x=a,t.y=n,t):Math.abs(this.sin_p12+1)<=_?(u=this.a*z(h,f,c,l,b),e=Math.sqrt(t.x*t.x+t.y*t.y),m=e-u,n=Rt(m/this.a,h,f,c,l),a=y(this.long0+Math.atan2(t.x,t.y)),t.x=a,t.y=n,t):(e=Math.sqrt(t.x*t.x+t.y*t.y),v=Math.atan2(t.x,t.y),d=xt(this.a,this.e,this.sin_p12),g=Math.cos(v),x=this.e*this.cos_p12*g,M=-x*x/(1-this.es),S=3*this.es*(1-M)*this.sin_p12*this.cos_p12*g/(1-this.es),I=e/d,P=I-M*(1+M)*Math.pow(I,3)/6-S*(1+3*M)*Math.pow(I,4)/24,B=1-M*P*P/2-I*P*P*P/6,p=Math.asin(this.sin_p12*Math.cos(P)+this.cos_p12*Math.sin(P)*g),a=y(this.long0+Math.asin(Math.sin(v)*Math.sin(P)/Math.cos(p))),N=Math.sin(p),n=Math.atan2((N-this.es*B*this.sin_p12)*Math.tan(p),N*(1-this.es)),t.x=a,t.y=n,t))}var qo=["Azimuthal_Equidistant","aeqd"],Ws={init:Go,forward:Uo,inverse:zo,names:qo};function jo(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function Do(t){var e,r,s,i,a,n,o,h,f=t.x,c=t.y;return s=y(f-this.long0),e=Math.sin(c),r=Math.cos(c),i=Math.cos(s),n=this.sin_p14*e+this.cos_p14*r*i,a=1,(n>0||Math.abs(n)<=_)&&(o=this.a*a*r*Math.sin(s),h=this.y0+this.a*a*(this.cos_p14*e-this.sin_p14*r*i)),t.x=o,t.y=h,t}function ko(t){var e,r,s,i,a,n,o;return t.x-=this.x0,t.y-=this.y0,e=Math.sqrt(t.x*t.x+t.y*t.y),r=$(e/this.a),s=Math.sin(r),i=Math.cos(r),n=this.long0,Math.abs(e)<=_?(o=this.lat0,t.x=n,t.y=o,t):(o=$(i*this.sin_p14+t.y*s*this.cos_p14/e),a=Math.abs(this.lat0)-b,Math.abs(a)<=_?(this.lat0>=0?n=y(this.long0+Math.atan2(t.x,-t.y)):n=y(this.long0-Math.atan2(-t.x,t.y)),t.x=n,t.y=o,t):(n=y(this.long0+Math.atan2(t.x*s,e*this.cos_p14*i-t.y*this.sin_p14*s)),t.x=n,t.y=o,t))}var Vo=["ortho"],Hs={init:jo,forward:Do,inverse:ko,names:Vo};var R={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},A={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function Wo(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=b-E/2?this.face=R.TOP:this.lat0<=-(b-E/2)?this.face=R.BOTTOM:Math.abs(this.long0)<=E?this.face=R.FRONT:Math.abs(this.long0)<=b+E?this.face=this.long0>0?R.RIGHT:R.LEFT:this.face=R.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function Ho(t){var e={x:0,y:0},r,s,i,a,n,o,h={value:0};if(t.x-=this.long0,this.es!==0?r=Math.atan(this.one_minus_f_squared*Math.tan(t.y)):r=t.y,s=t.x,this.face===R.TOP)a=b-r,s>=E&&s<=b+E?(h.value=A.AREA_0,i=s-b):s>b+E||s<=-(b+E)?(h.value=A.AREA_1,i=s>0?s-O:s+O):s>-(b+E)&&s<=-E?(h.value=A.AREA_2,i=s+b):(h.value=A.AREA_3,i=s);else if(this.face===R.BOTTOM)a=b+r,s>=E&&s<=b+E?(h.value=A.AREA_0,i=-s+b):s<E&&s>=-E?(h.value=A.AREA_1,i=-s):s<-E&&s>=-(b+E)?(h.value=A.AREA_2,i=-s-b):(h.value=A.AREA_3,i=s>0?-s+O:-s-O);else{var f,c,l,u,m,d,p;this.face===R.RIGHT?s=Wt(s,+b):this.face===R.BACK?s=Wt(s,+O):this.face===R.LEFT&&(s=Wt(s,-b)),u=Math.sin(r),m=Math.cos(r),d=Math.sin(s),p=Math.cos(s),f=m*p,c=m*d,l=u,this.face===R.FRONT?(a=Math.acos(f),i=Be(a,l,c,h)):this.face===R.RIGHT?(a=Math.acos(c),i=Be(a,l,-f,h)):this.face===R.BACK?(a=Math.acos(-f),i=Be(a,l,-c,h)):this.face===R.LEFT?(a=Math.acos(-c),i=Be(a,l,f,h)):(a=i=0,h.value=A.AREA_0)}return o=Math.atan(12/O*(i+Math.acos(Math.sin(i)*Math.cos(E))-b)),n=Math.sqrt((1-Math.cos(a))/(Math.cos(o)*Math.cos(o))/(1-Math.cos(Math.atan(1/Math.cos(i))))),h.value===A.AREA_1?o+=b:h.value===A.AREA_2?o+=O:h.value===A.AREA_3&&(o+=1.5*O),e.x=n*Math.cos(o),e.y=n*Math.sin(o),e.x=e.x*this.a+this.x0,e.y=e.y*this.a+this.y0,t.x=e.x,t.y=e.y,t}function Xo(t){var e={lam:0,phi:0},r,s,i,a,n,o,h,f,c,l={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,s=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),r=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?l.value=A.AREA_0:t.y>=0&&t.y>=Math.abs(t.x)?(l.value=A.AREA_1,r-=b):t.x<0&&-t.x>=Math.abs(t.y)?(l.value=A.AREA_2,r=r<0?r+O:r-O):(l.value=A.AREA_3,r+=b),c=O/12*Math.tan(r),n=Math.sin(c)/(Math.cos(c)-1/Math.sqrt(2)),o=Math.atan(n),i=Math.cos(r),a=Math.tan(s),h=1-i*i*a*a*(1-Math.cos(Math.atan(1/Math.cos(o)))),h<-1?h=-1:h>1&&(h=1),this.face===R.TOP)f=Math.acos(h),e.phi=b-f,l.value===A.AREA_0?e.lam=o+b:l.value===A.AREA_1?e.lam=o<0?o+O:o-O:l.value===A.AREA_2?e.lam=o-b:e.lam=o;else if(this.face===R.BOTTOM)f=Math.acos(h),e.phi=f-b,l.value===A.AREA_0?e.lam=-o+b:l.value===A.AREA_1?e.lam=-o:l.value===A.AREA_2?e.lam=-o-b:e.lam=o<0?-o-O:-o+O;else{var u,m,d;u=h,c=u*u,c>=1?d=0:d=Math.sqrt(1-c)*Math.sin(o),c+=d*d,c>=1?m=0:m=Math.sqrt(1-c),l.value===A.AREA_1?(c=m,m=-d,d=c):l.value===A.AREA_2?(m=-m,d=-d):l.value===A.AREA_3&&(c=m,m=d,d=-c),this.face===R.RIGHT?(c=u,u=-m,m=c):this.face===R.BACK?(u=-u,m=-m):this.face===R.LEFT&&(c=u,u=m,m=-c),e.phi=Math.acos(-d)-b,e.lam=Math.atan2(m,u),this.face===R.RIGHT?e.lam=Wt(e.lam,-b):this.face===R.BACK?e.lam=Wt(e.lam,-O):this.face===R.LEFT&&(e.lam=Wt(e.lam,+b))}if(this.es!==0){var p,v,g;p=e.phi<0?1:0,v=Math.tan(e.phi),g=this.b/Math.sqrt(v*v+this.one_minus_f_squared),e.phi=Math.atan(Math.sqrt(this.a*this.a-g*g)/(this.one_minus_f*g)),p&&(e.phi=-e.phi)}return e.lam+=this.long0,t.x=e.lam,t.y=e.phi,t}function Be(t,e,r,s){var i;return t<_?(s.value=A.AREA_0,i=0):(i=Math.atan2(e,r),Math.abs(i)<=E?s.value=A.AREA_0:i>E&&i<=b+E?(s.value=A.AREA_1,i-=b):i>b+E||i<=-(b+E)?(s.value=A.AREA_2,i=i>=0?i-O:i+O):(s.value=A.AREA_3,i+=b)),i}function Wt(t,e){var r=t+e;return r<-O?r+=ne:r>+O&&(r-=ne),r}var Jo=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"],Xs={init:Wo,forward:Ho,inverse:Xo,names:Jo};var cr=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],ue=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],Js=.8487,Zs=1.3523,$s=at/5,Zo=1/$s,Ht=18,Ge=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))},$o=function(t,e){return t[1]+e*(2*t[2]+e*3*t[3])};function Ko(t,e,r,s){for(var i=e;s;--s){var a=t(i);if(i-=a,Math.abs(a)<r)break}return i}function Qo(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function Yo(t){var e=y(t.x-this.long0),r=Math.abs(t.y),s=Math.floor(r*$s);s<0?s=0:s>=Ht&&(s=Ht-1),r=at*(r-Zo*s);var i={x:Ge(cr[s],r)*e,y:Ge(ue[s],r)};return t.y<0&&(i.y=-i.y),i.x=i.x*this.a*Js+this.x0,i.y=i.y*this.a*Zs+this.y0,i}function th(t){var e={x:(t.x-this.x0)/(this.a*Js),y:Math.abs(t.y-this.y0)/(this.a*Zs)};if(e.y>=1)e.x/=cr[Ht][0],e.y=t.y<0?-b:b;else{var r=Math.floor(e.y*Ht);for(r<0?r=0:r>=Ht&&(r=Ht-1);;)if(ue[r][0]>e.y)--r;else if(ue[r+1][0]<=e.y)++r;else break;var s=ue[r],i=5*(e.y-s[0])/(ue[r+1][0]-s[0]);i=Ko(function(a){return(Ge(s,a)-e.y)/$o(s,a)},i,_,100),e.x/=Ge(cr[r],i),e.y=(5*r+i)*G,t.y<0&&(e.y=-e.y)}return e.x=y(e.x+this.long0),e}var eh=["Robinson","robin"],Ks={init:Qo,forward:Yo,inverse:th,names:eh};function rh(){this.name="geocent"}function sh(t){var e=Ee(t,this.es,this.a);return e}function ih(t){var e=Se(t,this.es,this.a,this.b);return e}var ah=["Geocentric","geocentric","geocent","Geocent"],Qs={init:rh,forward:sh,inverse:ih,names:ah};function Ys(t){t.Proj.projections.add(vs),t.Proj.projections.add(Vt),t.Proj.projections.add(ws),t.Proj.projections.add(Is),t.Proj.projections.add(Ps),t.Proj.projections.add(Es),t.Proj.projections.add(Ss),t.Proj.projections.add(As),t.Proj.projections.add(Ns),t.Proj.projections.add(Fs),t.Proj.projections.add(Os),t.Proj.projections.add(Rs),t.Proj.projections.add(Ls),t.Proj.projections.add(Ts),t.Proj.projections.add(Bs),t.Proj.projections.add(Us),t.Proj.projections.add(zs),t.Proj.projections.add(qs),t.Proj.projections.add(js),t.Proj.projections.add(Ds),t.Proj.projections.add(ks),t.Proj.projections.add(Vs),t.Proj.projections.add(Ws),t.Proj.projections.add(Hs),t.Proj.projections.add(Xs),t.Proj.projections.add(Ks),t.Proj.projections.add(Qs)}Q.defaultDatum="WGS84";Q.Proj=wt;Q.WGS84=new Q.Proj("WGS84");Q.Point=ds;Q.toPoint=Ne;Q.defs=qt;Q.transform=Ft;Q.mgrs=ls;Q.version="__VERSION__";Ys(Q);var ur=Q;var Xt=class{static defineProjectionAliases(e){let r=[];for(let s in e)r.push([s,e[s]]);ur.defs(r)}constructor({from:e="WGS84",to:r="WGS84"}){if(this._projection=ur(e,r),!this._projection)throw new Error("Invalid projection");this.project=this.project.bind(this),this.unproject=this.unproject.bind(this)}project(e){return this._projection.forward(e)}unproject(e){return this._projection.inverse(e)}};function Ue(t,e){for(let r of t)r.geometry.coordinates=ti(r.geometry.coordinates,e);return t}function ti(t,e){return nh(t)?e(t):t.map(r=>ti(r,e))}function nh(t){return Array.isArray(t)&&Number.isFinite(t[0])&&Number.isFinite(t[1])}var dt=new Int32Array(2),ze=new Float32Array(dt.buffer),qe=new Float64Array(dt.buffer),Jt=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var de;(function(t){t[t.UTF8_BYTES=1]="UTF8_BYTES",t[t.UTF16_STRING=2]="UTF16_STRING"})(de||(de={}));var H=class{constructor(e){this.bytes_=e,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(e){return new H(new Uint8Array(e))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(e){this.position_=e}capacity(){return this.bytes_.length}readInt8(e){return this.readUint8(e)<<24>>24}readUint8(e){return this.bytes_[e]}readInt16(e){return this.readUint16(e)<<16>>16}readUint16(e){return this.bytes_[e]|this.bytes_[e+1]<<8}readInt32(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24}readUint32(e){return this.readInt32(e)>>>0}readInt64(e){return BigInt.asIntN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readUint64(e){return BigInt.asUintN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readFloat32(e){return dt[0]=this.readInt32(e),ze[0]}readFloat64(e){return dt[Jt?0:1]=this.readInt32(e),dt[Jt?1:0]=this.readInt32(e+4),qe[0]}writeInt8(e,r){this.bytes_[e]=r}writeUint8(e,r){this.bytes_[e]=r}writeInt16(e,r){this.bytes_[e]=r,this.bytes_[e+1]=r>>8}writeUint16(e,r){this.bytes_[e]=r,this.bytes_[e+1]=r>>8}writeInt32(e,r){this.bytes_[e]=r,this.bytes_[e+1]=r>>8,this.bytes_[e+2]=r>>16,this.bytes_[e+3]=r>>24}writeUint32(e,r){this.bytes_[e]=r,this.bytes_[e+1]=r>>8,this.bytes_[e+2]=r>>16,this.bytes_[e+3]=r>>24}writeInt64(e,r){this.writeInt32(e,Number(BigInt.asIntN(32,r))),this.writeInt32(e+4,Number(BigInt.asIntN(32,r>>BigInt(32))))}writeUint64(e,r){this.writeUint32(e,Number(BigInt.asUintN(32,r))),this.writeUint32(e+4,Number(BigInt.asUintN(32,r>>BigInt(32))))}writeFloat32(e,r){ze[0]=r,this.writeInt32(e,dt[0])}writeFloat64(e,r){qe[0]=r,this.writeInt32(e,dt[Jt?0:1]),this.writeInt32(e+4,dt[Jt?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+4+4)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let e="";for(let r=0;r<4;r++)e+=String.fromCharCode(this.readInt8(this.position_+4+r));return e}__offset(e,r){let s=e-this.readInt32(e);return r<this.readInt16(s)?this.readInt16(s+r):0}__union(e,r){return e.bb_pos=r+this.readInt32(r),e.bb=this,e}__string(e,r){e+=this.readInt32(e);let s=this.readInt32(e);e+=4;let i=this.bytes_.subarray(e,e+s);return r===de.UTF8_BYTES?i:this.text_decoder_.decode(i)}__union_with_string(e,r){return typeof e=="string"?this.__string(r):this.__union(e,r)}__indirect(e){return e+this.readInt32(e)}__vector(e){return e+this.readInt32(e)+4}__vector_len(e){return this.readInt32(e+this.readInt32(e))}__has_identifier(e){if(e.length!=4)throw new Error("FlatBuffers: file identifier must be length "+4);for(let r=0;r<4;r++)if(e.charCodeAt(r)!=this.readInt8(this.position()+4+r))return!1;return!0}createScalarList(e,r){let s=[];for(let i=0;i<r;++i){let a=e(i);a!==null&&s.push(a)}return s}createObjList(e,r){let s=[];for(let i=0;i<r;++i){let a=e(i);a!==null&&s.push(a.unpack())}return s}};function dr(t,e){if(t===null)return null;switch(e){case GeometryType.Point:case GeometryType.MultiPoint:return hh(t);case GeometryType.LineString:case GeometryType.MultiLineString:return fh(t);case GeometryType.Polygon:return ri(t);case GeometryType.MultiPolygon:return lh(t);default:throw new Error(`Unimplemented geometry type: ${e}`)}}function hh(t){let e=t.xyArray(),r=t.zArray();return{positions:mr(e,r)}}function fh(t){let e=t.xyArray(),r=t.zArray(),s=mr(e,r),i=t.endsArray()&&Array.from(t.endsArray())||[e.length/2];i.unshift(0);let a={value:new Uint16Array(i),size:1};return{positions:s,pathIndices:a}}function ri(t){let e=t.xyArray(),r=t.zArray(),s=mr(e,r),i=t.endsArray()&&Array.from(t.endsArray())||[e.length/2];i.unshift(0);let a={value:new Uint16Array(i),size:1},n={value:new Uint16Array([0,e.length/2]),size:1};return{positions:s,primitivePolygonIndices:a,polygonIndices:n}}function lh(t){let e=[],r=0,s=1,i=1;for(let u=0;u<t.partsLength();u++){let m=t.parts(u),d=ri(m);r+=d.positions.value.length,s+=d.primitivePolygonIndices.value.length-1,i+=d.polygonIndices.value.length-1,e.push(d)}let a=new Float64Array(r),n=new Uint32Array(s),o=new Uint32Array(i),h=0,f=1,c=1,l=e[0].positions.size;for(let u of e)a.set(u.positions.value,h*l),n.set(u.primitivePolygonIndices.value.subarray(1).map(m=>m+h),f),o.set(u.polygonIndices.value.subarray(1).map(m=>m+h),c),h+=u.positions.value.length/l,f+=u.primitivePolygonIndices.value.length-1,c+=u.polygonIndices.value.length-1;return{positions:{value:a,size:l},primitivePolygonIndices:{value:n,size:1},polygonIndices:{value:o,size:1}}}function mr(t,e){if(!e)return{value:t,size:2};if(e.length*2!==t.length)throw new Error("Z array must be half XY array's length");let r=t.length+e.length,s=new Float64Array(r);for(let i=0;i<t.length/2;i++)s[i*3+0]=t[i*2+0],s[i*3+1]=t[i*2+1],s[i*3+2]=e[i];return{value:s,size:3}}function si(t){let e={title:t.title||"",description:t.description||"",crs:JSON.stringify(t.crs)||"",metadata:t.metadata||"",geometryType:String(t.geometryType),indexNodeSize:String(t.indexNodeSize),featureCount:String(t.featuresCount),bounds:t.envelope?.join(",")||""},r=t.columns?.map(s=>ch(s))||[];return{metadata:e,fields:r}}function ch(t){let e={title:t.title||"",description:t.description||"",width:String(t.width),precision:String(t.precision),scale:String(t.scale),unique:String(t.unique),primary_key:String(t.primary_key)};return{name:t.name,type:uh(t.type),nullable:t.nullable,metadata:e}}var D;(function(t){t[t.Byte=0]="Byte",t[t.UByte=1]="UByte",t[t.Bool=2]="Bool",t[t.Short=3]="Short",t[t.UShort=4]="UShort",t[t.Int=5]="Int",t[t.UInt=6]="UInt",t[t.Long=7]="Long",t[t.ULong=8]="ULong",t[t.Float=9]="Float",t[t.Double=10]="Double",t[t.String=11]="String",t[t.Json=12]="Json",t[t.DateTime=13]="DateTime",t[t.Binary=14]="Binary"})(D||(D={}));function uh(t){switch(t){case D.Byte:return"int8";case D.UByte:return"uint8";case D.Bool:return"bool";case D.Short:return"int16";case D.UShort:return"uint16";case D.Int:return"int32";case D.UInt:return"uint32";case D.Long:return"int64";case D.ULong:return"uint64";case D.Float:return"float32";case D.Double:return"float64";case D.String:return"utf8";case D.Json:return"null";case D.DateTime:return"date-millisecond";case D.Binary:return"binary";default:return"null"}}var C;(function(t){t[t.Unknown=0]="Unknown",t[t.Point=1]="Point",t[t.LineString=2]="LineString",t[t.Polygon=3]="Polygon",t[t.MultiPoint=4]="MultiPoint",t[t.MultiLineString=5]="MultiLineString",t[t.MultiPolygon=6]="MultiPolygon",t[t.GeometryCollection=7]="GeometryCollection",t[t.CircularString=8]="CircularString",t[t.CompoundCurve=9]="CompoundCurve",t[t.CurvePolygon=10]="CurvePolygon",t[t.MultiCurve=11]="MultiCurve",t[t.MultiSurface=12]="MultiSurface",t[t.Curve=13]="Curve",t[t.Surface=14]="Surface",t[t.PolyhedralSurface=15]="PolyhedralSurface",t[t.TIN=16]="TIN",t[t.Triangle=17]="Triangle"})(C||(C={}));var j=class{bb=null;bb_pos=0;__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsGeometry(e,r){return(r||new j).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsGeometry(e,r){return e.setPosition(e.position()+4),(r||new j).__init(e.readInt32(e.position())+e.position(),e)}ends(e){let r=this.bb.__offset(this.bb_pos,4);return r?this.bb.readUint32(this.bb.__vector(this.bb_pos+r)+e*4):0}endsLength(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__vector_len(this.bb_pos+e):0}endsArray(){let e=this.bb.__offset(this.bb_pos,4);return e?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}xy(e){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.readFloat64(this.bb.__vector(this.bb_pos+r)+e*8):0}xyLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}xyArray(){let e=this.bb.__offset(this.bb_pos,6);return e?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}z(e){let r=this.bb.__offset(this.bb_pos,8);return r?this.bb.readFloat64(this.bb.__vector(this.bb_pos+r)+e*8):0}zLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}zArray(){let e=this.bb.__offset(this.bb_pos,8);return e?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}m(e){let r=this.bb.__offset(this.bb_pos,10);return r?this.bb.readFloat64(this.bb.__vector(this.bb_pos+r)+e*8):0}mLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}mArray(){let e=this.bb.__offset(this.bb_pos,10);return e?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}t(e){let r=this.bb.__offset(this.bb_pos,12);return r?this.bb.readFloat64(this.bb.__vector(this.bb_pos+r)+e*8):0}tLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}tArray(){let e=this.bb.__offset(this.bb_pos,12);return e?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}tm(e){let r=this.bb.__offset(this.bb_pos,14);return r?this.bb.readUint64(this.bb.__vector(this.bb_pos+r)+e*8):BigInt(0)}tmLength(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}type(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.readUint8(this.bb_pos+e):C.Unknown}parts(e,r){let s=this.bb.__offset(this.bb_pos,18);return s?(r||new j).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+s)+e*4),this.bb):null}partsLength(){let e=this.bb.__offset(this.bb_pos,18);return e?this.bb.__vector_len(this.bb_pos+e):0}static startGeometry(e){e.startObject(8)}static addEnds(e,r){e.addFieldOffset(0,r,0)}static createEndsVector(e,r){e.startVector(4,r.length,4);for(let s=r.length-1;s>=0;s--)e.addInt32(r[s]);return e.endVector()}static startEndsVector(e,r){e.startVector(4,r,4)}static addXy(e,r){e.addFieldOffset(1,r,0)}static createXyVector(e,r){e.startVector(8,r.length,8);for(let s=r.length-1;s>=0;s--)e.addFloat64(r[s]);return e.endVector()}static startXyVector(e,r){e.startVector(8,r,8)}static addZ(e,r){e.addFieldOffset(2,r,0)}static createZVector(e,r){e.startVector(8,r.length,8);for(let s=r.length-1;s>=0;s--)e.addFloat64(r[s]);return e.endVector()}static startZVector(e,r){e.startVector(8,r,8)}static addM(e,r){e.addFieldOffset(3,r,0)}static createMVector(e,r){e.startVector(8,r.length,8);for(let s=r.length-1;s>=0;s--)e.addFloat64(r[s]);return e.endVector()}static startMVector(e,r){e.startVector(8,r,8)}static addT(e,r){e.addFieldOffset(4,r,0)}static createTVector(e,r){e.startVector(8,r.length,8);for(let s=r.length-1;s>=0;s--)e.addFloat64(r[s]);return e.endVector()}static startTVector(e,r){e.startVector(8,r,8)}static addTm(e,r){e.addFieldOffset(5,r,0)}static createTmVector(e,r){e.startVector(8,r.length,8);for(let s=r.length-1;s>=0;s--)e.addInt64(r[s]);return e.endVector()}static startTmVector(e,r){e.startVector(8,r,8)}static addType(e,r){e.addFieldInt8(6,r,C.Unknown)}static addParts(e,r){e.addFieldOffset(7,r,0)}static createPartsVector(e,r){e.startVector(4,r.length,4);for(let s=r.length-1;s>=0;s--)e.addOffset(r[s]);return e.endVector()}static startPartsVector(e,r){e.startVector(4,r,4)}static endGeometry(e){return e.endObject()}static createGeometry(e,r,s,i,a,n,o,h,f){return j.startGeometry(e),j.addEnds(e,r),j.addXy(e,s),j.addZ(e,i),j.addM(e,a),j.addT(e,n),j.addTm(e,o),j.addType(e,h),j.addParts(e,f),j.endGeometry(e)}};function je(t,e){let r=[];for(let s=0;s<t.length;s+=2){let i=[t[s],t[s+1]];e&&i.push(e[s>>1]),r.push(i)}return r}function ii(t,e,r){if(!r||r.length===0)return[je(t,e)];let s=0,i=Array.from(r).map(n=>t.slice(s,s=n<<1)),a;return e&&(s=0,a=Array.from(r).map(n=>e.slice(s,s=n))),i.map((n,o)=>je(n,a?a[o]:void 0))}function dh(t,e){let r=t.xyArray(),s=t.zArray();switch(e){case C.Point:{let i=Array.from(r);return s&&i.push(s[0]),i}case C.MultiPoint:case C.LineString:return je(r,s);case C.MultiLineString:return ii(r,s,t.endsArray());case C.Polygon:return ii(r,s,t.endsArray())}}function De(t,e){let r=e;if(r===C.Unknown&&(r=t.type()),r===C.GeometryCollection){let i=[];for(let a=0;a<t.partsLength();a++){let n=t.parts(a),o=n.type();i.push(De(n,o))}return{type:C[r],geometries:i}}else if(r===C.MultiPolygon){let i=[];for(let a=0;a<t.partsLength();a++)i.push(De(t.parts(a),C.Polygon));return{type:C[r],coordinates:i.map(a=>a.coordinates)}}let s=dh(t,r);return{type:C[r],coordinates:s}}var T;(function(t){t[t.Byte=0]="Byte",t[t.UByte=1]="UByte",t[t.Bool=2]="Bool",t[t.Short=3]="Short",t[t.UShort=4]="UShort",t[t.Int=5]="Int",t[t.UInt=6]="UInt",t[t.Long=7]="Long",t[t.ULong=8]="ULong",t[t.Float=9]="Float",t[t.Double=10]="Double",t[t.String=11]="String",t[t.Json=12]="Json",t[t.DateTime=13]="DateTime",t[t.Binary=14]="Binary"})(T||(T={}));var L=class{bb=null;bb_pos=0;__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsColumn(e,r){return(r||new L).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsColumn(e,r){return e.setPosition(e.position()+4),(r||new L).__init(e.readInt32(e.position())+e.position(),e)}name(e){let r=this.bb.__offset(this.bb_pos,4);return r?this.bb.__string(this.bb_pos+r,e):null}type(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):T.Byte}title(e){let r=this.bb.__offset(this.bb_pos,8);return r?this.bb.__string(this.bb_pos+r,e):null}description(e){let r=this.bb.__offset(this.bb_pos,10);return r?this.bb.__string(this.bb_pos+r,e):null}width(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readInt32(this.bb_pos+e):-1}precision(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.readInt32(this.bb_pos+e):-1}scale(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.readInt32(this.bb_pos+e):-1}nullable(){let e=this.bb.__offset(this.bb_pos,18);return e?Boolean(this.bb.readInt8(this.bb_pos+e)):!0}unique(){let e=this.bb.__offset(this.bb_pos,20);return e?Boolean(this.bb.readInt8(this.bb_pos+e)):!1}primaryKey(){let e=this.bb.__offset(this.bb_pos,22);return e?Boolean(this.bb.readInt8(this.bb_pos+e)):!1}metadata(e){let r=this.bb.__offset(this.bb_pos,24);return r?this.bb.__string(this.bb_pos+r,e):null}static startColumn(e){e.startObject(11)}static addName(e,r){e.addFieldOffset(0,r,0)}static addType(e,r){e.addFieldInt8(1,r,T.Byte)}static addTitle(e,r){e.addFieldOffset(2,r,0)}static addDescription(e,r){e.addFieldOffset(3,r,0)}static addWidth(e,r){e.addFieldInt32(4,r,-1)}static addPrecision(e,r){e.addFieldInt32(5,r,-1)}static addScale(e,r){e.addFieldInt32(6,r,-1)}static addNullable(e,r){e.addFieldInt8(7,Number(r),Number(!0))}static addUnique(e,r){e.addFieldInt8(8,Number(r),Number(!1))}static addPrimaryKey(e,r){e.addFieldInt8(9,Number(r),Number(!1))}static addMetadata(e,r){e.addFieldOffset(10,r,0)}static endColumn(e){let r=e.endObject();return e.requiredField(r,4),r}static createColumn(e,r,s,i,a,n,o,h,f,c,l,u){return L.startColumn(e),L.addName(e,r),L.addType(e,s),L.addTitle(e,i),L.addDescription(e,a),L.addWidth(e,n),L.addPrecision(e,o),L.addScale(e,h),L.addNullable(e,f),L.addUnique(e,c),L.addPrimaryKey(e,l),L.addMetadata(e,u),L.endColumn(e)}};var X=class{bb=null;bb_pos=0;__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsFeature(e,r){return(r||new X).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFeature(e,r){return e.setPosition(e.position()+4),(r||new X).__init(e.readInt32(e.position())+e.position(),e)}geometry(e){let r=this.bb.__offset(this.bb_pos,4);return r?(e||new j).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}properties(e){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.readUint8(this.bb.__vector(this.bb_pos+r)+e):0}propertiesLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}propertiesArray(){let e=this.bb.__offset(this.bb_pos,6);return e?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}columns(e,r){let s=this.bb.__offset(this.bb_pos,8);return s?(r||new L).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+s)+e*4),this.bb):null}columnsLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}static startFeature(e){e.startObject(3)}static addGeometry(e,r){e.addFieldOffset(0,r,0)}static addProperties(e,r){e.addFieldOffset(1,r,0)}static createPropertiesVector(e,r){e.startVector(1,r.length,1);for(let s=r.length-1;s>=0;s--)e.addInt8(r[s]);return e.endVector()}static startPropertiesVector(e,r){e.startVector(1,r,1)}static addColumns(e,r){e.addFieldOffset(2,r,0)}static createColumnsVector(e,r){e.startVector(4,r.length,4);for(let s=r.length-1;s>=0;s--)e.addOffset(r[s]);return e.endVector()}static startColumnsVector(e,r){e.startVector(4,r,4)}static endFeature(e){return e.endObject()}static finishFeatureBuffer(e,r){e.finish(r)}static finishSizePrefixedFeatureBuffer(e,r){e.finish(r,void 0,!0)}static createFeature(e,r,s,i){return X.startFeature(e),X.addGeometry(e,r),X.addProperties(e,s),X.addColumns(e,i),X.endFeature(e)}};var em=new TextEncoder,ai=new TextDecoder;function ke(t,e){let r={};if(!e||e.length===0)return r;let s=t.propertiesArray();if(!s)return r;let i=new DataView(s.buffer,s.byteOffset),a=t.propertiesLength(),n=0;for(;n<a;){let o=i.getUint16(n,!0);n+=2;let h=e[o],f=h.name;switch(h.type){case T.Bool:{r[f]=Boolean(i.getUint8(n)),n+=1;break}case T.Byte:{r[f]=i.getInt8(n),n+=1;break}case T.UByte:{r[f]=i.getUint8(n),n+=1;break}case T.Short:{r[f]=i.getInt16(n,!0),n+=2;break}case T.UShort:{r[f]=i.getUint16(n,!0),n+=2;break}case T.Int:{r[f]=i.getInt32(n,!0),n+=4;break}case T.UInt:{r[f]=i.getUint32(n,!0),n+=4;break}case T.Long:{r[f]=Number(i.getBigInt64(n,!0)),n+=8;break}case T.ULong:{r[f]=Number(i.getBigUint64(n,!0)),n+=8;break}case T.Float:{r[f]=i.getFloat32(n,!0),n+=4;break}case T.Double:{r[f]=i.getFloat64(n,!0),n+=8;break}case T.DateTime:case T.String:{let c=i.getUint32(n,!0);n+=4,r[f]=ai.decode(s.subarray(n,n+c)),n+=c;break}case T.Json:{let c=i.getUint32(n,!0);n+=4;let l=ai.decode(s.subarray(n,n+c));r[f]=JSON.parse(l),n+=c;break}default:throw new Error(`Unknown type ${h.type}`)}}return r}function Ve(t,e){let r=e.columns;return{type:"Feature",geometry:De(t.geometry(),e.geometryType),properties:ke(t,r)}}var Zt=new Uint8Array(0);function ni(){return this._source.cancel()}function pr(t,e){if(!t.length)return e;if(!e.length)return t;var r=new Uint8Array(t.length+e.length);return r.set(t),r.set(e,t.length),r}function oi(){var t=this,e=t._array.subarray(t._index);return t._source.read().then(function(r){return t._array=Zt,t._index=0,r.done?e.length>0?{done:!1,value:e}:{done:!0,value:void 0}:{done:!1,value:pr(e,r.value)}})}function hi(t){if((t|=0)<0)throw new Error("invalid length");var e=this,r=this._array.length-this._index;if(this._index+t<=this._array.length)return Promise.resolve(this._array.subarray(this._index,this._index+=t));var s=new Uint8Array(t);return s.set(this._array.subarray(this._index)),function i(){return e._source.read().then(function(a){return a.done?(e._array=Zt,e._index=0,r>0?s.subarray(0,r):null):r+a.value.length>=t?(e._array=a.value,e._index=t-r,s.set(a.value.subarray(0,t-r),r),s):(s.set(a.value,r),r+=a.value.length,i())})}()}function br(t){return typeof t.slice=="function"?t:new We(typeof t.read=="function"?t:t.getReader())}function We(t){this._source=t,this._array=Zt,this._index=0}We.prototype.read=oi;We.prototype.slice=hi;We.prototype.cancel=ni;var J=class{bb=null;bb_pos=0;__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsCrs(e,r){return(r||new J).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsCrs(e,r){return e.setPosition(e.position()+4),(r||new J).__init(e.readInt32(e.position())+e.position(),e)}org(e){let r=this.bb.__offset(this.bb_pos,4);return r?this.bb.__string(this.bb_pos+r,e):null}code(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):0}name(e){let r=this.bb.__offset(this.bb_pos,8);return r?this.bb.__string(this.bb_pos+r,e):null}description(e){let r=this.bb.__offset(this.bb_pos,10);return r?this.bb.__string(this.bb_pos+r,e):null}wkt(e){let r=this.bb.__offset(this.bb_pos,12);return r?this.bb.__string(this.bb_pos+r,e):null}codeString(e){let r=this.bb.__offset(this.bb_pos,14);return r?this.bb.__string(this.bb_pos+r,e):null}static startCrs(e){e.startObject(6)}static addOrg(e,r){e.addFieldOffset(0,r,0)}static addCode(e,r){e.addFieldInt32(1,r,0)}static addName(e,r){e.addFieldOffset(2,r,0)}static addDescription(e,r){e.addFieldOffset(3,r,0)}static addWkt(e,r){e.addFieldOffset(4,r,0)}static addCodeString(e,r){e.addFieldOffset(5,r,0)}static endCrs(e){return e.endObject()}static createCrs(e,r,s,i,a,n,o){return J.startCrs(e),J.addOrg(e,r),J.addCode(e,s),J.addName(e,i),J.addDescription(e,a),J.addWkt(e,n),J.addCodeString(e,o),J.endCrs(e)}};var Tt=class{bb=null;bb_pos=0;__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsHeader(e,r){return(r||new Tt).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsHeader(e,r){return e.setPosition(e.position()+4),(r||new Tt).__init(e.readInt32(e.position())+e.position(),e)}name(e){let r=this.bb.__offset(this.bb_pos,4);return r?this.bb.__string(this.bb_pos+r,e):null}envelope(e){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.readFloat64(this.bb.__vector(this.bb_pos+r)+e*8):0}envelopeLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}envelopeArray(){let e=this.bb.__offset(this.bb_pos,6);return e?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}geometryType(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readUint8(this.bb_pos+e):C.Unknown}hasZ(){let e=this.bb.__offset(this.bb_pos,10);return e?Boolean(this.bb.readInt8(this.bb_pos+e)):!1}hasM(){let e=this.bb.__offset(this.bb_pos,12);return e?Boolean(this.bb.readInt8(this.bb_pos+e)):!1}hasT(){let e=this.bb.__offset(this.bb_pos,14);return e?Boolean(this.bb.readInt8(this.bb_pos+e)):!1}hasTm(){let e=this.bb.__offset(this.bb_pos,16);return e?Boolean(this.bb.readInt8(this.bb_pos+e)):!1}columns(e,r){let s=this.bb.__offset(this.bb_pos,18);return s?(r||new L).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+s)+e*4),this.bb):null}columnsLength(){let e=this.bb.__offset(this.bb_pos,18);return e?this.bb.__vector_len(this.bb_pos+e):0}featuresCount(){let e=this.bb.__offset(this.bb_pos,20);return e?this.bb.readUint64(this.bb_pos+e):BigInt("0")}indexNodeSize(){let e=this.bb.__offset(this.bb_pos,22);return e?this.bb.readUint16(this.bb_pos+e):16}crs(e){let r=this.bb.__offset(this.bb_pos,24);return r?(e||new J).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}title(e){let r=this.bb.__offset(this.bb_pos,26);return r?this.bb.__string(this.bb_pos+r,e):null}description(e){let r=this.bb.__offset(this.bb_pos,28);return r?this.bb.__string(this.bb_pos+r,e):null}metadata(e){let r=this.bb.__offset(this.bb_pos,30);return r?this.bb.__string(this.bb_pos+r,e):null}static startHeader(e){e.startObject(14)}static addName(e,r){e.addFieldOffset(0,r,0)}static addEnvelope(e,r){e.addFieldOffset(1,r,0)}static createEnvelopeVector(e,r){e.startVector(8,r.length,8);for(let s=r.length-1;s>=0;s--)e.addFloat64(r[s]);return e.endVector()}static startEnvelopeVector(e,r){e.startVector(8,r,8)}static addGeometryType(e,r){e.addFieldInt8(2,r,C.Unknown)}static addHasZ(e,r){e.addFieldInt8(3,Number(r),Number(!1))}static addHasM(e,r){e.addFieldInt8(4,Number(r),Number(!1))}static addHasT(e,r){e.addFieldInt8(5,Number(r),Number(!1))}static addHasTm(e,r){e.addFieldInt8(6,Number(r),Number(!1))}static addColumns(e,r){e.addFieldOffset(7,r,0)}static createColumnsVector(e,r){e.startVector(4,r.length,4);for(let s=r.length-1;s>=0;s--)e.addOffset(r[s]);return e.endVector()}static startColumnsVector(e,r){e.startVector(4,r,4)}static addFeaturesCount(e,r){e.addFieldInt64(8,r,BigInt("0"))}static addIndexNodeSize(e,r){e.addFieldInt16(9,r,16)}static addCrs(e,r){e.addFieldOffset(10,r,0)}static addTitle(e,r){e.addFieldOffset(11,r,0)}static addDescription(e,r){e.addFieldOffset(12,r,0)}static addMetadata(e,r){e.addFieldOffset(13,r,0)}static endHeader(e){return e.endObject()}static finishHeaderBuffer(e,r){e.finish(r)}static finishSizePrefixedHeaderBuffer(e,r){e.finish(r,void 0,!0)}};function me(t){let e=Tt.getRootAsHeader(t),r=e.featuresCount(),s=e.indexNodeSize(),i=[];for(let h=0;h<e.columnsLength();h++){let f=e.columns(h);if(!f)throw new Error("Column unexpectedly missing");if(!f.name())throw new Error("Column name unexpectedly missing");i.push({name:f.name(),type:f.type(),title:f.title(),description:f.description(),width:f.width(),precision:f.precision(),scale:f.scale(),nullable:f.nullable(),unique:f.unique(),primary_key:f.primaryKey()})}let a=e.crs(),n=a?{org:a.org(),code:a.code(),name:a.name(),description:a.description(),wkt:a.wkt(),code_string:a.codeString()}:null;return{geometryType:e.geometryType(),columns:i,envelope:null,featuresCount:Number(r),indexNodeSize:s,crs:n,title:e.title(),description:e.description(),metadata:e.metadata()}}var _r=function(t,e){return _r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)s.hasOwnProperty(i)&&(r[i]=s[i])},_r(t,e)};function mh(t,e){_r(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function Kt(t,e,r,s){function i(a){return a instanceof r?a:new r(function(n){n(a)})}return new(r||(r=Promise))(function(a,n){function o(c){try{f(s.next(c))}catch(l){n(l)}}function h(c){try{f(s.throw(c))}catch(l){n(l)}}function f(c){c.done?a(c.value):i(c.value).then(o,h)}f((s=s.apply(t,e||[])).next())})}function Pt(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},s,i,a,n;return n={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(n[Symbol.iterator]=function(){return this}),n;function o(f){return function(c){return h([f,c])}}function h(f){if(s)throw new TypeError("Generator is already executing.");for(;r;)try{if(s=1,i&&(a=f[0]&2?i.return:f[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,f[1])).done)return a;switch(i=0,a&&(f=[f[0]&2,a.value]),f[0]){case 0:case 1:a=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!a||f[1]>a[0]&&f[1]<a[3])){r.label=f[1];break}if(f[0]===6&&r.label<a[1]){r.label=a[1],a=f;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(f);break}a[2]&&r.ops.pop(),r.trys.pop();continue}f=e.call(t,r)}catch(c){f=[6,c],i=0}finally{s=a=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function Qt(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],s=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&s>=t.length&&(t=void 0),{value:t&&t[s++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function be(t){return this instanceof be?(this.v=t,this):new be(t)}function ph(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=r.apply(t,e||[]),i,a=[];return i={},n("next"),n("throw"),n("return"),i[Symbol.asyncIterator]=function(){return this},i;function n(u){s[u]&&(i[u]=function(m){return new Promise(function(d,p){a.push([u,m,d,p])>1||o(u,m)})})}function o(u,m){try{h(s[u](m))}catch(d){l(a[0][3],d)}}function h(u){u.value instanceof be?Promise.resolve(u.value.v).then(f,c):l(a[0][2],u)}function f(u){o("next",u)}function c(u){o("throw",u)}function l(u,m){u(m),a.shift(),a.length&&o(a[0][0],a[0][1])}}var ci=function(t){mh(e,t);function e(r){var s=t.call(this,r)||this;return Object.defineProperty(s,"name",{value:"RepeaterOverflowError",enumerable:!1}),typeof Object.setPrototypeOf=="function"?Object.setPrototypeOf(s,s.constructor.prototype):s.__proto__=s.constructor.prototype,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(s,s.constructor),s}return e}(Error),Em=function(){function t(e){if(e<0)throw new RangeError("Capacity may not be less than 0");this._c=e,this._q=[]}return Object.defineProperty(t.prototype,"empty",{get:function(){return this._q.length===0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"full",{get:function(){return this._q.length>=this._c},enumerable:!1,configurable:!0}),t.prototype.add=function(e){if(this.full)throw new Error("Buffer full");this._q.push(e)},t.prototype.remove=function(){if(this.empty)throw new Error("Buffer empty");return this._q.shift()},t}(),Sm=function(){function t(e){if(e<1)throw new RangeError("Capacity may not be less than 1");this._c=e,this._q=[]}return Object.defineProperty(t.prototype,"empty",{get:function(){return this._q.length===0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"full",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype.add=function(e){for(;this._q.length>=this._c;)this._q.shift();this._q.push(e)},t.prototype.remove=function(){if(this.empty)throw new Error("Buffer empty");return this._q.shift()},t}(),Am=function(){function t(e){if(e<1)throw new RangeError("Capacity may not be less than 1");this._c=e,this._q=[]}return Object.defineProperty(t.prototype,"empty",{get:function(){return this._q.length===0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"full",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype.add=function(e){this._q.length<this._c&&this._q.push(e)},t.prototype.remove=function(){if(this.empty)throw new Error("Buffer empty");return this._q.shift()},t}();function yr(t){t!=null&&typeof t.then=="function"&&t.then(Ze,Ze)}var vr=0,fi=1,Gt=2,Xe=3,gr=4,Je=1024,Ze=function(){};function $t(t){var e=t.err,r=Promise.resolve(t.execution).then(function(s){if(e!=null)throw e;return s});return t.err=void 0,t.execution=r.then(function(){},function(){}),t.pending===void 0?r:t.pending.then(function(){return r})}function Bt(t,e){var r=t.state>=Xe;return Promise.resolve(e).then(function(s){return!r&&t.state>=gr?$t(t).then(function(i){return{value:i,done:!0}}):{value:s,done:r}})}function Mr(t,e){var r,s;if(!(t.state>=Gt))if(t.state=Gt,t.onnext(),t.onstop(),t.err==null&&(t.err=e),t.pushes.length===0&&(typeof t.buffer>"u"||t.buffer.empty))pe(t);else try{for(var i=Qt(t.pushes),a=i.next();!a.done;a=i.next()){var n=a.value;n.resolve()}}catch(o){r={error:o}}finally{try{a&&!a.done&&(s=i.return)&&s.call(i)}finally{if(r)throw r.error}}}function pe(t){var e,r;if(!(t.state>=Xe)){t.state<Gt&&Mr(t),t.state=Xe,t.buffer=void 0;try{for(var s=Qt(t.nexts),i=s.next();!i.done;i=s.next()){var a=i.value,n=t.pending===void 0?$t(t):t.pending.then(function(){return $t(t)});a.resolve(Bt(t,n))}}catch(o){e={error:o}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}t.pushes=[],t.nexts=[]}}function li(t){t.state>=gr||(t.state<Xe&&pe(t),t.state=gr)}function bh(t,e){if(yr(e),t.pushes.length>=Je)throw new ci("No more than "+Je+" pending calls to push are allowed on a single repeater.");if(t.state>=Gt)return Promise.resolve(void 0);var r=t.pending===void 0?Promise.resolve(e):t.pending.then(function(){return e});r=r.catch(function(h){t.state<Gt&&(t.err=h),li(t)});var s;if(t.nexts.length){var i=t.nexts.shift();i.resolve(Bt(t,r)),t.nexts.length?s=Promise.resolve(t.nexts[0].value):s=new Promise(function(h){return t.onnext=h})}else typeof t.buffer<"u"&&!t.buffer.full?(t.buffer.add(r),s=Promise.resolve(void 0)):s=new Promise(function(h){return t.pushes.push({resolve:h,value:r})});var a=!0,n={},o=s.catch(function(h){if(a)throw h});return n.then=function(h,f){return a=!1,Promise.prototype.then.call(s,h,f)},n.catch=function(h){return a=!1,Promise.prototype.catch.call(s,h)},n.finally=s.finally.bind(s),t.pending=r.then(function(){return o}).catch(function(h){t.err=h,li(t)}),n}function vh(t){var e=Mr.bind(null,t),r=new Promise(function(s){return t.onstop=s});return e.then=r.then.bind(r),e.catch=r.catch.bind(r),e.finally=r.finally.bind(r),e}function _h(t){if(!(t.state>=fi)){t.state=fi;var e=bh.bind(null,t),r=vh(t);t.execution=new Promise(function(s){return s(t.executor(e,r))}),t.execution.catch(function(){return Mr(t)})}}var He=new WeakMap,Yt=function(){function t(e,r){He.set(this,{executor:e,buffer:r,err:void 0,state:vr,pushes:[],nexts:[],pending:void 0,execution:void 0,onnext:Ze,onstop:Ze})}return t.prototype.next=function(e){yr(e);var r=He.get(this);if(r===void 0)throw new Error("WeakMap error");if(r.nexts.length>=Je)throw new ci("No more than "+Je+" pending calls to next are allowed on a single repeater.");if(r.state<=vr&&_h(r),r.onnext(e),typeof r.buffer<"u"&&!r.buffer.empty){var s=Bt(r,r.buffer.remove());if(r.pushes.length){var i=r.pushes.shift();r.buffer.add(i.value),r.onnext=i.resolve}return s}else if(r.pushes.length){var a=r.pushes.shift();return r.onnext=a.resolve,Bt(r,a.value)}else if(r.state>=Gt)return pe(r),Bt(r,$t(r));return new Promise(function(n){return r.nexts.push({resolve:n,value:e})})},t.prototype.return=function(e){yr(e);var r=He.get(this);if(r===void 0)throw new Error("WeakMap error");return pe(r),r.execution=Promise.resolve(r.execution).then(function(){return e}),Bt(r,$t(r))},t.prototype.throw=function(e){var r=He.get(this);if(r===void 0)throw new Error("WeakMap error");return r.state<=vr||r.state>=Gt||typeof r.buffer<"u"&&!r.buffer.empty?(pe(r),r.err==null&&(r.err=e),Bt(r,$t(r))):this.next(Promise.reject(e))},t.prototype[Symbol.asyncIterator]=function(){return this},t.race=yh,t.merge=gh,t.zip=Mh,t.latest=xh,t}();function $e(t,e){var r,s,i=[],a=function(f){f!=null&&typeof f[Symbol.asyncIterator]=="function"?i.push(f[Symbol.asyncIterator]()):f!=null&&typeof f[Symbol.iterator]=="function"?i.push(f[Symbol.iterator]()):i.push(function(){return ph(this,arguments,function(){return Pt(this,function(u){switch(u.label){case 0:return e.yieldValues?[4,be(f)]:[3,3];case 1:return[4,u.sent()];case 2:u.sent(),u.label=3;case 3:return e.returnValues?[4,be(f)]:[3,5];case 4:return[2,u.sent()];case 5:return[2]}})})}())};try{for(var n=Qt(t),o=n.next();!o.done;o=n.next()){var h=o.value;a(h)}}catch(f){r={error:f}}finally{try{o&&!o.done&&(s=n.return)&&s.call(n)}finally{if(r)throw r.error}}return i}function yh(t){var e=this,r=$e(t,{returnValues:!0});return new Yt(function(s,i){return Kt(e,void 0,void 0,function(){var a,n,o,h,f,c;return Pt(this,function(l){switch(l.label){case 0:if(!r.length)return i(),[2];n=!1,i.then(function(){a(),n=!0}),l.label=1;case 1:l.trys.push([1,,5,7]),h=void 0,f=0,c=function(){var u,m,d,p,v,g;return Pt(this,function(x){switch(x.label){case 0:u=f;try{for(m=(v=void 0,Qt(r)),d=m.next();!d.done;d=m.next())p=d.value,Promise.resolve(p.next()).then(function(M){M.done?(i(),o===void 0&&(o=M)):f===u&&(f++,a(M))},function(M){return i(M)})}catch(M){v={error:M}}finally{try{d&&!d.done&&(g=m.return)&&g.call(m)}finally{if(v)throw v.error}}return[4,new Promise(function(M){return a=M})];case 1:return h=x.sent(),h===void 0?[3,3]:[4,s(h.value)];case 2:x.sent(),x.label=3;case 3:return[2]}})},l.label=2;case 2:return n?[3,4]:[5,c()];case 3:return l.sent(),[3,2];case 4:return[2,o&&o.value];case 5:return i(),[4,Promise.race(r.map(function(u){return u.return&&u.return()}))];case 6:return l.sent(),[7];case 7:return[2]}})})})}function gh(t){var e=this,r=$e(t,{yieldValues:!0});return new Yt(function(s,i){return Kt(e,void 0,void 0,function(){var a,n,o,h=this;return Pt(this,function(f){switch(f.label){case 0:if(!r.length)return i(),[2];a=[],n=!1,i.then(function(){var c,l;n=!0;try{for(var u=Qt(a),m=u.next();!m.done;m=u.next()){var d=m.value;d()}}catch(p){c={error:p}}finally{try{m&&!m.done&&(l=u.return)&&l.call(u)}finally{if(c)throw c.error}}}),f.label=1;case 1:return f.trys.push([1,,3,4]),[4,Promise.all(r.map(function(c,l){return Kt(h,void 0,void 0,function(){var u,m;return Pt(this,function(d){switch(d.label){case 0:d.trys.push([0,,6,9]),d.label=1;case 1:return n?[3,5]:(Promise.resolve(c.next()).then(function(p){return a[l](p)},function(p){return i(p)}),[4,new Promise(function(p){a[l]=p})]);case 2:return u=d.sent(),u===void 0?[3,4]:u.done?(o=u,[2]):[4,s(u.value)];case 3:d.sent(),d.label=4;case 4:return[3,1];case 5:return[3,9];case 6:return m=c.return,m?[4,c.return()]:[3,8];case 7:m=d.sent(),d.label=8;case 8:return[7];case 9:return[2]}})})}))];case 2:return f.sent(),[2,o&&o.value];case 3:return i(),[7];case 4:return[2]}})})})}function Mh(t){var e=this,r=$e(t,{returnValues:!0});return new Yt(function(s,i){return Kt(e,void 0,void 0,function(){var a,n,o,h;return Pt(this,function(f){switch(f.label){case 0:if(!r.length)return i(),[2,[]];n=!1,i.then(function(){a(),n=!0}),f.label=1;case 1:f.trys.push([1,,6,8]),f.label=2;case 2:return n?[3,5]:(Promise.all(r.map(function(c){return c.next()})).then(function(c){return a(c)},function(c){return i(c)}),[4,new Promise(function(c){return a=c})]);case 3:return o=f.sent(),o===void 0?[2]:(h=o.map(function(c){return c.value}),o.some(function(c){return c.done})?[2,h]:[4,s(h)]);case 4:return f.sent(),[3,2];case 5:return[3,8];case 6:return i(),[4,Promise.all(r.map(function(c){return c.return&&c.return()}))];case 7:return f.sent(),[7];case 8:return[2]}})})})}function xh(t){var e=this,r=$e(t,{yieldValues:!0,returnValues:!0});return new Yt(function(s,i){return Kt(e,void 0,void 0,function(){var a,n,o,h,f,c=this;return Pt(this,function(l){switch(l.label){case 0:if(!r.length)return i(),[2,[]];n=[],o=!1,i.then(function(){var u,m;a();try{for(var d=Qt(n),p=d.next();!p.done;p=d.next()){var v=p.value;v()}}catch(g){u={error:g}}finally{try{p&&!p.done&&(m=d.return)&&m.call(d)}finally{if(u)throw u.error}}o=!0}),l.label=1;case 1:return l.trys.push([1,,5,7]),Promise.all(r.map(function(u){return u.next()})).then(function(u){return a(u)},function(u){return i(u)}),[4,new Promise(function(u){return a=u})];case 2:return h=l.sent(),h===void 0?[2]:(f=h.map(function(u){return u.value}),h.every(function(u){return u.done})?[2,f]:[4,s(f.slice())]);case 3:return l.sent(),[4,Promise.all(r.map(function(u,m){return Kt(c,void 0,void 0,function(){var d;return Pt(this,function(p){switch(p.label){case 0:if(h[m].done)return[2,h[m].value];p.label=1;case 1:return o?[3,4]:(Promise.resolve(u.next()).then(function(v){return n[m](v)},function(v){return i(v)}),[4,new Promise(function(v){return n[m]=v})]);case 2:return d=p.sent(),d===void 0?[2,h[m].value]:d.done?[2,d.value]:(f[m]=d.value,[4,s(f.slice())]);case 3:return p.sent(),[3,1];case 4:return[2]}})})}))];case 4:return[2,l.sent()];case 5:return i(),[4,Promise.all(r.map(function(u){return u.return&&u.return()}))];case 6:return l.sent(),[7];case 7:return[2]}})})})}var xr=class{_extraRequestThreshold=256*1024;extraRequestThreshold(){return this._extraRequestThreshold}setExtraRequestThreshold(e){if(e<0)throw new Error("extraRequestThreshold cannot be negative");this._extraRequestThreshold=e}},Et=xr;Ut(Et,"global",new xr);var ft;(function(t){t[t.Debug=0]="Debug",t[t.Info=1]="Info",t[t.Warn=2]="Warn",t[t.Error=3]="Error"})(ft||(ft={}));var F=class{static debug(...e){this.log(ft.Debug,...e)}static info(...e){this.log(ft.Info,...e)}static warn(...e){this.log(ft.Warn,...e)}static error(...e){this.log(ft.Error,...e)}static log(e,...r){if(!(this.logLevel>e))switch(e){case ft.Debug:{console.debug(...r);break}case ft.Info:{console.info(...r);break}case ft.Warn:{console.warn(...r);break}case ft.Error:{console.error(...r);break}}}};Ut(F,"logLevel",ft.Warn);var St=8*4+8;var ui=16;function ve(t,e){e=Math.min(Math.max(Number(e),2),65535);let r=t,s=r;do r=Math.ceil(r/e),s+=r;while(r!==1);return s*St}function wh(t,e){if(e<2)throw new Error("Node size must be at least 2");if(t===0)throw new Error("Number of items must be greater than 0");let r=t,s=r,i=[r];do r=Math.ceil(r/e),s+=r,i.push(r);while(r!==1);let a=[];r=s;for(let o of i)a.push(r-o),r-=o;let n=[];for(let o=0;o<i.length;o++)n.push([a[o],a[o]+i[o]]);return n}async function*di(t,e,r,s){class i{_level;nodes;constructor(d,p){this._level=p,this.nodes=d}level(){return this._level}startNodeIdx(){return this.nodes[0]}endNodeIdx(){return this.nodes[1]}extendEndNodeIdx(d){console.assert(d>this.nodes[1]),this.nodes[1]=d}toString(){return`[NodeRange level: ${this._level}, nodes: ${this.nodes[0]}-${this.nodes[1]}]`}}let{minX:a,minY:n,maxX:o,maxY:h}=r;F.info(`tree items: ${t}, nodeSize: ${e}`);let f=wh(t,e),c=f[0][0],u=[(()=>{let m=[0,1],d=f.length-1;return new i(m,d)})()];for(F.debug(`starting stream search with queue: ${u}, numItems: ${t}, nodeSize: ${e}, levelBounds: ${f}`);u.length!=0;){let m=u.shift();F.debug(`popped node: ${m}, queueLength: ${u.length}`);let d=m.startNodeIdx(),p=d>=c,v=(()=>{let[,S]=f[m.level()],I=Math.min(m.endNodeIdx()+e,S);return p&&I<S?I+1:I})(),g=v-d,x=await s(d*St,g*St),M=new DataView(x);for(let S=d;S<v;S++){let I=S-d,P=I*St;if(o<M.getFloat64(P+0,!0)||h<M.getFloat64(P+8,!0)||a>M.getFloat64(P+16,!0)||n>M.getFloat64(P+24,!0))continue;let B=M.getBigUint64(P+32,!0);if(p){let pt=B,se=(()=>{if(S<t-1){let Ri=(I+1)*St;return M.getBigUint64(Ri+32,!0)-pt}return null})(),Oi=S-c;yield[Number(pt),Oi,Number(se)];continue}let N=B,Y=Et.global.extraRequestThreshold()/St,q=u[u.length-1];if(q!==void 0&&q.level()==m.level()-1&&N<q.endNodeIdx()+Y){F.debug(`Merging "nodeRange" request into existing range: ${q}, newEndNodeIdx: ${q.endNodeIdx()} -> ${N}`),q.extendEndNodeIdx(Number(N));continue}let rt=(()=>{let pt=m.level()-1,se=[Number(N),Number(N)+1];return new i(se,pt)})();q!==void 0&&q.level()==rt.level()?F.info(`Same level, but too far away. Pushing new request for nodeIdx: ${N} rather than merging with distant ${q}`):F.info(`Pushing new level for ${rt} onto queue with nearestNodeRange: ${q} since there's not already a range for this level.`),u.push(rt)}}}var mt=new Uint8Array([102,103,98,3,102,103,98,0]),lt=4;var te=class{headerClient;header;headerLength;indexLength;constructor(e,r,s,i){this.headerClient=e,this.header=r,this.headerLength=s,this.indexLength=i}static async open(e){let s=new Ke(e),i=(()=>{let l=ui,u=3,m=0,d;for(d=0;d<u;d++){let p=l**d*St;m+=p}return m})(),a=2024+i;F.debug(`fetching header. minReqLength: ${a} (assumedHeaderLength: ${2024}, assumedIndexLength: ${i})`);{let l=new Uint8Array(await s.getRange(0,8,a,"header"));if(!l.subarray(0,3).every((u,m)=>mt[m]===u))throw F.error(`bytes: ${l} != ${mt}`),new Error("Not a FlatGeobuf file");F.debug("magic bytes look good")}let n;{let l=await s.getRange(8,4,a,"header");n=new DataView(l).getUint32(0,!0);let u=1048576*10;if(n>u||n<8)throw new Error("Invalid header size");F.debug(`headerLength: ${n}`)}let o=await s.getRange(12,n,a,"header"),h=new H(new Uint8Array(o)),f=me(h),c=ve(f.featuresCount,f.indexNodeSize);return F.debug("completed: opening http reader"),new te(s,f,n,c)}async*selectBbox(e){let r=this.lengthBeforeTree(),s=this.headerClient,i=async function(h,f){return s.getRange(r+h,f,0,"index")},a=[],n=[];for await(let h of di(this.header.featuresCount,this.header.indexNodeSize,e,i)){let[f,,]=h,[,,c]=h;if(c||(F.info("final feature"),c=4),n.length==0){n.push([f,c]);continue}let l=n[n.length-1],u=f-(l[0]+l[1]);u>Et.global.extraRequestThreshold()&&(F.info(`Pushing new feature batch, since gap ${u} was too large`),a.push(n),n=[]),n.push([f,c])}this.headerClient.logUsage("header+index"),n.length>0&&a.push(n);let o=a.flatMap(h=>this.readFeatureBatch(h));yield*Yt.merge(o)}lengthBeforeTree(){return mt.length+lt+this.headerLength}lengthBeforeFeatures(){return this.lengthBeforeTree()+this.indexLength}buildFeatureClient(){return new Ke(this.headerClient.httpClient)}async*readFeatureBatch(e){let[r]=e[0],[s,i]=e[e.length-1],a=r,o=s+i-a,h=this.buildFeatureClient(),f=o;for(let[c]of e)yield await this.readFeature(h,c,f),f=0;h.logUsage("feature")}async readFeature(e,r,s){let i=r+this.lengthBeforeFeatures(),a;{let c=await e.getRange(i,4,s,"feature length");a=new DataView(c).getUint32(0,!0)}let n=await e.getRange(i+4,a,s,"feature data"),o=new Uint8Array(n),h=new Uint8Array(a+lt);h.set(o,lt);let f=new H(h);return f.setPosition(lt),X.getRootAsFeature(f)}},Ke=class{httpClient;bytesEverUsed=0;bytesEverFetched=0;buffer=new ArrayBuffer(0);head=0;constructor(e){if(typeof e=="string")this.httpClient=new Qe(e);else if(e instanceof Qe)this.httpClient=e;else throw new Error("Unknown source ")}async getRange(e,r,s,i){this.bytesEverUsed+=r;let a=e-this.head,n=a+r;if(a>=0&&n<=this.buffer.byteLength)return this.buffer.slice(a,n);let o=Math.max(r,s);return this.bytesEverFetched+=o,F.debug(`requesting for new Range: ${e}-${e+o-1}`),this.buffer=await this.httpClient.getRange(e,o,i),this.head=e,this.buffer.slice(0,r)}logUsage(e){let r=e.split(" ")[0],s=this.bytesEverUsed,i=this.bytesEverFetched,a=(100*s/i).toFixed(2);F.info(`${r} bytes used/requested: ${s} / ${i} = ${a}%`)}},Qe=class{url;requestsEverMade=0;bytesEverRequested=0;constructor(e){this.url=e}async getRange(e,r,s){this.requestsEverMade+=1,this.bytesEverRequested+=r;let i=`bytes=${e}-${e+r-1}`;return F.info(`request: #${this.requestsEverMade}, purpose: ${s}), bytes: (this_request: ${r}, ever: ${this.bytesEverRequested}), Range: ${i}`),(await fetch(this.url,{headers:{Range:i}})).arrayBuffer()}};function Ye(t,e,r){if(!t.subarray(0,3).every((c,l)=>mt[l]===c))throw new Error("Not a FlatGeobuf file");let s=new H(t),i=s.readUint32(mt.length);s.setPosition(mt.length+lt);let a=me(s);r&&r(a);let n=mt.length+lt+i,{indexNodeSize:o,featuresCount:h}=a;o>0&&(n+=ve(h,o));let f=[];for(;n<s.capacity();){let c=s.readUint32(n);s.setPosition(n+lt);let l=X.getRootAsFeature(s);f.push(e(l,a)),n+=lt+c}return f}async function*tr(t,e,r){let s=br(t),i=async u=>await s.slice(u),a=new Uint8Array(await i(8,"magic bytes"));if(!a.subarray(0,3).every((u,m)=>mt[m]===u))throw new Error("Not a FlatGeobuf file");a=new Uint8Array(await i(4,"header length"));let n=new H(a),o=n.readUint32(0);a=new Uint8Array(await i(o,"header data")),n=new H(a);let h=me(n);r&&r(h);let{indexNodeSize:f,featuresCount:c}=h;if(f>0){let u=ve(c,f);await i(u,"entire index, w/o rect")}let l;for(;l=await Ih(i,h,e);)yield l}async function*er(t,e,r,s){let i=await te.open(t);F.debug("opened reader"),s&&s(i.header);for await(let a of i.selectBbox(e))yield r(a,i.header)}async function Ih(t,e,r){let s=new Uint8Array(await t(4,"feature length"));if(s.byteLength===0)return;let i=new H(s),a=i.readUint32(0);s=new Uint8Array(await t(a,"feature data"));let n=new Uint8Array(a+4);n.set(s,4),i=new H(n),i.setPosition(lt);let o=X.getRootAsFeature(i);return r(o,e)}function mi(t,e){return{type:"FeatureCollection",features:Ye(t,Ve,e)}}function pi(t,e){return tr(t,Ve,e)}function bi(t,e,r){return er(t,e,Ve,r)}function vi(t,e,r){return t instanceof Uint8Array?mi(t,r):t instanceof ReadableStream?pi(t,r):bi(t,e,r)}function _i(t,e,r){return t instanceof Uint8Array?Ye(t,e):t instanceof ReadableStream?tr(t,e):er(t,r,e)}var gi=vi,Mi=_i;function xi(t,e){let r=e.shape;switch(r){case"geojson-table":return Sh(t,e);case"columnar-table":return{shape:"columnar-table",data:yi(t,e)};case"binary":return yi(t,e);default:throw new Error(r)}}function yi(t,e={}){let r=new Uint8Array(t);return Mi(r,dr)}function Sh(t,e){if(t.byteLength===0)return{shape:"geojson-table",type:"FeatureCollection",features:[]};let{reproject:r=!1,crs:s="WGS84"}=e,i=new Uint8Array(t),a,n,o=e.boundingBox&&Ii(e.boundingBox),{features:h}=gi(i,o,l=>{a=l,n=si(a)}),f=a?.crs?.wkt,c;if(r&&f)try{c=new Xt({from:f,to:s})}catch{}return c&&(h=Ue(h,l=>c.project(l))),{shape:"geojson-table",schema:n,type:"FeatureCollection",features:h}}function wi(t,e){let r=e.shape;switch(r){case"binary":return Ah(t,e);case"geojson-table":return Nh(t,e);default:throw new Error(r)}}function Ah(t,e){let r=e.boundingBox&&Ii(e.boundingBox);return Mi(t,Fh,r)}async function*Nh(t,e){let{reproject:r=!1,crs:s="WGS84"}=e||{},i,a=gi(t,void 0,h=>{i=h}),n,o=!0;for await(let h of a){if(o){let f=i?.crs?.wkt;r&&f&&(n=new Xt({from:f,to:s})),o=!1}r&&n?yield Ue([h],f=>n.project(f)):yield h}}function Ii(t){return{minX:t[0][0],minY:t[0][1],maxX:t[1][0],maxY:t[1][1]}}function Fh(t,e){let r=t.geometry(),s=e.geometryType||r?.type(),i=dr(r,s);return i.properties=ke(t,e.columns),i}var Oh="4.4.0-alpha.0",Rh=[102,103,98,3,102,103,98,1],wr={...zt,dataType:null,batchType:null,version:Oh,worker:!0,tests:[new Uint8Array(Rh).buffer],options:{flatgeobuf:{shape:"geojson-table"},gis:{reproject:!1}}},ee={...wr,parse:async(t,e={})=>Pi(t,e),parseSync:Pi,parseInBatchesFromStream:Lh,binary:!0};function Pi(t,e={}){return xi(t,Ei(e))}function Lh(t,e){return wi(t,Ei(e))}function Ei(t){return t={...t,flatgeobuf:{...ee.options.flatgeobuf,...t?.flatgeobuf},gis:{...ee.options.gis,...t?.gis}},{shape:t?.flatgeobuf?.shape??"geojson-table",boundingBox:t?.flatgeobuf?.boundingBox,crs:t?.gis?._targetCrs||"WGS84",reproject:t?.gis?.reproject||!1}}function Si(t,e){return Ai(t||{},e)}function Ai(t,e,r=0){if(r>3)return e;let s={...t};for(let[i,a]of Object.entries(e))a&&typeof a=="object"&&!Array.isArray(a)?s[i]=Ai(s[i]||{},e[i],r+1):s[i]=e[i];return s}var Ch="",Ni={};function Fi(t){for(let e in Ni)if(t.startsWith(e)){let r=Ni[e];t=t.replace(e,r)}return!t.startsWith("http://")&&!t.startsWith("https://")&&(t=`${Ch}${t}`),t}var Ir=class{optionsType;options;data;url;loadOptions;fetch;_needsRefresh=!0;constructor(e,r,s){s?this.options=Si({...s,core:Ir.defaultOptions},r):this.options={...r},this.data=e,this.url=typeof e=="string"?Fi(e):"",this.loadOptions={...this.options.core?.loadOptions},this.fetch=Th(this.loadOptions)}setProps(e){this.options=Object.assign(this.options,e),this.setNeedsRefresh()}setNeedsRefresh(){this._needsRefresh=!0}getNeedsRefresh(e=!0){let r=this._needsRefresh;return e&&(this._needsRefresh=!1),r}},re=Ir;Ut(re,"defaultOptions",{core:{type:"auto",attributions:[],loadOptions:{},loaders:[]}});function Th(t){let e=t?.fetch;if(e&&typeof e=="function")return(s,i)=>e(s,i);let r=t?.fetch;return r&&typeof r!="function"?s=>fetch(s,r):s=>fetch(s)}var Er={...zt,version:"0.0.0",type:"flatgeobuf-server",fromUrl:!0,fromBlob:!1,defaultOptions:{flatgeobuf:{}},testURL:t=>t.toLowerCase().includes("FeatureServer"),createDataSource:(t,e)=>new Pr(t,e)},Pr=class extends re{formatSpecificMetadata=null;constructor(e,r){super(e,r,Er.defaultOptions)}async getSchema(){return await this.getMetadata({formatSpecificMetadata:!0}),{metadata:{},fields:[]}}async getMetadata(e){return this.formatSpecificMetadata,e.formatSpecificMetadata,{}}async getFeatures(e){let s=await(await this.fetch(this.url)).arrayBuffer();return await ee.parse(s,{})}};return Di(_e);})();
|
|
10
|
+
northing meters`+t;var u=l/2,m=0,d=0,p,v,g,x,M;return u>0&&(p=1e5/Math.pow(10,u),v=t.substring(a,a+u),m=parseFloat(v)*p,g=t.substring(a+u),d=parseFloat(g)*p),x=m+f,M=d+c,{easting:x,northing:M,zoneLetter:o,zoneNumber:n,accuracy:p}}function wa(t,e){for(var r=hs.charCodeAt(e-1),s=1e5,i=!1;r!==t.charCodeAt(0);){if(r++,r===Z&&r++,r===et&&r++,r>le){if(i)throw"Bad character: "+t;r=Dt,i=!0}s+=1e5}return s}function Ia(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var r=fs.charCodeAt(e-1),s=0,i=!1;r!==t.charCodeAt(0);){if(r++,r===Z&&r++,r===et&&r++,r>fe){if(i)throw"Bad character: "+t;r=Dt,i=!0}s+=1e5}return s}function Pa(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}function kt(t,e,r){if(!(this instanceof kt))return new kt(t,e,r);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if(typeof t=="object")this.x=t.x,this.y=t.y,this.z=t.z||0;else if(typeof t=="string"&&typeof e>"u"){var s=t.split(",");this.x=parseFloat(s[0],10),this.y=parseFloat(s[1],10),this.z=parseFloat(s[2],10)||0}else this.x=t,this.y=e,this.z=r||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}kt.fromMGRS=function(t){return new kt(hr(t))};kt.prototype.toMGRS=function(t){return or([this.x,this.y],t)};var ds=kt;var Ea=1,Sa=.25,ms=.046875,ps=.01953125,bs=.01068115234375,Aa=.75,Na=.46875,Fa=.013020833333333334,Oa=.007120768229166667,Ra=.3645833333333333,La=.005696614583333333,Ca=.3076171875;function Fe(t){var e=[];e[0]=Ea-t*(Sa+t*(ms+t*(ps+t*bs))),e[1]=t*(Aa-t*(ms+t*(ps+t*bs)));var r=t*t;return e[2]=r*(Na-t*(Fa+t*Oa)),r*=t,e[3]=r*(Ra-t*La),e[4]=r*t*Ca,e}function Ot(t,e,r,s){return r*=e,e*=e,s[0]*t-r*(s[1]+e*(s[2]+e*(s[3]+e*s[4])))}var Ta=20;function Oe(t,e,r){for(var s=1/(1-e),i=t,a=Ta;a;--a){var n=Math.sin(i),o=1-e*n*n;if(o=(Ot(i,n,Math.cos(i),r)-t)*(o*Math.sqrt(o))*s,i-=o,Math.abs(o)<_)return i}return i}function Ba(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.es&&(this.en=Fe(this.es),this.ml0=Ot(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function Ga(t){var e=t.x,r=t.y,s=y(e-this.long0),i,a,n,o=Math.sin(r),h=Math.cos(r);if(this.es){var c=h*s,l=Math.pow(c,2),u=this.ep2*Math.pow(h,2),m=Math.pow(u,2),d=Math.abs(h)>_?Math.tan(r):0,p=Math.pow(d,2),v=Math.pow(p,2);i=1-this.es*Math.pow(o,2),c=c/Math.sqrt(i);var g=Ot(r,o,h,this.en);a=this.a*(this.k0*c*(1+l/6*(1-p+u+l/20*(5-18*p+v+14*u-58*p*u+l/42*(61+179*v-v*p-479*p)))))+this.x0,n=this.a*(this.k0*(g-this.ml0+o*s*c/2*(1+l/12*(5-p+9*u+4*m+l/30*(61+v-58*p+270*u-330*p*u+l/56*(1385+543*v-v*p-3111*p))))))+this.y0}else{var f=h*Math.sin(s);if(Math.abs(Math.abs(f)-1)<_)return 93;if(a=.5*this.a*this.k0*Math.log((1+f)/(1-f))+this.x0,n=h*Math.cos(s)/Math.sqrt(1-Math.pow(f,2)),f=Math.abs(n),f>=1){if(f-1>_)return 93;n=0}else n=Math.acos(n);r<0&&(n=-n),n=this.a*this.k0*(n-this.lat0)+this.y0}return t.x=a,t.y=n,t}function Ua(t){var e,r,s,i,a=(t.x-this.x0)*(1/this.a),n=(t.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+n/this.k0,r=Oe(e,this.es,this.en),Math.abs(r)<b){var l=Math.sin(r),u=Math.cos(r),m=Math.abs(u)>_?Math.tan(r):0,d=this.ep2*Math.pow(u,2),p=Math.pow(d,2),v=Math.pow(m,2),g=Math.pow(v,2);e=1-this.es*Math.pow(l,2);var x=a*Math.sqrt(e)/this.k0,M=Math.pow(x,2);e=e*m,s=r-e*M/(1-this.es)*.5*(1-M/12*(5+3*v-9*d*v+d-4*p-M/30*(61+90*v-252*d*v+45*g+46*d-M/56*(1385+3633*v+4095*g+1574*g*v)))),i=y(this.long0+x*(1-M/6*(1+2*v+d-M/20*(5+28*v+24*g+8*d*v+6*d-M/42*(61+662*v+1320*g+720*g*v))))/u)}else s=b*ut(n),i=0;else{var o=Math.exp(a/this.k0),h=.5*(o-1/o),f=this.lat0+n/this.k0,c=Math.cos(f);e=Math.sqrt((1-Math.pow(c,2))/(1+Math.pow(h,2))),s=Math.asin(e),n<0&&(s=-s),h===0&&c===0?i=0:i=y(Math.atan2(h,c)+this.long0)}return t.x=i,t.y=s,t}var za=["Transverse_Mercator","Transverse Mercator","tmerc"],vs={init:Ba,forward:Ga,inverse:Ua,names:za};function Re(t){var e=Math.exp(t);return e=(e-1/e)/2,e}function ce(t,e){t=Math.abs(t),e=Math.abs(e);var r=Math.max(t,e),s=Math.min(t,e)/(r||1);return r*Math.sqrt(1+Math.pow(s,2))}function _s(t){var e=1+t,r=e-1;return r===0?t:t*Math.log(e)/r}function ys(t){var e=Math.abs(t);return e=_s(e*(1+e/(ce(1,e)+1))),t<0?-e:e}function Le(t,e){for(var r=2*Math.cos(2*e),s=t.length-1,i=t[s],a=0,n;--s>=0;)n=-a+r*i+t[s],a=i,i=n;return e+n*Math.sin(2*e)}function gs(t,e){for(var r=2*Math.cos(e),s=t.length-1,i=t[s],a=0,n;--s>=0;)n=-a+r*i+t[s],a=i,i=n;return Math.sin(e)*n}function Ms(t){var e=Math.exp(t);return e=(e+1/e)/2,e}function lr(t,e,r){for(var s=Math.sin(e),i=Math.cos(e),a=Re(r),n=Ms(r),o=2*i*n,h=-2*s*a,f=t.length-1,c=t[f],l=0,u=0,m=0,d,p;--f>=0;)d=u,p=l,u=c,l=m,c=-d+o*u-h*l+t[f],m=-p+h*u+o*l;return o=s*n,h=i*a,[o*c-h*m,o*m+h*c]}function qa(){if(this.es===void 0||this.es<=0)throw new Error("incorrect elliptical usage");this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),r=e;this.cgb[0]=e*(2+e*(-2/3+e*(-2+e*(116/45+e*(26/45+e*(-2854/675)))))),this.cbg[0]=e*(-2+e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))),r=r*e,this.cgb[1]=r*(7/3+e*(-8/5+e*(-227/45+e*(2704/315+e*(2323/945))))),this.cbg[1]=r*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),r=r*e,this.cgb[2]=r*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=r*(-26/15+e*(34/21+e*(8/5+e*(-12686/2835)))),r=r*e,this.cgb[3]=r*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=r*(1237/630+e*(-12/5+e*(-24832/14175))),r=r*e,this.cgb[4]=r*(4174/315+e*(-144838/6237)),this.cbg[4]=r*(-734/315+e*(109598/31185)),r=r*e,this.cgb[5]=r*(601676/22275),this.cbg[5]=r*(444337/155925),r=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+r*(1/4+r*(1/64+r/256))),this.utg[0]=e*(-.5+e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=r*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=r*(13/48+e*(-3/5+e*(557/1440+e*(281/630+e*(-1983433/1935360))))),r=r*e,this.utg[2]=r*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=r*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),r=r*e,this.utg[3]=r*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=r*(49561/161280+e*(-179/168+e*(6601661/7257600))),r=r*e,this.utg[4]=r*(-4583/161280+e*(108847/3991680)),this.gtu[4]=r*(34729/80640+e*(-3418889/1995840)),r=r*e,this.utg[5]=r*(-20648693/638668800),this.gtu[5]=r*(212378941/319334400);var s=Le(this.cbg,this.lat0);this.Zb=-this.Qn*(s+gs(this.gtu,2*s))}function ja(t){var e=y(t.x-this.long0),r=t.y;r=Le(this.cbg,r);var s=Math.sin(r),i=Math.cos(r),a=Math.sin(e),n=Math.cos(e);r=Math.atan2(s,n*i),e=Math.atan2(a*i,ce(s,i*n)),e=ys(Math.tan(e));var o=lr(this.gtu,2*r,2*e);r=r+o[0],e=e+o[1];var h,f;return Math.abs(e)<=2.623395162778?(h=this.a*(this.Qn*e)+this.x0,f=this.a*(this.Qn*r+this.Zb)+this.y0):(h=1/0,f=1/0),t.x=h,t.y=f,t}function Da(t){var e=(t.x-this.x0)*(1/this.a),r=(t.y-this.y0)*(1/this.a);r=(r-this.Zb)/this.Qn,e=e/this.Qn;var s,i;if(Math.abs(e)<=2.623395162778){var a=lr(this.utg,2*r,2*e);r=r+a[0],e=e+a[1],e=Math.atan(Re(e));var n=Math.sin(r),o=Math.cos(r),h=Math.sin(e),f=Math.cos(e);r=Math.atan2(n*f,ce(h,f*o)),e=Math.atan2(h,f*o),s=y(e+this.long0),i=Le(this.cgb,r)}else s=1/0,i=1/0;return t.x=s,t.y=i,t}var ka=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc"],Vt={init:qa,forward:ja,inverse:Da,names:ka};function xs(t,e){if(t===void 0){if(t=Math.floor((y(e)+Math.PI)*30/Math.PI)+1,t<0)return 0;if(t>60)return 60}return t}var Va="etmerc";function Wa(){var t=xs(this.zone,this.long0);if(t===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*G,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Vt.init.apply(this),this.forward=Vt.forward,this.inverse=Vt.inverse}var Ha=["Universal Transverse Mercator System","utm"],ws={init:Wa,names:Ha,dependsOn:Va};function Ce(t,e){return Math.pow((1-t)/(1+t),e)}var Xa=20;function Ja(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+E)/(Math.pow(Math.tan(.5*this.lat0+E),this.C)*Ce(this.e*t,this.ratexp))}function Za(t){var e=t.x,r=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*r+E),this.C)*Ce(this.e*Math.sin(r),this.ratexp))-b,t.x=this.C*e,t}function $a(t){for(var e=1e-14,r=t.x/this.C,s=t.y,i=Math.pow(Math.tan(.5*s+E)/this.K,1/this.C),a=Xa;a>0&&(s=2*Math.atan(i*Ce(this.e*Math.sin(t.y),-.5*this.e))-b,!(Math.abs(s-t.y)<e));--a)t.y=s;return a?(t.x=r,t.y=s,t):null}var Ka=["gauss"],Te={init:Ja,forward:Za,inverse:$a,names:Ka};function Qa(){Te.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function Ya(t){var e,r,s,i;return t.x=y(t.x-this.long0),Te.forward.apply(this,[t]),e=Math.sin(t.y),r=Math.cos(t.y),s=Math.cos(t.x),i=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*r*s),t.x=i*r*Math.sin(t.x),t.y=i*(this.cosc0*e-this.sinc0*r*s),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function tn(t){var e,r,s,i,a;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,a=Math.sqrt(t.x*t.x+t.y*t.y)){var n=2*Math.atan2(a,this.R2);e=Math.sin(n),r=Math.cos(n),i=Math.asin(r*this.sinc0+t.y*e*this.cosc0/a),s=Math.atan2(t.x*e,a*this.cosc0*r-t.y*this.sinc0*e)}else i=this.phic0,s=0;return t.x=s,t.y=i,Te.inverse.apply(this,[t]),t.x=y(t.x+this.long0),t}var en=["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"],Is={init:Qa,forward:Ya,inverse:tn,names:en};function rn(t,e,r){return e*=r,Math.tan(.5*(b+t))*Math.pow((1-e)/(1+e),.5*r)}function sn(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=_&&(this.k0=.5*(1+ut(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=_&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=_&&(this.k0=.5*this.cons*k(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/W(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=k(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-b,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function an(t){var e=t.x,r=t.y,s=Math.sin(r),i=Math.cos(r),a,n,o,h,f,c,l=y(e-this.long0);return Math.abs(Math.abs(e-this.long0)-Math.PI)<=_&&Math.abs(r+this.lat0)<=_?(t.x=NaN,t.y=NaN,t):this.sphere?(a=2*this.k0/(1+this.sinlat0*s+this.coslat0*i*Math.cos(l)),t.x=this.a*a*i*Math.sin(l)+this.x0,t.y=this.a*a*(this.coslat0*s-this.sinlat0*i*Math.cos(l))+this.y0,t):(n=2*Math.atan(this.ssfn_(r,s,this.e))-b,h=Math.cos(n),o=Math.sin(n),Math.abs(this.coslat0)<=_?(f=W(this.e,r*this.con,this.con*s),c=2*this.a*this.k0*f/this.cons,t.x=this.x0+c*Math.sin(e-this.long0),t.y=this.y0-this.con*c*Math.cos(e-this.long0),t):(Math.abs(this.sinlat0)<_?(a=2*this.a*this.k0/(1+h*Math.cos(l)),t.y=a*o):(a=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*o+this.cosX0*h*Math.cos(l))),t.y=a*(this.cosX0*o-this.sinX0*h*Math.cos(l))+this.y0),t.x=a*h*Math.sin(l)+this.x0,t))}function nn(t){t.x-=this.x0,t.y-=this.y0;var e,r,s,i,a,n=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var o=2*Math.atan(n/(2*this.a*this.k0));return e=this.long0,r=this.lat0,n<=_?(t.x=e,t.y=r,t):(r=Math.asin(Math.cos(o)*this.sinlat0+t.y*Math.sin(o)*this.coslat0/n),Math.abs(this.coslat0)<_?this.lat0>0?e=y(this.long0+Math.atan2(t.x,-1*t.y)):e=y(this.long0+Math.atan2(t.x,t.y)):e=y(this.long0+Math.atan2(t.x*Math.sin(o),n*this.coslat0*Math.cos(o)-t.y*this.sinlat0*Math.sin(o))),t.x=e,t.y=r,t)}else if(Math.abs(this.coslat0)<=_){if(n<=_)return r=this.lat0,e=this.long0,t.x=e,t.y=r,t;t.x*=this.con,t.y*=this.con,s=n*this.cons/(2*this.a*this.k0),r=this.con*vt(this.e,s),e=this.con*y(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else i=2*Math.atan(n*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,n<=_?a=this.X0:(a=Math.asin(Math.cos(i)*this.sinX0+t.y*Math.sin(i)*this.cosX0/n),e=y(this.long0+Math.atan2(t.x*Math.sin(i),n*this.cosX0*Math.cos(i)-t.y*this.sinX0*Math.sin(i)))),r=-1*vt(this.e,Math.tan(.5*(b+a)));return t.x=e,t.y=r,t}var on=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],Ps={init:sn,forward:an,inverse:nn,names:on,ssfn_:rn};function hn(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),r=this.a,s=this.rf,i=1/s,a=2*i-Math.pow(i,2),n=this.e=Math.sqrt(a);this.R=this.k0*r*Math.sqrt(1-a)/(1-a*Math.pow(e,2)),this.alpha=Math.sqrt(1+a/(1-a)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),h=Math.log(Math.tan(Math.PI/4+t/2)),f=Math.log((1+n*e)/(1-n*e));this.K=o-this.alpha*h+this.alpha*n/2*f}function fn(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),r=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),s=-this.alpha*(e+r)+this.K,i=2*(Math.atan(Math.exp(s))-Math.PI/4),a=this.alpha*(t.x-this.lambda0),n=Math.atan(Math.sin(a)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(a))),o=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(a));return t.y=this.R/2*Math.log((1+Math.sin(o))/(1-Math.sin(o)))+this.y0,t.x=this.R*n+this.x0,t}function ln(t){for(var e=t.x-this.x0,r=t.y-this.y0,s=e/this.R,i=2*(Math.atan(Math.exp(r/this.R))-Math.PI/4),a=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(s)),n=Math.atan(Math.sin(s)/(Math.cos(this.b0)*Math.cos(s)-Math.sin(this.b0)*Math.tan(i))),o=this.lambda0+n/this.alpha,h=0,f=a,c=-1e3,l=0;Math.abs(f-c)>1e-7;){if(++l>20)return;h=1/this.alpha*(Math.log(Math.tan(Math.PI/4+a/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(f))/2)),c=f,f=2*Math.atan(Math.exp(h))-Math.PI/2}return t.x=o,t.y=f,t}var cn=["somerc"],Es={init:hn,forward:fn,inverse:ln,names:cn};function un(){this.no_off=this.no_off||!1,this.no_rot=this.no_rot||!1,isNaN(this.k0)&&(this.k0=1);var t=Math.sin(this.lat0),e=Math.cos(this.lat0),r=this.e*t;this.bl=Math.sqrt(1+this.es/(1-this.es)*Math.pow(e,4)),this.al=this.a*this.bl*this.k0*Math.sqrt(1-this.es)/(1-r*r);var s=W(this.e,this.lat0,t),i=this.bl/e*Math.sqrt((1-this.es)/(1-r*r));i*i<1&&(i=1);var a,n;if(!isNaN(this.longc))this.lat0>=0?a=i+Math.sqrt(i*i-1):a=i-Math.sqrt(i*i-1),this.el=a*Math.pow(s,this.bl),n=.5*(a-1/a),this.gamma0=Math.asin(Math.sin(this.alpha)/i),this.long0=this.longc-Math.asin(n*Math.tan(this.gamma0))/this.bl;else{var o=W(this.e,this.lat1,Math.sin(this.lat1)),h=W(this.e,this.lat2,Math.sin(this.lat2));this.lat0>=0?this.el=(i+Math.sqrt(i*i-1))*Math.pow(s,this.bl):this.el=(i-Math.sqrt(i*i-1))*Math.pow(s,this.bl);var f=Math.pow(o,this.bl),c=Math.pow(h,this.bl);a=this.el/f,n=.5*(a-1/a);var l=(this.el*this.el-c*f)/(this.el*this.el+c*f),u=(c-f)/(c+f),m=y(this.long1-this.long2);this.long0=.5*(this.long1+this.long2)-Math.atan(l*Math.tan(.5*this.bl*m)/u)/this.bl,this.long0=y(this.long0);var d=y(this.long1-this.long0);this.gamma0=Math.atan(Math.sin(this.bl*d)/n),this.alpha=Math.asin(i*Math.sin(this.gamma0))}this.no_off?this.uc=0:this.lat0>=0?this.uc=this.al/this.bl*Math.atan2(Math.sqrt(i*i-1),Math.cos(this.alpha)):this.uc=-1*this.al/this.bl*Math.atan2(Math.sqrt(i*i-1),Math.cos(this.alpha))}function dn(t){var e=t.x,r=t.y,s=y(e-this.long0),i,a,n;if(Math.abs(Math.abs(r)-b)<=_)r>0?n=-1:n=1,a=this.al/this.bl*Math.log(Math.tan(E+n*this.gamma0*.5)),i=-1*n*b*this.al/this.bl;else{var o=W(this.e,r,Math.sin(r)),h=this.el/Math.pow(o,this.bl),f=.5*(h-1/h),c=.5*(h+1/h),l=Math.sin(this.bl*s),u=(f*Math.sin(this.gamma0)-l*Math.cos(this.gamma0))/c;Math.abs(Math.abs(u)-1)<=_?a=Number.POSITIVE_INFINITY:a=.5*this.al*Math.log((1-u)/(1+u))/this.bl,Math.abs(Math.cos(this.bl*s))<=_?i=this.al*this.bl*s:i=this.al*Math.atan2(f*Math.cos(this.gamma0)+l*Math.sin(this.gamma0),Math.cos(this.bl*s))/this.bl}return this.no_rot?(t.x=this.x0+i,t.y=this.y0+a):(i-=this.uc,t.x=this.x0+a*Math.cos(this.alpha)+i*Math.sin(this.alpha),t.y=this.y0+i*Math.cos(this.alpha)-a*Math.sin(this.alpha)),t}function mn(t){var e,r;this.no_rot?(r=t.y-this.y0,e=t.x-this.x0):(r=(t.x-this.x0)*Math.cos(this.alpha)-(t.y-this.y0)*Math.sin(this.alpha),e=(t.y-this.y0)*Math.cos(this.alpha)+(t.x-this.x0)*Math.sin(this.alpha),e+=this.uc);var s=Math.exp(-1*this.bl*r/this.al),i=.5*(s-1/s),a=.5*(s+1/s),n=Math.sin(this.bl*e/this.al),o=(n*Math.cos(this.gamma0)+i*Math.sin(this.gamma0))/a,h=Math.pow(this.el/Math.sqrt((1+o)/(1-o)),1/this.bl);return Math.abs(o-1)<_?(t.x=this.long0,t.y=b):Math.abs(o+1)<_?(t.x=this.long0,t.y=-1*b):(t.y=vt(this.e,h),t.x=y(this.long0-Math.atan2(i*Math.cos(this.gamma0)-n*Math.sin(this.gamma0),Math.cos(this.bl*e/this.al))/this.bl)),t}var pn=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","omerc"],Ss={init:un,forward:dn,inverse:mn,names:pn};function bn(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<_)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var e=Math.sin(this.lat1),r=Math.cos(this.lat1),s=k(this.e,e,r),i=W(this.e,this.lat1,e),a=Math.sin(this.lat2),n=Math.cos(this.lat2),o=k(this.e,a,n),h=W(this.e,this.lat2,a),f=W(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>_?this.ns=Math.log(s/o)/Math.log(i/h):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=s/(this.ns*Math.pow(i,this.ns)),this.rh=this.a*this.f0*Math.pow(f,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function vn(t){var e=t.x,r=t.y;Math.abs(2*Math.abs(r)-Math.PI)<=_&&(r=ut(r)*(b-2*_));var s=Math.abs(Math.abs(r)-b),i,a;if(s>_)i=W(this.e,r,Math.sin(r)),a=this.a*this.f0*Math.pow(i,this.ns);else{if(s=r*this.ns,s<=0)return null;a=0}var n=this.ns*y(e-this.long0);return t.x=this.k0*(a*Math.sin(n))+this.x0,t.y=this.k0*(this.rh-a*Math.cos(n))+this.y0,t}function _n(t){var e,r,s,i,a,n=(t.x-this.x0)/this.k0,o=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(n*n+o*o),r=1):(e=-Math.sqrt(n*n+o*o),r=-1);var h=0;if(e!==0&&(h=Math.atan2(r*n,r*o)),e!==0||this.ns>0){if(r=1/this.ns,s=Math.pow(e/(this.a*this.f0),r),i=vt(this.e,s),i===-9999)return null}else i=-b;return a=y(h/this.ns+this.long0),t.x=a,t.y=i,t}var yn=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_2SP","lcc"],As={init:bn,forward:vn,inverse:_n,names:yn};function gn(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function Mn(t){var e,r,s,i,a,n,o,h=t.x,f=t.y,c=y(h-this.long0);return e=Math.pow((1+this.e*Math.sin(f))/(1-this.e*Math.sin(f)),this.alfa*this.e/2),r=2*(Math.atan(this.k*Math.pow(Math.tan(f/2+this.s45),this.alfa)/e)-this.s45),s=-c*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(r)+Math.sin(this.ad)*Math.cos(r)*Math.cos(s)),a=Math.asin(Math.cos(r)*Math.sin(s)/Math.cos(i)),n=this.n*a,o=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(i/2+this.s45),this.n),t.y=o*Math.cos(n)/1,t.x=o*Math.sin(n)/1,this.czech||(t.y*=-1,t.x*=-1),t}function xn(t){var e,r,s,i,a,n,o,h,f=t.x;t.x=t.y,t.y=f,this.czech||(t.y*=-1,t.x*=-1),n=Math.sqrt(t.x*t.x+t.y*t.y),a=Math.atan2(t.y,t.x),i=a/Math.sin(this.s0),s=2*(Math.atan(Math.pow(this.ro0/n,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(s)-Math.sin(this.ad)*Math.cos(s)*Math.cos(i)),r=Math.asin(Math.cos(s)*Math.sin(i)/Math.cos(e)),t.x=this.long0-r/this.alfa,o=e,h=0;var c=0;do t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-t.y)<1e-10&&(h=1),o=t.y,c+=1;while(h===0&&c<15);return c>=15?null:t}var wn=["Krovak","krovak"],Ns={init:gn,forward:Mn,inverse:xn,names:wn};function z(t,e,r,s,i){return t*i-e*Math.sin(2*i)+r*Math.sin(4*i)-s*Math.sin(6*i)}function _t(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function yt(t){return .375*t*(1+.25*t*(1+.46875*t))}function gt(t){return .05859375*t*t*(1+.75*t)}function Mt(t){return t*t*t*(35/3072)}function xt(t,e,r){var s=e*r;return t/Math.sqrt(1-s*s)}function nt(t){return Math.abs(t)<b?t:t-ut(t)*Math.PI}function Rt(t,e,r,s,i){var a,n;a=t/e;for(var o=0;o<15;o++)if(n=(t-(e*a-r*Math.sin(2*a)+s*Math.sin(4*a)-i*Math.sin(6*a)))/(e-2*r*Math.cos(2*a)+4*s*Math.cos(4*a)-6*i*Math.cos(6*a)),a+=n,Math.abs(n)<=1e-10)return a;return NaN}function In(){this.sphere||(this.e0=_t(this.es),this.e1=yt(this.es),this.e2=gt(this.es),this.e3=Mt(this.es),this.ml0=this.a*z(this.e0,this.e1,this.e2,this.e3,this.lat0))}function Pn(t){var e,r,s=t.x,i=t.y;if(s=y(s-this.long0),this.sphere)e=this.a*Math.asin(Math.cos(i)*Math.sin(s)),r=this.a*(Math.atan2(Math.tan(i),Math.cos(s))-this.lat0);else{var a=Math.sin(i),n=Math.cos(i),o=xt(this.a,this.e,a),h=Math.tan(i)*Math.tan(i),f=s*Math.cos(i),c=f*f,l=this.es*n*n/(1-this.es),u=this.a*z(this.e0,this.e1,this.e2,this.e3,i);e=o*f*(1-c*h*(1/6-(8-h+8*l)*c/120)),r=u-this.ml0+o*a/n*c*(.5+(5-h+6*l)*c/24)}return t.x=e+this.x0,t.y=r+this.y0,t}function En(t){t.x-=this.x0,t.y-=this.y0;var e=t.x/this.a,r=t.y/this.a,s,i;if(this.sphere){var a=r+this.lat0;s=Math.asin(Math.sin(a)*Math.cos(e)),i=Math.atan2(Math.tan(e),Math.cos(a))}else{var n=this.ml0/this.a+r,o=Rt(n,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(o)-b)<=_)return t.x=this.long0,t.y=b,r<0&&(t.y*=-1),t;var h=xt(this.a,this.e,Math.sin(o)),f=h*h*h/this.a/this.a*(1-this.es),c=Math.pow(Math.tan(o),2),l=e*this.a/h,u=l*l;s=o-h*Math.tan(o)/f*l*l*(.5-(1+3*c)*l*l/24),i=l*(1-u*(c/3+(1+3*c)*c*u/15))/Math.cos(o)}return t.x=y(i+this.long0),t.y=nt(s),t}var Sn=["Cassini","Cassini_Soldner","cass"],Fs={init:In,forward:Pn,inverse:En,names:Sn};function ot(t,e){var r;return t>1e-7?(r=t*e,(1-t*t)*(e/(1-r*r)-.5/t*Math.log((1-r)/(1+r)))):2*e}var An=1,Nn=2,Fn=3,On=4;function Rn(){var t=Math.abs(this.lat0);if(Math.abs(t-b)<_?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(t)<_?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0){var e;switch(this.qp=ot(this.e,1),this.mmf=.5/(1-this.es),this.apa=jn(this.es),this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=ot(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function Ln(t){var e,r,s,i,a,n,o,h,f,c,l=t.x,u=t.y;if(l=y(l-this.long0),this.sphere){if(a=Math.sin(u),c=Math.cos(u),s=Math.cos(l),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(r=this.mode===this.EQUIT?1+c*s:1+this.sinph0*a+this.cosph0*c*s,r<=_)return null;r=Math.sqrt(2/r),e=r*c*Math.sin(l),r*=this.mode===this.EQUIT?a:this.cosph0*a-this.sinph0*c*s}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(s=-s),Math.abs(u+this.lat0)<_)return null;r=E-u*.5,r=2*(this.mode===this.S_POLE?Math.cos(r):Math.sin(r)),e=r*Math.sin(l),r*=s}}else{switch(o=0,h=0,f=0,s=Math.cos(l),i=Math.sin(l),a=Math.sin(u),n=ot(this.e,a),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(o=n/this.qp,h=Math.sqrt(1-o*o)),this.mode){case this.OBLIQ:f=1+this.sinb1*o+this.cosb1*h*s;break;case this.EQUIT:f=1+h*s;break;case this.N_POLE:f=b+u,n=this.qp-n;break;case this.S_POLE:f=u-b,n=this.qp+n;break}if(Math.abs(f)<_)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:f=Math.sqrt(2/f),this.mode===this.OBLIQ?r=this.ymf*f*(this.cosb1*o-this.sinb1*h*s):r=(f=Math.sqrt(2/(1+h*s)))*o*this.ymf,e=this.xmf*f*h*i;break;case this.N_POLE:case this.S_POLE:n>=0?(e=(f=Math.sqrt(n))*i,r=s*(this.mode===this.S_POLE?f:-f)):e=r=0;break}}return t.x=this.a*e+this.x0,t.y=this.a*r+this.y0,t}function Cn(t){t.x-=this.x0,t.y-=this.y0;var e=t.x/this.a,r=t.y/this.a,s,i,a,n,o,h,f;if(this.sphere){var c=0,l,u=0;if(l=Math.sqrt(e*e+r*r),i=l*.5,i>1)return null;switch(i=2*Math.asin(i),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(u=Math.sin(i),c=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(l)<=_?0:Math.asin(r*u/l),e*=u,r=c*l;break;case this.OBLIQ:i=Math.abs(l)<=_?this.lat0:Math.asin(c*this.sinph0+r*u*this.cosph0/l),e*=u*this.cosph0,r=(c-Math.sin(i)*this.sinph0)*l;break;case this.N_POLE:r=-r,i=b-i;break;case this.S_POLE:i-=b;break}s=r===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(e,r)}else{if(f=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e/=this.dd,r*=this.dd,h=Math.sqrt(e*e+r*r),h<_)return t.x=this.long0,t.y=this.lat0,t;n=2*Math.asin(.5*h/this.rq),a=Math.cos(n),e*=n=Math.sin(n),this.mode===this.OBLIQ?(f=a*this.sinb1+r*n*this.cosb1/h,o=this.qp*f,r=h*this.cosb1*a-r*this.sinb1*n):(f=r*n/h,o=this.qp*f,r=h*a)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),o=e*e+r*r,!o)return t.x=this.long0,t.y=this.lat0,t;f=1-o/this.qp,this.mode===this.S_POLE&&(f=-f)}s=Math.atan2(e,r),i=Dn(Math.asin(f),this.apa)}return t.x=y(this.long0+s),t.y=i,t}var Tn=.3333333333333333,Bn=.17222222222222222,Gn=.10257936507936508,Un=.06388888888888888,zn=.0664021164021164,qn=.016415012942191543;function jn(t){var e,r=[];return r[0]=t*Tn,e=t*t,r[0]+=e*Bn,r[1]=e*Un,e*=t,r[0]+=e*Gn,r[1]+=e*zn,r[2]=e*qn,r}function Dn(t,e){var r=t+t;return t+e[0]*Math.sin(r)+e[1]*Math.sin(r+r)+e[2]*Math.sin(r+r+r)}var kn=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],Os={init:Rn,forward:Ln,inverse:Cn,names:kn,S_POLE:An,N_POLE:Nn,EQUIT:Fn,OBLIQ:On};function $(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}function Vn(){Math.abs(this.lat1+this.lat2)<_||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=k(this.e3,this.sin_po,this.cos_po),this.qs1=ot(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=k(this.e3,this.sin_po,this.cos_po),this.qs2=ot(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=ot(this.e3,this.sin_po,this.cos_po),Math.abs(this.lat1-this.lat2)>_?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function Wn(t){var e=t.x,r=t.y;this.sin_phi=Math.sin(r),this.cos_phi=Math.cos(r);var s=ot(this.e3,this.sin_phi,this.cos_phi),i=this.a*Math.sqrt(this.c-this.ns0*s)/this.ns0,a=this.ns0*y(e-this.long0),n=i*Math.sin(a)+this.x0,o=this.rh-i*Math.cos(a)+this.y0;return t.x=n,t.y=o,t}function Hn(t){var e,r,s,i,a,n;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),s=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),s=-1),i=0,e!==0&&(i=Math.atan2(s*t.x,s*t.y)),s=e*this.ns0/this.a,this.sphere?n=Math.asin((this.c-s*s)/(2*this.ns0)):(r=(this.c-s*s)/this.ns0,n=this.phi1z(this.e3,r)),a=y(i/this.ns0+this.long0),t.x=a,t.y=n,t}function Xn(t,e){var r,s,i,a,n,o=$(.5*e);if(t<_)return o;for(var h=t*t,f=1;f<=25;f++)if(r=Math.sin(o),s=Math.cos(o),i=t*r,a=1-i*i,n=.5*a*a/s*(e/(1-h)-r/a+.5/t*Math.log((1-i)/(1+i))),o=o+n,Math.abs(n)<=1e-7)return o;return null}var Jn=["Albers_Conic_Equal_Area","Albers","aea"],Rs={init:Vn,forward:Wn,inverse:Hn,names:Jn,phi1z:Xn};function Zn(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function $n(t){var e,r,s,i,a,n,o,h,f=t.x,c=t.y;return s=y(f-this.long0),e=Math.sin(c),r=Math.cos(c),i=Math.cos(s),n=this.sin_p14*e+this.cos_p14*r*i,a=1,n>0||Math.abs(n)<=_?(o=this.x0+this.a*a*r*Math.sin(s)/n,h=this.y0+this.a*a*(this.cos_p14*e-this.sin_p14*r*i)/n):(o=this.x0+this.infinity_dist*r*Math.sin(s),h=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*r*i)),t.x=o,t.y=h,t}function Kn(t){var e,r,s,i,a,n;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(i=Math.atan2(e,this.rc),r=Math.sin(i),s=Math.cos(i),n=$(s*this.sin_p14+t.y*r*this.cos_p14/e),a=Math.atan2(t.x*r,e*this.cos_p14*s-t.y*this.sin_p14*r),a=y(this.long0+a)):(n=this.phic0,a=0),t.x=a,t.y=n,t}var Qn=["gnom"],Ls={init:Zn,forward:$n,inverse:Kn,names:Qn};function Cs(t,e){var r=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-r)<1e-6)return e<0?-1*b:b;for(var s=Math.asin(.5*e),i,a,n,o,h=0;h<30;h++)if(a=Math.sin(s),n=Math.cos(s),o=t*a,i=Math.pow(1-o*o,2)/(2*n)*(e/(1-t*t)-a/(1-o*o)+.5/t*Math.log((1-o)/(1+o))),s+=i,Math.abs(i)<=1e-10)return s;return NaN}function Yn(){this.sphere||(this.k0=k(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function to(t){var e=t.x,r=t.y,s,i,a=y(e-this.long0);if(this.sphere)s=this.x0+this.a*a*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(r)/Math.cos(this.lat_ts);else{var n=ot(this.e,Math.sin(r));s=this.x0+this.a*this.k0*a,i=this.y0+this.a*n*.5/this.k0}return t.x=s,t.y=i,t}function eo(t){t.x-=this.x0,t.y-=this.y0;var e,r;return this.sphere?(e=y(this.long0+t.x/this.a/Math.cos(this.lat_ts)),r=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(r=Cs(this.e,2*t.y*this.k0/this.a),e=y(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=r,t}var ro=["cea"],Ts={init:Yn,forward:to,inverse:eo,names:ro};function so(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function io(t){var e=t.x,r=t.y,s=y(e-this.long0),i=nt(r-this.lat0);return t.x=this.x0+this.a*s*this.rc,t.y=this.y0+this.a*i,t}function ao(t){var e=t.x,r=t.y;return t.x=y(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=nt(this.lat0+(r-this.y0)/this.a),t}var no=["Equirectangular","Equidistant_Cylindrical","eqc"],Bs={init:so,forward:io,inverse:ao,names:no};var Gs=20;function oo(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=_t(this.es),this.e1=yt(this.es),this.e2=gt(this.es),this.e3=Mt(this.es),this.ml0=this.a*z(this.e0,this.e1,this.e2,this.e3,this.lat0)}function ho(t){var e=t.x,r=t.y,s,i,a,n=y(e-this.long0);if(a=n*Math.sin(r),this.sphere)Math.abs(r)<=_?(s=this.a*n,i=-1*this.a*this.lat0):(s=this.a*Math.sin(a)/Math.tan(r),i=this.a*(nt(r-this.lat0)+(1-Math.cos(a))/Math.tan(r)));else if(Math.abs(r)<=_)s=this.a*n,i=-1*this.ml0;else{var o=xt(this.a,this.e,Math.sin(r))/Math.tan(r);s=o*Math.sin(a),i=this.a*z(this.e0,this.e1,this.e2,this.e3,r)-this.ml0+o*(1-Math.cos(a))}return t.x=s+this.x0,t.y=i+this.y0,t}function fo(t){var e,r,s,i,a,n,o,h,f;if(s=t.x-this.x0,i=t.y-this.y0,this.sphere)if(Math.abs(i+this.a*this.lat0)<=_)e=y(s/this.a+this.long0),r=0;else{n=this.lat0+i/this.a,o=s*s/this.a/this.a+n*n,h=n;var c;for(a=Gs;a;--a)if(c=Math.tan(h),f=-1*(n*(h*c+1)-h-.5*(h*h+o)*c)/((h-n)/c-1),h+=f,Math.abs(f)<=_){r=h;break}e=y(this.long0+Math.asin(s*Math.tan(h)/this.a)/Math.sin(r))}else if(Math.abs(i+this.ml0)<=_)r=0,e=y(this.long0+s/this.a);else{n=(this.ml0+i)/this.a,o=s*s/this.a/this.a+n*n,h=n;var l,u,m,d,p;for(a=Gs;a;--a)if(p=this.e*Math.sin(h),l=Math.sqrt(1-p*p)*Math.tan(h),u=this.a*z(this.e0,this.e1,this.e2,this.e3,h),m=this.e0-2*this.e1*Math.cos(2*h)+4*this.e2*Math.cos(4*h)-6*this.e3*Math.cos(6*h),d=u/this.a,f=(n*(l*d+1)-d-.5*l*(d*d+o))/(this.es*Math.sin(2*h)*(d*d+o-2*n*d)/(4*l)+(n-d)*(l*m-2/Math.sin(2*h))-m),h-=f,Math.abs(f)<=_){r=h;break}l=Math.sqrt(1-this.es*Math.pow(Math.sin(r),2))*Math.tan(r),e=y(this.long0+Math.asin(s*l/this.a)/Math.sin(r))}return t.x=e,t.y=r,t}var lo=["Polyconic","poly"],Us={init:oo,forward:ho,inverse:fo,names:lo};function co(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function uo(t){var e,r=t.x,s=t.y,i=s-this.lat0,a=r-this.long0,n=i/At*1e-5,o=a,h=1,f=0;for(e=1;e<=10;e++)h=h*n,f=f+this.A[e]*h;var c=f,l=o,u=1,m=0,d,p,v=0,g=0;for(e=1;e<=6;e++)d=u*c-m*l,p=m*c+u*l,u=d,m=p,v=v+this.B_re[e]*u-this.B_im[e]*m,g=g+this.B_im[e]*u+this.B_re[e]*m;return t.x=g*this.a+this.x0,t.y=v*this.a+this.y0,t}function mo(t){var e,r=t.x,s=t.y,i=r-this.x0,a=s-this.y0,n=a/this.a,o=i/this.a,h=1,f=0,c,l,u=0,m=0;for(e=1;e<=6;e++)c=h*n-f*o,l=f*n+h*o,h=c,f=l,u=u+this.C_re[e]*h-this.C_im[e]*f,m=m+this.C_im[e]*h+this.C_re[e]*f;for(var d=0;d<this.iterations;d++){var p=u,v=m,g,x,M=n,S=o;for(e=2;e<=6;e++)g=p*u-v*m,x=v*u+p*m,p=g,v=x,M=M+(e-1)*(this.B_re[e]*p-this.B_im[e]*v),S=S+(e-1)*(this.B_im[e]*p+this.B_re[e]*v);p=1,v=0;var I=this.B_re[1],P=this.B_im[1];for(e=2;e<=6;e++)g=p*u-v*m,x=v*u+p*m,p=g,v=x,I=I+e*(this.B_re[e]*p-this.B_im[e]*v),P=P+e*(this.B_im[e]*p+this.B_re[e]*v);var B=I*I+P*P;u=(M*I+S*P)/B,m=(S*I-M*P)/B}var N=u,Y=m,q=1,rt=0;for(e=1;e<=9;e++)q=q*N,rt=rt+this.D[e]*q;var pt=this.lat0+rt*At*1e5,se=this.long0+Y;return t.x=se,t.y=pt,t}var po=["New_Zealand_Map_Grid","nzmg"],zs={init:co,forward:uo,inverse:mo,names:po};function bo(){}function vo(t){var e=t.x,r=t.y,s=y(e-this.long0),i=this.x0+this.a*s,a=this.y0+this.a*Math.log(Math.tan(Math.PI/4+r/2.5))*1.25;return t.x=i,t.y=a,t}function _o(t){t.x-=this.x0,t.y-=this.y0;var e=y(this.long0+t.x/this.a),r=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=e,t.y=r,t}var yo=["Miller_Cylindrical","mill"],qs={init:bo,forward:vo,inverse:_o,names:yo};var go=20;function Mo(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=Fe(this.es)}function xo(t){var e,r,s=t.x,i=t.y;if(s=y(s-this.long0),this.sphere){if(!this.m)i=this.n!==1?Math.asin(this.n*Math.sin(i)):i;else for(var a=this.n*Math.sin(i),n=go;n;--n){var o=(this.m*i+Math.sin(i)-a)/(this.m+Math.cos(i));if(i-=o,Math.abs(o)<_)break}e=this.a*this.C_x*s*(this.m+Math.cos(i)),r=this.a*this.C_y*i}else{var h=Math.sin(i),f=Math.cos(i);r=this.a*Ot(i,h,f,this.en),e=this.a*s*f/Math.sqrt(1-this.es*h*h)}return t.x=e,t.y=r,t}function wo(t){var e,r,s,i;return t.x-=this.x0,s=t.x/this.a,t.y-=this.y0,e=t.y/this.a,this.sphere?(e/=this.C_y,s=s/(this.C_x*(this.m+Math.cos(e))),this.m?e=$((this.m*e+Math.sin(e))/this.n):this.n!==1&&(e=$(Math.sin(e)/this.n)),s=y(s+this.long0),e=nt(e)):(e=Oe(t.y/this.a,this.es,this.en),i=Math.abs(e),i<b?(i=Math.sin(e),r=this.long0+t.x*Math.sqrt(1-this.es*i*i)/(this.a*Math.cos(e)),s=y(r)):i-_<b&&(s=this.long0)),t.x=s,t.y=e,t}var Io=["Sinusoidal","sinu"],js={init:Mo,forward:xo,inverse:wo,names:Io};function Po(){}function Eo(t){for(var e=t.x,r=t.y,s=y(e-this.long0),i=r,a=Math.PI*Math.sin(r);;){var n=-(i+Math.sin(i)-a)/(1+Math.cos(i));if(i+=n,Math.abs(n)<_)break}i/=2,Math.PI/2-Math.abs(r)<_&&(s=0);var o=.900316316158*this.a*s*Math.cos(i)+this.x0,h=1.4142135623731*this.a*Math.sin(i)+this.y0;return t.x=o,t.y=h,t}function So(t){var e,r;t.x-=this.x0,t.y-=this.y0,r=t.y/(1.4142135623731*this.a),Math.abs(r)>.999999999999&&(r=.999999999999),e=Math.asin(r);var s=y(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));s<-Math.PI&&(s=-Math.PI),s>Math.PI&&(s=Math.PI),r=(2*e+Math.sin(2*e))/Math.PI,Math.abs(r)>1&&(r=1);var i=Math.asin(r);return t.x=s,t.y=i,t}var Ao=["Mollweide","moll"],Ds={init:Po,forward:Eo,inverse:So,names:Ao};function No(){Math.abs(this.lat1+this.lat2)<_||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=_t(this.es),this.e1=yt(this.es),this.e2=gt(this.es),this.e3=Mt(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=k(this.e,this.sinphi,this.cosphi),this.ml1=z(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<_?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=k(this.e,this.sinphi,this.cosphi),this.ml2=z(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=z(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function Fo(t){var e=t.x,r=t.y,s;if(this.sphere)s=this.a*(this.g-r);else{var i=z(this.e0,this.e1,this.e2,this.e3,r);s=this.a*(this.g-i)}var a=this.ns*y(e-this.long0),n=this.x0+s*Math.sin(a),o=this.y0+this.rh-s*Math.cos(a);return t.x=n,t.y=o,t}function Oo(t){t.x-=this.x0,t.y=this.rh-t.y+this.y0;var e,r,s,i;this.ns>=0?(r=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(r=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var a=0;if(r!==0&&(a=Math.atan2(e*t.x,e*t.y)),this.sphere)return i=y(this.long0+a/this.ns),s=nt(this.g-r/this.a),t.x=i,t.y=s,t;var n=this.g-r/this.a;return s=Rt(n,this.e0,this.e1,this.e2,this.e3),i=y(this.long0+a/this.ns),t.x=i,t.y=s,t}var Ro=["Equidistant_Conic","eqdc"],ks={init:No,forward:Fo,inverse:Oo,names:Ro};function Lo(){this.R=this.a}function Co(t){var e=t.x,r=t.y,s=y(e-this.long0),i,a;Math.abs(r)<=_&&(i=this.x0+this.R*s,a=this.y0);var n=$(2*Math.abs(r/Math.PI));(Math.abs(s)<=_||Math.abs(Math.abs(r)-b)<=_)&&(i=this.x0,r>=0?a=this.y0+Math.PI*this.R*Math.tan(.5*n):a=this.y0+Math.PI*this.R*-Math.tan(.5*n));var o=.5*Math.abs(Math.PI/s-s/Math.PI),h=o*o,f=Math.sin(n),c=Math.cos(n),l=c/(f+c-1),u=l*l,m=l*(2/f-1),d=m*m,p=Math.PI*this.R*(o*(l-d)+Math.sqrt(h*(l-d)*(l-d)-(d+h)*(u-d)))/(d+h);s<0&&(p=-p),i=this.x0+p;var v=h+l;return p=Math.PI*this.R*(m*v-o*Math.sqrt((d+h)*(h+1)-v*v))/(d+h),r>=0?a=this.y0+p:a=this.y0-p,t.x=i,t.y=a,t}function To(t){var e,r,s,i,a,n,o,h,f,c,l,u,m;return t.x-=this.x0,t.y-=this.y0,l=Math.PI*this.R,s=t.x/l,i=t.y/l,a=s*s+i*i,n=-Math.abs(i)*(1+a),o=n-2*i*i+s*s,h=-2*n+1+2*i*i+a*a,m=i*i/h+(2*o*o*o/h/h/h-9*n*o/h/h)/27,f=(n-o*o/3/h)/h,c=2*Math.sqrt(-f/3),l=3*m/f/c,Math.abs(l)>1&&(l>=0?l=1:l=-1),u=Math.acos(l)/3,t.y>=0?r=(-c*Math.cos(u+Math.PI/3)-o/3/h)*Math.PI:r=-(-c*Math.cos(u+Math.PI/3)-o/3/h)*Math.PI,Math.abs(s)<_?e=this.long0:e=y(this.long0+Math.PI*(a-1+Math.sqrt(1+2*(s*s-i*i)+a*a))/2/s),t.x=e,t.y=r,t}var Bo=["Van_der_Grinten_I","VanDerGrinten","vandg"],Vs={init:Lo,forward:Co,inverse:To,names:Bo};function Go(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)}function Uo(t){var e=t.x,r=t.y,s=Math.sin(t.y),i=Math.cos(t.y),a=y(e-this.long0),n,o,h,f,c,l,u,m,d,p,v,g,x,M,S,I,P,B,N,Y,q,rt,pt;return this.sphere?Math.abs(this.sin_p12-1)<=_?(t.x=this.x0+this.a*(b-r)*Math.sin(a),t.y=this.y0-this.a*(b-r)*Math.cos(a),t):Math.abs(this.sin_p12+1)<=_?(t.x=this.x0+this.a*(b+r)*Math.sin(a),t.y=this.y0+this.a*(b+r)*Math.cos(a),t):(B=this.sin_p12*s+this.cos_p12*i*Math.cos(a),I=Math.acos(B),P=I?I/Math.sin(I):1,t.x=this.x0+this.a*P*i*Math.sin(a),t.y=this.y0+this.a*P*(this.cos_p12*s-this.sin_p12*i*Math.cos(a)),t):(n=_t(this.es),o=yt(this.es),h=gt(this.es),f=Mt(this.es),Math.abs(this.sin_p12-1)<=_?(c=this.a*z(n,o,h,f,b),l=this.a*z(n,o,h,f,r),t.x=this.x0+(c-l)*Math.sin(a),t.y=this.y0-(c-l)*Math.cos(a),t):Math.abs(this.sin_p12+1)<=_?(c=this.a*z(n,o,h,f,b),l=this.a*z(n,o,h,f,r),t.x=this.x0+(c+l)*Math.sin(a),t.y=this.y0+(c+l)*Math.cos(a),t):(u=s/i,m=xt(this.a,this.e,this.sin_p12),d=xt(this.a,this.e,s),p=Math.atan((1-this.es)*u+this.es*m*this.sin_p12/(d*i)),v=Math.atan2(Math.sin(a),this.cos_p12*Math.tan(p)-this.sin_p12*Math.cos(a)),v===0?N=Math.asin(this.cos_p12*Math.sin(p)-this.sin_p12*Math.cos(p)):Math.abs(Math.abs(v)-Math.PI)<=_?N=-Math.asin(this.cos_p12*Math.sin(p)-this.sin_p12*Math.cos(p)):N=Math.asin(Math.sin(a)*Math.cos(p)/Math.sin(v)),g=this.e*this.sin_p12/Math.sqrt(1-this.es),x=this.e*this.cos_p12*Math.cos(v)/Math.sqrt(1-this.es),M=g*x,S=x*x,Y=N*N,q=Y*N,rt=q*N,pt=rt*N,I=m*N*(1-Y*S*(1-S)/6+q/8*M*(1-2*S)+rt/120*(S*(4-7*S)-3*g*g*(1-7*S))-pt/48*M),t.x=this.x0+I*Math.sin(v),t.y=this.y0+I*Math.cos(v),t))}function zo(t){t.x-=this.x0,t.y-=this.y0;var e,r,s,i,a,n,o,h,f,c,l,u,m,d,p,v,g,x,M,S,I,P,B,N;return this.sphere?(e=Math.sqrt(t.x*t.x+t.y*t.y),e>2*b*this.a?void 0:(r=e/this.a,s=Math.sin(r),i=Math.cos(r),a=this.long0,Math.abs(e)<=_?n=this.lat0:(n=$(i*this.sin_p12+t.y*s*this.cos_p12/e),o=Math.abs(this.lat0)-b,Math.abs(o)<=_?this.lat0>=0?a=y(this.long0+Math.atan2(t.x,-t.y)):a=y(this.long0-Math.atan2(-t.x,t.y)):a=y(this.long0+Math.atan2(t.x*s,e*this.cos_p12*i-t.y*this.sin_p12*s))),t.x=a,t.y=n,t)):(h=_t(this.es),f=yt(this.es),c=gt(this.es),l=Mt(this.es),Math.abs(this.sin_p12-1)<=_?(u=this.a*z(h,f,c,l,b),e=Math.sqrt(t.x*t.x+t.y*t.y),m=u-e,n=Rt(m/this.a,h,f,c,l),a=y(this.long0+Math.atan2(t.x,-1*t.y)),t.x=a,t.y=n,t):Math.abs(this.sin_p12+1)<=_?(u=this.a*z(h,f,c,l,b),e=Math.sqrt(t.x*t.x+t.y*t.y),m=e-u,n=Rt(m/this.a,h,f,c,l),a=y(this.long0+Math.atan2(t.x,t.y)),t.x=a,t.y=n,t):(e=Math.sqrt(t.x*t.x+t.y*t.y),v=Math.atan2(t.x,t.y),d=xt(this.a,this.e,this.sin_p12),g=Math.cos(v),x=this.e*this.cos_p12*g,M=-x*x/(1-this.es),S=3*this.es*(1-M)*this.sin_p12*this.cos_p12*g/(1-this.es),I=e/d,P=I-M*(1+M)*Math.pow(I,3)/6-S*(1+3*M)*Math.pow(I,4)/24,B=1-M*P*P/2-I*P*P*P/6,p=Math.asin(this.sin_p12*Math.cos(P)+this.cos_p12*Math.sin(P)*g),a=y(this.long0+Math.asin(Math.sin(v)*Math.sin(P)/Math.cos(p))),N=Math.sin(p),n=Math.atan2((N-this.es*B*this.sin_p12)*Math.tan(p),N*(1-this.es)),t.x=a,t.y=n,t))}var qo=["Azimuthal_Equidistant","aeqd"],Ws={init:Go,forward:Uo,inverse:zo,names:qo};function jo(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function Do(t){var e,r,s,i,a,n,o,h,f=t.x,c=t.y;return s=y(f-this.long0),e=Math.sin(c),r=Math.cos(c),i=Math.cos(s),n=this.sin_p14*e+this.cos_p14*r*i,a=1,(n>0||Math.abs(n)<=_)&&(o=this.a*a*r*Math.sin(s),h=this.y0+this.a*a*(this.cos_p14*e-this.sin_p14*r*i)),t.x=o,t.y=h,t}function ko(t){var e,r,s,i,a,n,o;return t.x-=this.x0,t.y-=this.y0,e=Math.sqrt(t.x*t.x+t.y*t.y),r=$(e/this.a),s=Math.sin(r),i=Math.cos(r),n=this.long0,Math.abs(e)<=_?(o=this.lat0,t.x=n,t.y=o,t):(o=$(i*this.sin_p14+t.y*s*this.cos_p14/e),a=Math.abs(this.lat0)-b,Math.abs(a)<=_?(this.lat0>=0?n=y(this.long0+Math.atan2(t.x,-t.y)):n=y(this.long0-Math.atan2(-t.x,t.y)),t.x=n,t.y=o,t):(n=y(this.long0+Math.atan2(t.x*s,e*this.cos_p14*i-t.y*this.sin_p14*s)),t.x=n,t.y=o,t))}var Vo=["ortho"],Hs={init:jo,forward:Do,inverse:ko,names:Vo};var R={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},A={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function Wo(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=b-E/2?this.face=R.TOP:this.lat0<=-(b-E/2)?this.face=R.BOTTOM:Math.abs(this.long0)<=E?this.face=R.FRONT:Math.abs(this.long0)<=b+E?this.face=this.long0>0?R.RIGHT:R.LEFT:this.face=R.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function Ho(t){var e={x:0,y:0},r,s,i,a,n,o,h={value:0};if(t.x-=this.long0,this.es!==0?r=Math.atan(this.one_minus_f_squared*Math.tan(t.y)):r=t.y,s=t.x,this.face===R.TOP)a=b-r,s>=E&&s<=b+E?(h.value=A.AREA_0,i=s-b):s>b+E||s<=-(b+E)?(h.value=A.AREA_1,i=s>0?s-O:s+O):s>-(b+E)&&s<=-E?(h.value=A.AREA_2,i=s+b):(h.value=A.AREA_3,i=s);else if(this.face===R.BOTTOM)a=b+r,s>=E&&s<=b+E?(h.value=A.AREA_0,i=-s+b):s<E&&s>=-E?(h.value=A.AREA_1,i=-s):s<-E&&s>=-(b+E)?(h.value=A.AREA_2,i=-s-b):(h.value=A.AREA_3,i=s>0?-s+O:-s-O);else{var f,c,l,u,m,d,p;this.face===R.RIGHT?s=Wt(s,+b):this.face===R.BACK?s=Wt(s,+O):this.face===R.LEFT&&(s=Wt(s,-b)),u=Math.sin(r),m=Math.cos(r),d=Math.sin(s),p=Math.cos(s),f=m*p,c=m*d,l=u,this.face===R.FRONT?(a=Math.acos(f),i=Be(a,l,c,h)):this.face===R.RIGHT?(a=Math.acos(c),i=Be(a,l,-f,h)):this.face===R.BACK?(a=Math.acos(-f),i=Be(a,l,-c,h)):this.face===R.LEFT?(a=Math.acos(-c),i=Be(a,l,f,h)):(a=i=0,h.value=A.AREA_0)}return o=Math.atan(12/O*(i+Math.acos(Math.sin(i)*Math.cos(E))-b)),n=Math.sqrt((1-Math.cos(a))/(Math.cos(o)*Math.cos(o))/(1-Math.cos(Math.atan(1/Math.cos(i))))),h.value===A.AREA_1?o+=b:h.value===A.AREA_2?o+=O:h.value===A.AREA_3&&(o+=1.5*O),e.x=n*Math.cos(o),e.y=n*Math.sin(o),e.x=e.x*this.a+this.x0,e.y=e.y*this.a+this.y0,t.x=e.x,t.y=e.y,t}function Xo(t){var e={lam:0,phi:0},r,s,i,a,n,o,h,f,c,l={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,s=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),r=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?l.value=A.AREA_0:t.y>=0&&t.y>=Math.abs(t.x)?(l.value=A.AREA_1,r-=b):t.x<0&&-t.x>=Math.abs(t.y)?(l.value=A.AREA_2,r=r<0?r+O:r-O):(l.value=A.AREA_3,r+=b),c=O/12*Math.tan(r),n=Math.sin(c)/(Math.cos(c)-1/Math.sqrt(2)),o=Math.atan(n),i=Math.cos(r),a=Math.tan(s),h=1-i*i*a*a*(1-Math.cos(Math.atan(1/Math.cos(o)))),h<-1?h=-1:h>1&&(h=1),this.face===R.TOP)f=Math.acos(h),e.phi=b-f,l.value===A.AREA_0?e.lam=o+b:l.value===A.AREA_1?e.lam=o<0?o+O:o-O:l.value===A.AREA_2?e.lam=o-b:e.lam=o;else if(this.face===R.BOTTOM)f=Math.acos(h),e.phi=f-b,l.value===A.AREA_0?e.lam=-o+b:l.value===A.AREA_1?e.lam=-o:l.value===A.AREA_2?e.lam=-o-b:e.lam=o<0?-o-O:-o+O;else{var u,m,d;u=h,c=u*u,c>=1?d=0:d=Math.sqrt(1-c)*Math.sin(o),c+=d*d,c>=1?m=0:m=Math.sqrt(1-c),l.value===A.AREA_1?(c=m,m=-d,d=c):l.value===A.AREA_2?(m=-m,d=-d):l.value===A.AREA_3&&(c=m,m=d,d=-c),this.face===R.RIGHT?(c=u,u=-m,m=c):this.face===R.BACK?(u=-u,m=-m):this.face===R.LEFT&&(c=u,u=m,m=-c),e.phi=Math.acos(-d)-b,e.lam=Math.atan2(m,u),this.face===R.RIGHT?e.lam=Wt(e.lam,-b):this.face===R.BACK?e.lam=Wt(e.lam,-O):this.face===R.LEFT&&(e.lam=Wt(e.lam,+b))}if(this.es!==0){var p,v,g;p=e.phi<0?1:0,v=Math.tan(e.phi),g=this.b/Math.sqrt(v*v+this.one_minus_f_squared),e.phi=Math.atan(Math.sqrt(this.a*this.a-g*g)/(this.one_minus_f*g)),p&&(e.phi=-e.phi)}return e.lam+=this.long0,t.x=e.lam,t.y=e.phi,t}function Be(t,e,r,s){var i;return t<_?(s.value=A.AREA_0,i=0):(i=Math.atan2(e,r),Math.abs(i)<=E?s.value=A.AREA_0:i>E&&i<=b+E?(s.value=A.AREA_1,i-=b):i>b+E||i<=-(b+E)?(s.value=A.AREA_2,i=i>=0?i-O:i+O):(s.value=A.AREA_3,i+=b)),i}function Wt(t,e){var r=t+e;return r<-O?r+=ne:r>+O&&(r-=ne),r}var Jo=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"],Xs={init:Wo,forward:Ho,inverse:Xo,names:Jo};var cr=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],ue=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],Js=.8487,Zs=1.3523,$s=at/5,Zo=1/$s,Ht=18,Ge=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))},$o=function(t,e){return t[1]+e*(2*t[2]+e*3*t[3])};function Ko(t,e,r,s){for(var i=e;s;--s){var a=t(i);if(i-=a,Math.abs(a)<r)break}return i}function Qo(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function Yo(t){var e=y(t.x-this.long0),r=Math.abs(t.y),s=Math.floor(r*$s);s<0?s=0:s>=Ht&&(s=Ht-1),r=at*(r-Zo*s);var i={x:Ge(cr[s],r)*e,y:Ge(ue[s],r)};return t.y<0&&(i.y=-i.y),i.x=i.x*this.a*Js+this.x0,i.y=i.y*this.a*Zs+this.y0,i}function th(t){var e={x:(t.x-this.x0)/(this.a*Js),y:Math.abs(t.y-this.y0)/(this.a*Zs)};if(e.y>=1)e.x/=cr[Ht][0],e.y=t.y<0?-b:b;else{var r=Math.floor(e.y*Ht);for(r<0?r=0:r>=Ht&&(r=Ht-1);;)if(ue[r][0]>e.y)--r;else if(ue[r+1][0]<=e.y)++r;else break;var s=ue[r],i=5*(e.y-s[0])/(ue[r+1][0]-s[0]);i=Ko(function(a){return(Ge(s,a)-e.y)/$o(s,a)},i,_,100),e.x/=Ge(cr[r],i),e.y=(5*r+i)*G,t.y<0&&(e.y=-e.y)}return e.x=y(e.x+this.long0),e}var eh=["Robinson","robin"],Ks={init:Qo,forward:Yo,inverse:th,names:eh};function rh(){this.name="geocent"}function sh(t){var e=Ee(t,this.es,this.a);return e}function ih(t){var e=Se(t,this.es,this.a,this.b);return e}var ah=["Geocentric","geocentric","geocent","Geocent"],Qs={init:rh,forward:sh,inverse:ih,names:ah};function Ys(t){t.Proj.projections.add(vs),t.Proj.projections.add(Vt),t.Proj.projections.add(ws),t.Proj.projections.add(Is),t.Proj.projections.add(Ps),t.Proj.projections.add(Es),t.Proj.projections.add(Ss),t.Proj.projections.add(As),t.Proj.projections.add(Ns),t.Proj.projections.add(Fs),t.Proj.projections.add(Os),t.Proj.projections.add(Rs),t.Proj.projections.add(Ls),t.Proj.projections.add(Ts),t.Proj.projections.add(Bs),t.Proj.projections.add(Us),t.Proj.projections.add(zs),t.Proj.projections.add(qs),t.Proj.projections.add(js),t.Proj.projections.add(Ds),t.Proj.projections.add(ks),t.Proj.projections.add(Vs),t.Proj.projections.add(Ws),t.Proj.projections.add(Hs),t.Proj.projections.add(Xs),t.Proj.projections.add(Ks),t.Proj.projections.add(Qs)}Q.defaultDatum="WGS84";Q.Proj=wt;Q.WGS84=new Q.Proj("WGS84");Q.Point=ds;Q.toPoint=Ne;Q.defs=qt;Q.transform=Ft;Q.mgrs=ls;Q.version="__VERSION__";Ys(Q);var ur=Q;var Xt=class{static defineProjectionAliases(e){let r=[];for(let s in e)r.push([s,e[s]]);ur.defs(r)}constructor({from:e="WGS84",to:r="WGS84"}){if(this._projection=ur(e,r),!this._projection)throw new Error("Invalid projection");this.project=this.project.bind(this),this.unproject=this.unproject.bind(this)}project(e){return this._projection.forward(e)}unproject(e){return this._projection.inverse(e)}};function Ue(t,e){for(let r of t)r.geometry.coordinates=ti(r.geometry.coordinates,e);return t}function ti(t,e){return nh(t)?e(t):t.map(r=>ti(r,e))}function nh(t){return Array.isArray(t)&&Number.isFinite(t[0])&&Number.isFinite(t[1])}var dt=new Int32Array(2),ze=new Float32Array(dt.buffer),qe=new Float64Array(dt.buffer),Jt=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var de;(function(t){t[t.UTF8_BYTES=1]="UTF8_BYTES",t[t.UTF16_STRING=2]="UTF16_STRING"})(de||(de={}));var H=class{constructor(e){this.bytes_=e,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(e){return new H(new Uint8Array(e))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(e){this.position_=e}capacity(){return this.bytes_.length}readInt8(e){return this.readUint8(e)<<24>>24}readUint8(e){return this.bytes_[e]}readInt16(e){return this.readUint16(e)<<16>>16}readUint16(e){return this.bytes_[e]|this.bytes_[e+1]<<8}readInt32(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24}readUint32(e){return this.readInt32(e)>>>0}readInt64(e){return BigInt.asIntN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readUint64(e){return BigInt.asUintN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readFloat32(e){return dt[0]=this.readInt32(e),ze[0]}readFloat64(e){return dt[Jt?0:1]=this.readInt32(e),dt[Jt?1:0]=this.readInt32(e+4),qe[0]}writeInt8(e,r){this.bytes_[e]=r}writeUint8(e,r){this.bytes_[e]=r}writeInt16(e,r){this.bytes_[e]=r,this.bytes_[e+1]=r>>8}writeUint16(e,r){this.bytes_[e]=r,this.bytes_[e+1]=r>>8}writeInt32(e,r){this.bytes_[e]=r,this.bytes_[e+1]=r>>8,this.bytes_[e+2]=r>>16,this.bytes_[e+3]=r>>24}writeUint32(e,r){this.bytes_[e]=r,this.bytes_[e+1]=r>>8,this.bytes_[e+2]=r>>16,this.bytes_[e+3]=r>>24}writeInt64(e,r){this.writeInt32(e,Number(BigInt.asIntN(32,r))),this.writeInt32(e+4,Number(BigInt.asIntN(32,r>>BigInt(32))))}writeUint64(e,r){this.writeUint32(e,Number(BigInt.asUintN(32,r))),this.writeUint32(e+4,Number(BigInt.asUintN(32,r>>BigInt(32))))}writeFloat32(e,r){ze[0]=r,this.writeInt32(e,dt[0])}writeFloat64(e,r){qe[0]=r,this.writeInt32(e,dt[Jt?0:1]),this.writeInt32(e+4,dt[Jt?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+4+4)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let e="";for(let r=0;r<4;r++)e+=String.fromCharCode(this.readInt8(this.position_+4+r));return e}__offset(e,r){let s=e-this.readInt32(e);return r<this.readInt16(s)?this.readInt16(s+r):0}__union(e,r){return e.bb_pos=r+this.readInt32(r),e.bb=this,e}__string(e,r){e+=this.readInt32(e);let s=this.readInt32(e);e+=4;let i=this.bytes_.subarray(e,e+s);return r===de.UTF8_BYTES?i:this.text_decoder_.decode(i)}__union_with_string(e,r){return typeof e=="string"?this.__string(r):this.__union(e,r)}__indirect(e){return e+this.readInt32(e)}__vector(e){return e+this.readInt32(e)+4}__vector_len(e){return this.readInt32(e+this.readInt32(e))}__has_identifier(e){if(e.length!=4)throw new Error("FlatBuffers: file identifier must be length "+4);for(let r=0;r<4;r++)if(e.charCodeAt(r)!=this.readInt8(this.position()+4+r))return!1;return!0}createScalarList(e,r){let s=[];for(let i=0;i<r;++i){let a=e(i);a!==null&&s.push(a)}return s}createObjList(e,r){let s=[];for(let i=0;i<r;++i){let a=e(i);a!==null&&s.push(a.unpack())}return s}};function dr(t,e){if(t===null)return null;switch(e){case GeometryType.Point:case GeometryType.MultiPoint:return hh(t);case GeometryType.LineString:case GeometryType.MultiLineString:return fh(t);case GeometryType.Polygon:return ri(t);case GeometryType.MultiPolygon:return lh(t);default:throw new Error(`Unimplemented geometry type: ${e}`)}}function hh(t){let e=t.xyArray(),r=t.zArray();return{positions:mr(e,r)}}function fh(t){let e=t.xyArray(),r=t.zArray(),s=mr(e,r),i=t.endsArray()&&Array.from(t.endsArray())||[e.length/2];i.unshift(0);let a={value:new Uint16Array(i),size:1};return{positions:s,pathIndices:a}}function ri(t){let e=t.xyArray(),r=t.zArray(),s=mr(e,r),i=t.endsArray()&&Array.from(t.endsArray())||[e.length/2];i.unshift(0);let a={value:new Uint16Array(i),size:1},n={value:new Uint16Array([0,e.length/2]),size:1};return{positions:s,primitivePolygonIndices:a,polygonIndices:n}}function lh(t){let e=[],r=0,s=1,i=1;for(let u=0;u<t.partsLength();u++){let m=t.parts(u),d=ri(m);r+=d.positions.value.length,s+=d.primitivePolygonIndices.value.length-1,i+=d.polygonIndices.value.length-1,e.push(d)}let a=new Float64Array(r),n=new Uint32Array(s),o=new Uint32Array(i),h=0,f=1,c=1,l=e[0].positions.size;for(let u of e)a.set(u.positions.value,h*l),n.set(u.primitivePolygonIndices.value.subarray(1).map(m=>m+h),f),o.set(u.polygonIndices.value.subarray(1).map(m=>m+h),c),h+=u.positions.value.length/l,f+=u.primitivePolygonIndices.value.length-1,c+=u.polygonIndices.value.length-1;return{positions:{value:a,size:l},primitivePolygonIndices:{value:n,size:1},polygonIndices:{value:o,size:1}}}function mr(t,e){if(!e)return{value:t,size:2};if(e.length*2!==t.length)throw new Error("Z array must be half XY array's length");let r=t.length+e.length,s=new Float64Array(r);for(let i=0;i<t.length/2;i++)s[i*3+0]=t[i*2+0],s[i*3+1]=t[i*2+1],s[i*3+2]=e[i];return{value:s,size:3}}function si(t){let e={title:t.title||"",description:t.description||"",crs:JSON.stringify(t.crs)||"",metadata:t.metadata||"",geometryType:String(t.geometryType),indexNodeSize:String(t.indexNodeSize),featureCount:String(t.featuresCount),bounds:t.envelope?.join(",")||""},r=t.columns?.map(s=>ch(s))||[];return{metadata:e,fields:r}}function ch(t){let e={title:t.title||"",description:t.description||"",width:String(t.width),precision:String(t.precision),scale:String(t.scale),unique:String(t.unique),primary_key:String(t.primary_key)};return{name:t.name,type:uh(t.type),nullable:t.nullable,metadata:e}}var D;(function(t){t[t.Byte=0]="Byte",t[t.UByte=1]="UByte",t[t.Bool=2]="Bool",t[t.Short=3]="Short",t[t.UShort=4]="UShort",t[t.Int=5]="Int",t[t.UInt=6]="UInt",t[t.Long=7]="Long",t[t.ULong=8]="ULong",t[t.Float=9]="Float",t[t.Double=10]="Double",t[t.String=11]="String",t[t.Json=12]="Json",t[t.DateTime=13]="DateTime",t[t.Binary=14]="Binary"})(D||(D={}));function uh(t){switch(t){case D.Byte:return"int8";case D.UByte:return"uint8";case D.Bool:return"bool";case D.Short:return"int16";case D.UShort:return"uint16";case D.Int:return"int32";case D.UInt:return"uint32";case D.Long:return"int64";case D.ULong:return"uint64";case D.Float:return"float32";case D.Double:return"float64";case D.String:return"utf8";case D.Json:return"null";case D.DateTime:return"date-millisecond";case D.Binary:return"binary";default:return"null"}}var C;(function(t){t[t.Unknown=0]="Unknown",t[t.Point=1]="Point",t[t.LineString=2]="LineString",t[t.Polygon=3]="Polygon",t[t.MultiPoint=4]="MultiPoint",t[t.MultiLineString=5]="MultiLineString",t[t.MultiPolygon=6]="MultiPolygon",t[t.GeometryCollection=7]="GeometryCollection",t[t.CircularString=8]="CircularString",t[t.CompoundCurve=9]="CompoundCurve",t[t.CurvePolygon=10]="CurvePolygon",t[t.MultiCurve=11]="MultiCurve",t[t.MultiSurface=12]="MultiSurface",t[t.Curve=13]="Curve",t[t.Surface=14]="Surface",t[t.PolyhedralSurface=15]="PolyhedralSurface",t[t.TIN=16]="TIN",t[t.Triangle=17]="Triangle"})(C||(C={}));var j=class{bb=null;bb_pos=0;__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsGeometry(e,r){return(r||new j).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsGeometry(e,r){return e.setPosition(e.position()+4),(r||new j).__init(e.readInt32(e.position())+e.position(),e)}ends(e){let r=this.bb.__offset(this.bb_pos,4);return r?this.bb.readUint32(this.bb.__vector(this.bb_pos+r)+e*4):0}endsLength(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__vector_len(this.bb_pos+e):0}endsArray(){let e=this.bb.__offset(this.bb_pos,4);return e?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}xy(e){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.readFloat64(this.bb.__vector(this.bb_pos+r)+e*8):0}xyLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}xyArray(){let e=this.bb.__offset(this.bb_pos,6);return e?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}z(e){let r=this.bb.__offset(this.bb_pos,8);return r?this.bb.readFloat64(this.bb.__vector(this.bb_pos+r)+e*8):0}zLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}zArray(){let e=this.bb.__offset(this.bb_pos,8);return e?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}m(e){let r=this.bb.__offset(this.bb_pos,10);return r?this.bb.readFloat64(this.bb.__vector(this.bb_pos+r)+e*8):0}mLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}mArray(){let e=this.bb.__offset(this.bb_pos,10);return e?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}t(e){let r=this.bb.__offset(this.bb_pos,12);return r?this.bb.readFloat64(this.bb.__vector(this.bb_pos+r)+e*8):0}tLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}tArray(){let e=this.bb.__offset(this.bb_pos,12);return e?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}tm(e){let r=this.bb.__offset(this.bb_pos,14);return r?this.bb.readUint64(this.bb.__vector(this.bb_pos+r)+e*8):BigInt(0)}tmLength(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}type(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.readUint8(this.bb_pos+e):C.Unknown}parts(e,r){let s=this.bb.__offset(this.bb_pos,18);return s?(r||new j).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+s)+e*4),this.bb):null}partsLength(){let e=this.bb.__offset(this.bb_pos,18);return e?this.bb.__vector_len(this.bb_pos+e):0}static startGeometry(e){e.startObject(8)}static addEnds(e,r){e.addFieldOffset(0,r,0)}static createEndsVector(e,r){e.startVector(4,r.length,4);for(let s=r.length-1;s>=0;s--)e.addInt32(r[s]);return e.endVector()}static startEndsVector(e,r){e.startVector(4,r,4)}static addXy(e,r){e.addFieldOffset(1,r,0)}static createXyVector(e,r){e.startVector(8,r.length,8);for(let s=r.length-1;s>=0;s--)e.addFloat64(r[s]);return e.endVector()}static startXyVector(e,r){e.startVector(8,r,8)}static addZ(e,r){e.addFieldOffset(2,r,0)}static createZVector(e,r){e.startVector(8,r.length,8);for(let s=r.length-1;s>=0;s--)e.addFloat64(r[s]);return e.endVector()}static startZVector(e,r){e.startVector(8,r,8)}static addM(e,r){e.addFieldOffset(3,r,0)}static createMVector(e,r){e.startVector(8,r.length,8);for(let s=r.length-1;s>=0;s--)e.addFloat64(r[s]);return e.endVector()}static startMVector(e,r){e.startVector(8,r,8)}static addT(e,r){e.addFieldOffset(4,r,0)}static createTVector(e,r){e.startVector(8,r.length,8);for(let s=r.length-1;s>=0;s--)e.addFloat64(r[s]);return e.endVector()}static startTVector(e,r){e.startVector(8,r,8)}static addTm(e,r){e.addFieldOffset(5,r,0)}static createTmVector(e,r){e.startVector(8,r.length,8);for(let s=r.length-1;s>=0;s--)e.addInt64(r[s]);return e.endVector()}static startTmVector(e,r){e.startVector(8,r,8)}static addType(e,r){e.addFieldInt8(6,r,C.Unknown)}static addParts(e,r){e.addFieldOffset(7,r,0)}static createPartsVector(e,r){e.startVector(4,r.length,4);for(let s=r.length-1;s>=0;s--)e.addOffset(r[s]);return e.endVector()}static startPartsVector(e,r){e.startVector(4,r,4)}static endGeometry(e){return e.endObject()}static createGeometry(e,r,s,i,a,n,o,h,f){return j.startGeometry(e),j.addEnds(e,r),j.addXy(e,s),j.addZ(e,i),j.addM(e,a),j.addT(e,n),j.addTm(e,o),j.addType(e,h),j.addParts(e,f),j.endGeometry(e)}};function je(t,e){let r=[];for(let s=0;s<t.length;s+=2){let i=[t[s],t[s+1]];e&&i.push(e[s>>1]),r.push(i)}return r}function ii(t,e,r){if(!r||r.length===0)return[je(t,e)];let s=0,i=Array.from(r).map(n=>t.slice(s,s=n<<1)),a;return e&&(s=0,a=Array.from(r).map(n=>e.slice(s,s=n))),i.map((n,o)=>je(n,a?a[o]:void 0))}function dh(t,e){let r=t.xyArray(),s=t.zArray();switch(e){case C.Point:{let i=Array.from(r);return s&&i.push(s[0]),i}case C.MultiPoint:case C.LineString:return je(r,s);case C.MultiLineString:return ii(r,s,t.endsArray());case C.Polygon:return ii(r,s,t.endsArray())}}function De(t,e){let r=e;if(r===C.Unknown&&(r=t.type()),r===C.GeometryCollection){let i=[];for(let a=0;a<t.partsLength();a++){let n=t.parts(a),o=n.type();i.push(De(n,o))}return{type:C[r],geometries:i}}else if(r===C.MultiPolygon){let i=[];for(let a=0;a<t.partsLength();a++)i.push(De(t.parts(a),C.Polygon));return{type:C[r],coordinates:i.map(a=>a.coordinates)}}let s=dh(t,r);return{type:C[r],coordinates:s}}var T;(function(t){t[t.Byte=0]="Byte",t[t.UByte=1]="UByte",t[t.Bool=2]="Bool",t[t.Short=3]="Short",t[t.UShort=4]="UShort",t[t.Int=5]="Int",t[t.UInt=6]="UInt",t[t.Long=7]="Long",t[t.ULong=8]="ULong",t[t.Float=9]="Float",t[t.Double=10]="Double",t[t.String=11]="String",t[t.Json=12]="Json",t[t.DateTime=13]="DateTime",t[t.Binary=14]="Binary"})(T||(T={}));var L=class{bb=null;bb_pos=0;__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsColumn(e,r){return(r||new L).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsColumn(e,r){return e.setPosition(e.position()+4),(r||new L).__init(e.readInt32(e.position())+e.position(),e)}name(e){let r=this.bb.__offset(this.bb_pos,4);return r?this.bb.__string(this.bb_pos+r,e):null}type(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):T.Byte}title(e){let r=this.bb.__offset(this.bb_pos,8);return r?this.bb.__string(this.bb_pos+r,e):null}description(e){let r=this.bb.__offset(this.bb_pos,10);return r?this.bb.__string(this.bb_pos+r,e):null}width(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readInt32(this.bb_pos+e):-1}precision(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.readInt32(this.bb_pos+e):-1}scale(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.readInt32(this.bb_pos+e):-1}nullable(){let e=this.bb.__offset(this.bb_pos,18);return e?Boolean(this.bb.readInt8(this.bb_pos+e)):!0}unique(){let e=this.bb.__offset(this.bb_pos,20);return e?Boolean(this.bb.readInt8(this.bb_pos+e)):!1}primaryKey(){let e=this.bb.__offset(this.bb_pos,22);return e?Boolean(this.bb.readInt8(this.bb_pos+e)):!1}metadata(e){let r=this.bb.__offset(this.bb_pos,24);return r?this.bb.__string(this.bb_pos+r,e):null}static startColumn(e){e.startObject(11)}static addName(e,r){e.addFieldOffset(0,r,0)}static addType(e,r){e.addFieldInt8(1,r,T.Byte)}static addTitle(e,r){e.addFieldOffset(2,r,0)}static addDescription(e,r){e.addFieldOffset(3,r,0)}static addWidth(e,r){e.addFieldInt32(4,r,-1)}static addPrecision(e,r){e.addFieldInt32(5,r,-1)}static addScale(e,r){e.addFieldInt32(6,r,-1)}static addNullable(e,r){e.addFieldInt8(7,Number(r),Number(!0))}static addUnique(e,r){e.addFieldInt8(8,Number(r),Number(!1))}static addPrimaryKey(e,r){e.addFieldInt8(9,Number(r),Number(!1))}static addMetadata(e,r){e.addFieldOffset(10,r,0)}static endColumn(e){let r=e.endObject();return e.requiredField(r,4),r}static createColumn(e,r,s,i,a,n,o,h,f,c,l,u){return L.startColumn(e),L.addName(e,r),L.addType(e,s),L.addTitle(e,i),L.addDescription(e,a),L.addWidth(e,n),L.addPrecision(e,o),L.addScale(e,h),L.addNullable(e,f),L.addUnique(e,c),L.addPrimaryKey(e,l),L.addMetadata(e,u),L.endColumn(e)}};var X=class{bb=null;bb_pos=0;__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsFeature(e,r){return(r||new X).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFeature(e,r){return e.setPosition(e.position()+4),(r||new X).__init(e.readInt32(e.position())+e.position(),e)}geometry(e){let r=this.bb.__offset(this.bb_pos,4);return r?(e||new j).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}properties(e){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.readUint8(this.bb.__vector(this.bb_pos+r)+e):0}propertiesLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}propertiesArray(){let e=this.bb.__offset(this.bb_pos,6);return e?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}columns(e,r){let s=this.bb.__offset(this.bb_pos,8);return s?(r||new L).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+s)+e*4),this.bb):null}columnsLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}static startFeature(e){e.startObject(3)}static addGeometry(e,r){e.addFieldOffset(0,r,0)}static addProperties(e,r){e.addFieldOffset(1,r,0)}static createPropertiesVector(e,r){e.startVector(1,r.length,1);for(let s=r.length-1;s>=0;s--)e.addInt8(r[s]);return e.endVector()}static startPropertiesVector(e,r){e.startVector(1,r,1)}static addColumns(e,r){e.addFieldOffset(2,r,0)}static createColumnsVector(e,r){e.startVector(4,r.length,4);for(let s=r.length-1;s>=0;s--)e.addOffset(r[s]);return e.endVector()}static startColumnsVector(e,r){e.startVector(4,r,4)}static endFeature(e){return e.endObject()}static finishFeatureBuffer(e,r){e.finish(r)}static finishSizePrefixedFeatureBuffer(e,r){e.finish(r,void 0,!0)}static createFeature(e,r,s,i){return X.startFeature(e),X.addGeometry(e,r),X.addProperties(e,s),X.addColumns(e,i),X.endFeature(e)}};var em=new TextEncoder,ai=new TextDecoder;function ke(t,e){let r={};if(!e||e.length===0)return r;let s=t.propertiesArray();if(!s)return r;let i=new DataView(s.buffer,s.byteOffset),a=t.propertiesLength(),n=0;for(;n<a;){let o=i.getUint16(n,!0);n+=2;let h=e[o],f=h.name;switch(h.type){case T.Bool:{r[f]=Boolean(i.getUint8(n)),n+=1;break}case T.Byte:{r[f]=i.getInt8(n),n+=1;break}case T.UByte:{r[f]=i.getUint8(n),n+=1;break}case T.Short:{r[f]=i.getInt16(n,!0),n+=2;break}case T.UShort:{r[f]=i.getUint16(n,!0),n+=2;break}case T.Int:{r[f]=i.getInt32(n,!0),n+=4;break}case T.UInt:{r[f]=i.getUint32(n,!0),n+=4;break}case T.Long:{r[f]=Number(i.getBigInt64(n,!0)),n+=8;break}case T.ULong:{r[f]=Number(i.getBigUint64(n,!0)),n+=8;break}case T.Float:{r[f]=i.getFloat32(n,!0),n+=4;break}case T.Double:{r[f]=i.getFloat64(n,!0),n+=8;break}case T.DateTime:case T.String:{let c=i.getUint32(n,!0);n+=4,r[f]=ai.decode(s.subarray(n,n+c)),n+=c;break}case T.Json:{let c=i.getUint32(n,!0);n+=4;let l=ai.decode(s.subarray(n,n+c));r[f]=JSON.parse(l),n+=c;break}default:throw new Error(`Unknown type ${h.type}`)}}return r}function Ve(t,e){let r=e.columns;return{type:"Feature",geometry:De(t.geometry(),e.geometryType),properties:ke(t,r)}}var Zt=new Uint8Array(0);function ni(){return this._source.cancel()}function pr(t,e){if(!t.length)return e;if(!e.length)return t;var r=new Uint8Array(t.length+e.length);return r.set(t),r.set(e,t.length),r}function oi(){var t=this,e=t._array.subarray(t._index);return t._source.read().then(function(r){return t._array=Zt,t._index=0,r.done?e.length>0?{done:!1,value:e}:{done:!0,value:void 0}:{done:!1,value:pr(e,r.value)}})}function hi(t){if((t|=0)<0)throw new Error("invalid length");var e=this,r=this._array.length-this._index;if(this._index+t<=this._array.length)return Promise.resolve(this._array.subarray(this._index,this._index+=t));var s=new Uint8Array(t);return s.set(this._array.subarray(this._index)),function i(){return e._source.read().then(function(a){return a.done?(e._array=Zt,e._index=0,r>0?s.subarray(0,r):null):r+a.value.length>=t?(e._array=a.value,e._index=t-r,s.set(a.value.subarray(0,t-r),r),s):(s.set(a.value,r),r+=a.value.length,i())})}()}function br(t){return typeof t.slice=="function"?t:new We(typeof t.read=="function"?t:t.getReader())}function We(t){this._source=t,this._array=Zt,this._index=0}We.prototype.read=oi;We.prototype.slice=hi;We.prototype.cancel=ni;var J=class{bb=null;bb_pos=0;__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsCrs(e,r){return(r||new J).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsCrs(e,r){return e.setPosition(e.position()+4),(r||new J).__init(e.readInt32(e.position())+e.position(),e)}org(e){let r=this.bb.__offset(this.bb_pos,4);return r?this.bb.__string(this.bb_pos+r,e):null}code(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):0}name(e){let r=this.bb.__offset(this.bb_pos,8);return r?this.bb.__string(this.bb_pos+r,e):null}description(e){let r=this.bb.__offset(this.bb_pos,10);return r?this.bb.__string(this.bb_pos+r,e):null}wkt(e){let r=this.bb.__offset(this.bb_pos,12);return r?this.bb.__string(this.bb_pos+r,e):null}codeString(e){let r=this.bb.__offset(this.bb_pos,14);return r?this.bb.__string(this.bb_pos+r,e):null}static startCrs(e){e.startObject(6)}static addOrg(e,r){e.addFieldOffset(0,r,0)}static addCode(e,r){e.addFieldInt32(1,r,0)}static addName(e,r){e.addFieldOffset(2,r,0)}static addDescription(e,r){e.addFieldOffset(3,r,0)}static addWkt(e,r){e.addFieldOffset(4,r,0)}static addCodeString(e,r){e.addFieldOffset(5,r,0)}static endCrs(e){return e.endObject()}static createCrs(e,r,s,i,a,n,o){return J.startCrs(e),J.addOrg(e,r),J.addCode(e,s),J.addName(e,i),J.addDescription(e,a),J.addWkt(e,n),J.addCodeString(e,o),J.endCrs(e)}};var Tt=class{bb=null;bb_pos=0;__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsHeader(e,r){return(r||new Tt).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsHeader(e,r){return e.setPosition(e.position()+4),(r||new Tt).__init(e.readInt32(e.position())+e.position(),e)}name(e){let r=this.bb.__offset(this.bb_pos,4);return r?this.bb.__string(this.bb_pos+r,e):null}envelope(e){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.readFloat64(this.bb.__vector(this.bb_pos+r)+e*8):0}envelopeLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}envelopeArray(){let e=this.bb.__offset(this.bb_pos,6);return e?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}geometryType(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readUint8(this.bb_pos+e):C.Unknown}hasZ(){let e=this.bb.__offset(this.bb_pos,10);return e?Boolean(this.bb.readInt8(this.bb_pos+e)):!1}hasM(){let e=this.bb.__offset(this.bb_pos,12);return e?Boolean(this.bb.readInt8(this.bb_pos+e)):!1}hasT(){let e=this.bb.__offset(this.bb_pos,14);return e?Boolean(this.bb.readInt8(this.bb_pos+e)):!1}hasTm(){let e=this.bb.__offset(this.bb_pos,16);return e?Boolean(this.bb.readInt8(this.bb_pos+e)):!1}columns(e,r){let s=this.bb.__offset(this.bb_pos,18);return s?(r||new L).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+s)+e*4),this.bb):null}columnsLength(){let e=this.bb.__offset(this.bb_pos,18);return e?this.bb.__vector_len(this.bb_pos+e):0}featuresCount(){let e=this.bb.__offset(this.bb_pos,20);return e?this.bb.readUint64(this.bb_pos+e):BigInt("0")}indexNodeSize(){let e=this.bb.__offset(this.bb_pos,22);return e?this.bb.readUint16(this.bb_pos+e):16}crs(e){let r=this.bb.__offset(this.bb_pos,24);return r?(e||new J).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}title(e){let r=this.bb.__offset(this.bb_pos,26);return r?this.bb.__string(this.bb_pos+r,e):null}description(e){let r=this.bb.__offset(this.bb_pos,28);return r?this.bb.__string(this.bb_pos+r,e):null}metadata(e){let r=this.bb.__offset(this.bb_pos,30);return r?this.bb.__string(this.bb_pos+r,e):null}static startHeader(e){e.startObject(14)}static addName(e,r){e.addFieldOffset(0,r,0)}static addEnvelope(e,r){e.addFieldOffset(1,r,0)}static createEnvelopeVector(e,r){e.startVector(8,r.length,8);for(let s=r.length-1;s>=0;s--)e.addFloat64(r[s]);return e.endVector()}static startEnvelopeVector(e,r){e.startVector(8,r,8)}static addGeometryType(e,r){e.addFieldInt8(2,r,C.Unknown)}static addHasZ(e,r){e.addFieldInt8(3,Number(r),Number(!1))}static addHasM(e,r){e.addFieldInt8(4,Number(r),Number(!1))}static addHasT(e,r){e.addFieldInt8(5,Number(r),Number(!1))}static addHasTm(e,r){e.addFieldInt8(6,Number(r),Number(!1))}static addColumns(e,r){e.addFieldOffset(7,r,0)}static createColumnsVector(e,r){e.startVector(4,r.length,4);for(let s=r.length-1;s>=0;s--)e.addOffset(r[s]);return e.endVector()}static startColumnsVector(e,r){e.startVector(4,r,4)}static addFeaturesCount(e,r){e.addFieldInt64(8,r,BigInt("0"))}static addIndexNodeSize(e,r){e.addFieldInt16(9,r,16)}static addCrs(e,r){e.addFieldOffset(10,r,0)}static addTitle(e,r){e.addFieldOffset(11,r,0)}static addDescription(e,r){e.addFieldOffset(12,r,0)}static addMetadata(e,r){e.addFieldOffset(13,r,0)}static endHeader(e){return e.endObject()}static finishHeaderBuffer(e,r){e.finish(r)}static finishSizePrefixedHeaderBuffer(e,r){e.finish(r,void 0,!0)}};function me(t){let e=Tt.getRootAsHeader(t),r=e.featuresCount(),s=e.indexNodeSize(),i=[];for(let h=0;h<e.columnsLength();h++){let f=e.columns(h);if(!f)throw new Error("Column unexpectedly missing");if(!f.name())throw new Error("Column name unexpectedly missing");i.push({name:f.name(),type:f.type(),title:f.title(),description:f.description(),width:f.width(),precision:f.precision(),scale:f.scale(),nullable:f.nullable(),unique:f.unique(),primary_key:f.primaryKey()})}let a=e.crs(),n=a?{org:a.org(),code:a.code(),name:a.name(),description:a.description(),wkt:a.wkt(),code_string:a.codeString()}:null;return{geometryType:e.geometryType(),columns:i,envelope:null,featuresCount:Number(r),indexNodeSize:s,crs:n,title:e.title(),description:e.description(),metadata:e.metadata()}}var _r=function(t,e){return _r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)s.hasOwnProperty(i)&&(r[i]=s[i])},_r(t,e)};function mh(t,e){_r(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function Kt(t,e,r,s){function i(a){return a instanceof r?a:new r(function(n){n(a)})}return new(r||(r=Promise))(function(a,n){function o(c){try{f(s.next(c))}catch(l){n(l)}}function h(c){try{f(s.throw(c))}catch(l){n(l)}}function f(c){c.done?a(c.value):i(c.value).then(o,h)}f((s=s.apply(t,e||[])).next())})}function Pt(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},s,i,a,n;return n={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(n[Symbol.iterator]=function(){return this}),n;function o(f){return function(c){return h([f,c])}}function h(f){if(s)throw new TypeError("Generator is already executing.");for(;r;)try{if(s=1,i&&(a=f[0]&2?i.return:f[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,f[1])).done)return a;switch(i=0,a&&(f=[f[0]&2,a.value]),f[0]){case 0:case 1:a=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!a||f[1]>a[0]&&f[1]<a[3])){r.label=f[1];break}if(f[0]===6&&r.label<a[1]){r.label=a[1],a=f;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(f);break}a[2]&&r.ops.pop(),r.trys.pop();continue}f=e.call(t,r)}catch(c){f=[6,c],i=0}finally{s=a=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function Qt(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],s=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&s>=t.length&&(t=void 0),{value:t&&t[s++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function be(t){return this instanceof be?(this.v=t,this):new be(t)}function ph(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=r.apply(t,e||[]),i,a=[];return i={},n("next"),n("throw"),n("return"),i[Symbol.asyncIterator]=function(){return this},i;function n(u){s[u]&&(i[u]=function(m){return new Promise(function(d,p){a.push([u,m,d,p])>1||o(u,m)})})}function o(u,m){try{h(s[u](m))}catch(d){l(a[0][3],d)}}function h(u){u.value instanceof be?Promise.resolve(u.value.v).then(f,c):l(a[0][2],u)}function f(u){o("next",u)}function c(u){o("throw",u)}function l(u,m){u(m),a.shift(),a.length&&o(a[0][0],a[0][1])}}var ci=function(t){mh(e,t);function e(r){var s=t.call(this,r)||this;return Object.defineProperty(s,"name",{value:"RepeaterOverflowError",enumerable:!1}),typeof Object.setPrototypeOf=="function"?Object.setPrototypeOf(s,s.constructor.prototype):s.__proto__=s.constructor.prototype,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(s,s.constructor),s}return e}(Error),Em=function(){function t(e){if(e<0)throw new RangeError("Capacity may not be less than 0");this._c=e,this._q=[]}return Object.defineProperty(t.prototype,"empty",{get:function(){return this._q.length===0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"full",{get:function(){return this._q.length>=this._c},enumerable:!1,configurable:!0}),t.prototype.add=function(e){if(this.full)throw new Error("Buffer full");this._q.push(e)},t.prototype.remove=function(){if(this.empty)throw new Error("Buffer empty");return this._q.shift()},t}(),Sm=function(){function t(e){if(e<1)throw new RangeError("Capacity may not be less than 1");this._c=e,this._q=[]}return Object.defineProperty(t.prototype,"empty",{get:function(){return this._q.length===0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"full",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype.add=function(e){for(;this._q.length>=this._c;)this._q.shift();this._q.push(e)},t.prototype.remove=function(){if(this.empty)throw new Error("Buffer empty");return this._q.shift()},t}(),Am=function(){function t(e){if(e<1)throw new RangeError("Capacity may not be less than 1");this._c=e,this._q=[]}return Object.defineProperty(t.prototype,"empty",{get:function(){return this._q.length===0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"full",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype.add=function(e){this._q.length<this._c&&this._q.push(e)},t.prototype.remove=function(){if(this.empty)throw new Error("Buffer empty");return this._q.shift()},t}();function yr(t){t!=null&&typeof t.then=="function"&&t.then(Ze,Ze)}var vr=0,fi=1,Gt=2,Xe=3,gr=4,Je=1024,Ze=function(){};function $t(t){var e=t.err,r=Promise.resolve(t.execution).then(function(s){if(e!=null)throw e;return s});return t.err=void 0,t.execution=r.then(function(){},function(){}),t.pending===void 0?r:t.pending.then(function(){return r})}function Bt(t,e){var r=t.state>=Xe;return Promise.resolve(e).then(function(s){return!r&&t.state>=gr?$t(t).then(function(i){return{value:i,done:!0}}):{value:s,done:r}})}function Mr(t,e){var r,s;if(!(t.state>=Gt))if(t.state=Gt,t.onnext(),t.onstop(),t.err==null&&(t.err=e),t.pushes.length===0&&(typeof t.buffer>"u"||t.buffer.empty))pe(t);else try{for(var i=Qt(t.pushes),a=i.next();!a.done;a=i.next()){var n=a.value;n.resolve()}}catch(o){r={error:o}}finally{try{a&&!a.done&&(s=i.return)&&s.call(i)}finally{if(r)throw r.error}}}function pe(t){var e,r;if(!(t.state>=Xe)){t.state<Gt&&Mr(t),t.state=Xe,t.buffer=void 0;try{for(var s=Qt(t.nexts),i=s.next();!i.done;i=s.next()){var a=i.value,n=t.pending===void 0?$t(t):t.pending.then(function(){return $t(t)});a.resolve(Bt(t,n))}}catch(o){e={error:o}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}t.pushes=[],t.nexts=[]}}function li(t){t.state>=gr||(t.state<Xe&&pe(t),t.state=gr)}function bh(t,e){if(yr(e),t.pushes.length>=Je)throw new ci("No more than "+Je+" pending calls to push are allowed on a single repeater.");if(t.state>=Gt)return Promise.resolve(void 0);var r=t.pending===void 0?Promise.resolve(e):t.pending.then(function(){return e});r=r.catch(function(h){t.state<Gt&&(t.err=h),li(t)});var s;if(t.nexts.length){var i=t.nexts.shift();i.resolve(Bt(t,r)),t.nexts.length?s=Promise.resolve(t.nexts[0].value):s=new Promise(function(h){return t.onnext=h})}else typeof t.buffer<"u"&&!t.buffer.full?(t.buffer.add(r),s=Promise.resolve(void 0)):s=new Promise(function(h){return t.pushes.push({resolve:h,value:r})});var a=!0,n={},o=s.catch(function(h){if(a)throw h});return n.then=function(h,f){return a=!1,Promise.prototype.then.call(s,h,f)},n.catch=function(h){return a=!1,Promise.prototype.catch.call(s,h)},n.finally=s.finally.bind(s),t.pending=r.then(function(){return o}).catch(function(h){t.err=h,li(t)}),n}function vh(t){var e=Mr.bind(null,t),r=new Promise(function(s){return t.onstop=s});return e.then=r.then.bind(r),e.catch=r.catch.bind(r),e.finally=r.finally.bind(r),e}function _h(t){if(!(t.state>=fi)){t.state=fi;var e=bh.bind(null,t),r=vh(t);t.execution=new Promise(function(s){return s(t.executor(e,r))}),t.execution.catch(function(){return Mr(t)})}}var He=new WeakMap,Yt=function(){function t(e,r){He.set(this,{executor:e,buffer:r,err:void 0,state:vr,pushes:[],nexts:[],pending:void 0,execution:void 0,onnext:Ze,onstop:Ze})}return t.prototype.next=function(e){yr(e);var r=He.get(this);if(r===void 0)throw new Error("WeakMap error");if(r.nexts.length>=Je)throw new ci("No more than "+Je+" pending calls to next are allowed on a single repeater.");if(r.state<=vr&&_h(r),r.onnext(e),typeof r.buffer<"u"&&!r.buffer.empty){var s=Bt(r,r.buffer.remove());if(r.pushes.length){var i=r.pushes.shift();r.buffer.add(i.value),r.onnext=i.resolve}return s}else if(r.pushes.length){var a=r.pushes.shift();return r.onnext=a.resolve,Bt(r,a.value)}else if(r.state>=Gt)return pe(r),Bt(r,$t(r));return new Promise(function(n){return r.nexts.push({resolve:n,value:e})})},t.prototype.return=function(e){yr(e);var r=He.get(this);if(r===void 0)throw new Error("WeakMap error");return pe(r),r.execution=Promise.resolve(r.execution).then(function(){return e}),Bt(r,$t(r))},t.prototype.throw=function(e){var r=He.get(this);if(r===void 0)throw new Error("WeakMap error");return r.state<=vr||r.state>=Gt||typeof r.buffer<"u"&&!r.buffer.empty?(pe(r),r.err==null&&(r.err=e),Bt(r,$t(r))):this.next(Promise.reject(e))},t.prototype[Symbol.asyncIterator]=function(){return this},t.race=yh,t.merge=gh,t.zip=Mh,t.latest=xh,t}();function $e(t,e){var r,s,i=[],a=function(f){f!=null&&typeof f[Symbol.asyncIterator]=="function"?i.push(f[Symbol.asyncIterator]()):f!=null&&typeof f[Symbol.iterator]=="function"?i.push(f[Symbol.iterator]()):i.push(function(){return ph(this,arguments,function(){return Pt(this,function(u){switch(u.label){case 0:return e.yieldValues?[4,be(f)]:[3,3];case 1:return[4,u.sent()];case 2:u.sent(),u.label=3;case 3:return e.returnValues?[4,be(f)]:[3,5];case 4:return[2,u.sent()];case 5:return[2]}})})}())};try{for(var n=Qt(t),o=n.next();!o.done;o=n.next()){var h=o.value;a(h)}}catch(f){r={error:f}}finally{try{o&&!o.done&&(s=n.return)&&s.call(n)}finally{if(r)throw r.error}}return i}function yh(t){var e=this,r=$e(t,{returnValues:!0});return new Yt(function(s,i){return Kt(e,void 0,void 0,function(){var a,n,o,h,f,c;return Pt(this,function(l){switch(l.label){case 0:if(!r.length)return i(),[2];n=!1,i.then(function(){a(),n=!0}),l.label=1;case 1:l.trys.push([1,,5,7]),h=void 0,f=0,c=function(){var u,m,d,p,v,g;return Pt(this,function(x){switch(x.label){case 0:u=f;try{for(m=(v=void 0,Qt(r)),d=m.next();!d.done;d=m.next())p=d.value,Promise.resolve(p.next()).then(function(M){M.done?(i(),o===void 0&&(o=M)):f===u&&(f++,a(M))},function(M){return i(M)})}catch(M){v={error:M}}finally{try{d&&!d.done&&(g=m.return)&&g.call(m)}finally{if(v)throw v.error}}return[4,new Promise(function(M){return a=M})];case 1:return h=x.sent(),h===void 0?[3,3]:[4,s(h.value)];case 2:x.sent(),x.label=3;case 3:return[2]}})},l.label=2;case 2:return n?[3,4]:[5,c()];case 3:return l.sent(),[3,2];case 4:return[2,o&&o.value];case 5:return i(),[4,Promise.race(r.map(function(u){return u.return&&u.return()}))];case 6:return l.sent(),[7];case 7:return[2]}})})})}function gh(t){var e=this,r=$e(t,{yieldValues:!0});return new Yt(function(s,i){return Kt(e,void 0,void 0,function(){var a,n,o,h=this;return Pt(this,function(f){switch(f.label){case 0:if(!r.length)return i(),[2];a=[],n=!1,i.then(function(){var c,l;n=!0;try{for(var u=Qt(a),m=u.next();!m.done;m=u.next()){var d=m.value;d()}}catch(p){c={error:p}}finally{try{m&&!m.done&&(l=u.return)&&l.call(u)}finally{if(c)throw c.error}}}),f.label=1;case 1:return f.trys.push([1,,3,4]),[4,Promise.all(r.map(function(c,l){return Kt(h,void 0,void 0,function(){var u,m;return Pt(this,function(d){switch(d.label){case 0:d.trys.push([0,,6,9]),d.label=1;case 1:return n?[3,5]:(Promise.resolve(c.next()).then(function(p){return a[l](p)},function(p){return i(p)}),[4,new Promise(function(p){a[l]=p})]);case 2:return u=d.sent(),u===void 0?[3,4]:u.done?(o=u,[2]):[4,s(u.value)];case 3:d.sent(),d.label=4;case 4:return[3,1];case 5:return[3,9];case 6:return m=c.return,m?[4,c.return()]:[3,8];case 7:m=d.sent(),d.label=8;case 8:return[7];case 9:return[2]}})})}))];case 2:return f.sent(),[2,o&&o.value];case 3:return i(),[7];case 4:return[2]}})})})}function Mh(t){var e=this,r=$e(t,{returnValues:!0});return new Yt(function(s,i){return Kt(e,void 0,void 0,function(){var a,n,o,h;return Pt(this,function(f){switch(f.label){case 0:if(!r.length)return i(),[2,[]];n=!1,i.then(function(){a(),n=!0}),f.label=1;case 1:f.trys.push([1,,6,8]),f.label=2;case 2:return n?[3,5]:(Promise.all(r.map(function(c){return c.next()})).then(function(c){return a(c)},function(c){return i(c)}),[4,new Promise(function(c){return a=c})]);case 3:return o=f.sent(),o===void 0?[2]:(h=o.map(function(c){return c.value}),o.some(function(c){return c.done})?[2,h]:[4,s(h)]);case 4:return f.sent(),[3,2];case 5:return[3,8];case 6:return i(),[4,Promise.all(r.map(function(c){return c.return&&c.return()}))];case 7:return f.sent(),[7];case 8:return[2]}})})})}function xh(t){var e=this,r=$e(t,{yieldValues:!0,returnValues:!0});return new Yt(function(s,i){return Kt(e,void 0,void 0,function(){var a,n,o,h,f,c=this;return Pt(this,function(l){switch(l.label){case 0:if(!r.length)return i(),[2,[]];n=[],o=!1,i.then(function(){var u,m;a();try{for(var d=Qt(n),p=d.next();!p.done;p=d.next()){var v=p.value;v()}}catch(g){u={error:g}}finally{try{p&&!p.done&&(m=d.return)&&m.call(d)}finally{if(u)throw u.error}}o=!0}),l.label=1;case 1:return l.trys.push([1,,5,7]),Promise.all(r.map(function(u){return u.next()})).then(function(u){return a(u)},function(u){return i(u)}),[4,new Promise(function(u){return a=u})];case 2:return h=l.sent(),h===void 0?[2]:(f=h.map(function(u){return u.value}),h.every(function(u){return u.done})?[2,f]:[4,s(f.slice())]);case 3:return l.sent(),[4,Promise.all(r.map(function(u,m){return Kt(c,void 0,void 0,function(){var d;return Pt(this,function(p){switch(p.label){case 0:if(h[m].done)return[2,h[m].value];p.label=1;case 1:return o?[3,4]:(Promise.resolve(u.next()).then(function(v){return n[m](v)},function(v){return i(v)}),[4,new Promise(function(v){return n[m]=v})]);case 2:return d=p.sent(),d===void 0?[2,h[m].value]:d.done?[2,d.value]:(f[m]=d.value,[4,s(f.slice())]);case 3:return p.sent(),[3,1];case 4:return[2]}})})}))];case 4:return[2,l.sent()];case 5:return i(),[4,Promise.all(r.map(function(u){return u.return&&u.return()}))];case 6:return l.sent(),[7];case 7:return[2]}})})})}var xr=class{_extraRequestThreshold=256*1024;extraRequestThreshold(){return this._extraRequestThreshold}setExtraRequestThreshold(e){if(e<0)throw new Error("extraRequestThreshold cannot be negative");this._extraRequestThreshold=e}},Et=xr;Ut(Et,"global",new xr);var ft;(function(t){t[t.Debug=0]="Debug",t[t.Info=1]="Info",t[t.Warn=2]="Warn",t[t.Error=3]="Error"})(ft||(ft={}));var F=class{static debug(...e){this.log(ft.Debug,...e)}static info(...e){this.log(ft.Info,...e)}static warn(...e){this.log(ft.Warn,...e)}static error(...e){this.log(ft.Error,...e)}static log(e,...r){if(!(this.logLevel>e))switch(e){case ft.Debug:{console.debug(...r);break}case ft.Info:{console.info(...r);break}case ft.Warn:{console.warn(...r);break}case ft.Error:{console.error(...r);break}}}};Ut(F,"logLevel",ft.Warn);var St=8*4+8;var ui=16;function ve(t,e){e=Math.min(Math.max(Number(e),2),65535);let r=t,s=r;do r=Math.ceil(r/e),s+=r;while(r!==1);return s*St}function wh(t,e){if(e<2)throw new Error("Node size must be at least 2");if(t===0)throw new Error("Number of items must be greater than 0");let r=t,s=r,i=[r];do r=Math.ceil(r/e),s+=r,i.push(r);while(r!==1);let a=[];r=s;for(let o of i)a.push(r-o),r-=o;let n=[];for(let o=0;o<i.length;o++)n.push([a[o],a[o]+i[o]]);return n}async function*di(t,e,r,s){class i{_level;nodes;constructor(d,p){this._level=p,this.nodes=d}level(){return this._level}startNodeIdx(){return this.nodes[0]}endNodeIdx(){return this.nodes[1]}extendEndNodeIdx(d){console.assert(d>this.nodes[1]),this.nodes[1]=d}toString(){return`[NodeRange level: ${this._level}, nodes: ${this.nodes[0]}-${this.nodes[1]}]`}}let{minX:a,minY:n,maxX:o,maxY:h}=r;F.info(`tree items: ${t}, nodeSize: ${e}`);let f=wh(t,e),c=f[0][0],u=[(()=>{let m=[0,1],d=f.length-1;return new i(m,d)})()];for(F.debug(`starting stream search with queue: ${u}, numItems: ${t}, nodeSize: ${e}, levelBounds: ${f}`);u.length!=0;){let m=u.shift();F.debug(`popped node: ${m}, queueLength: ${u.length}`);let d=m.startNodeIdx(),p=d>=c,v=(()=>{let[,S]=f[m.level()],I=Math.min(m.endNodeIdx()+e,S);return p&&I<S?I+1:I})(),g=v-d,x=await s(d*St,g*St),M=new DataView(x);for(let S=d;S<v;S++){let I=S-d,P=I*St;if(o<M.getFloat64(P+0,!0)||h<M.getFloat64(P+8,!0)||a>M.getFloat64(P+16,!0)||n>M.getFloat64(P+24,!0))continue;let B=M.getBigUint64(P+32,!0);if(p){let pt=B,se=(()=>{if(S<t-1){let Ri=(I+1)*St;return M.getBigUint64(Ri+32,!0)-pt}return null})(),Oi=S-c;yield[Number(pt),Oi,Number(se)];continue}let N=B,Y=Et.global.extraRequestThreshold()/St,q=u[u.length-1];if(q!==void 0&&q.level()==m.level()-1&&N<q.endNodeIdx()+Y){F.debug(`Merging "nodeRange" request into existing range: ${q}, newEndNodeIdx: ${q.endNodeIdx()} -> ${N}`),q.extendEndNodeIdx(Number(N));continue}let rt=(()=>{let pt=m.level()-1,se=[Number(N),Number(N)+1];return new i(se,pt)})();q!==void 0&&q.level()==rt.level()?F.info(`Same level, but too far away. Pushing new request for nodeIdx: ${N} rather than merging with distant ${q}`):F.info(`Pushing new level for ${rt} onto queue with nearestNodeRange: ${q} since there's not already a range for this level.`),u.push(rt)}}}var mt=new Uint8Array([102,103,98,3,102,103,98,0]),lt=4;var te=class{headerClient;header;headerLength;indexLength;constructor(e,r,s,i){this.headerClient=e,this.header=r,this.headerLength=s,this.indexLength=i}static async open(e){let s=new Ke(e),i=(()=>{let l=ui,u=3,m=0,d;for(d=0;d<u;d++){let p=l**d*St;m+=p}return m})(),a=2024+i;F.debug(`fetching header. minReqLength: ${a} (assumedHeaderLength: ${2024}, assumedIndexLength: ${i})`);{let l=new Uint8Array(await s.getRange(0,8,a,"header"));if(!l.subarray(0,3).every((u,m)=>mt[m]===u))throw F.error(`bytes: ${l} != ${mt}`),new Error("Not a FlatGeobuf file");F.debug("magic bytes look good")}let n;{let l=await s.getRange(8,4,a,"header");n=new DataView(l).getUint32(0,!0);let u=1048576*10;if(n>u||n<8)throw new Error("Invalid header size");F.debug(`headerLength: ${n}`)}let o=await s.getRange(12,n,a,"header"),h=new H(new Uint8Array(o)),f=me(h),c=ve(f.featuresCount,f.indexNodeSize);return F.debug("completed: opening http reader"),new te(s,f,n,c)}async*selectBbox(e){let r=this.lengthBeforeTree(),s=this.headerClient,i=async function(h,f){return s.getRange(r+h,f,0,"index")},a=[],n=[];for await(let h of di(this.header.featuresCount,this.header.indexNodeSize,e,i)){let[f,,]=h,[,,c]=h;if(c||(F.info("final feature"),c=4),n.length==0){n.push([f,c]);continue}let l=n[n.length-1],u=f-(l[0]+l[1]);u>Et.global.extraRequestThreshold()&&(F.info(`Pushing new feature batch, since gap ${u} was too large`),a.push(n),n=[]),n.push([f,c])}this.headerClient.logUsage("header+index"),n.length>0&&a.push(n);let o=a.flatMap(h=>this.readFeatureBatch(h));yield*Yt.merge(o)}lengthBeforeTree(){return mt.length+lt+this.headerLength}lengthBeforeFeatures(){return this.lengthBeforeTree()+this.indexLength}buildFeatureClient(){return new Ke(this.headerClient.httpClient)}async*readFeatureBatch(e){let[r]=e[0],[s,i]=e[e.length-1],a=r,o=s+i-a,h=this.buildFeatureClient(),f=o;for(let[c]of e)yield await this.readFeature(h,c,f),f=0;h.logUsage("feature")}async readFeature(e,r,s){let i=r+this.lengthBeforeFeatures(),a;{let c=await e.getRange(i,4,s,"feature length");a=new DataView(c).getUint32(0,!0)}let n=await e.getRange(i+4,a,s,"feature data"),o=new Uint8Array(n),h=new Uint8Array(a+lt);h.set(o,lt);let f=new H(h);return f.setPosition(lt),X.getRootAsFeature(f)}},Ke=class{httpClient;bytesEverUsed=0;bytesEverFetched=0;buffer=new ArrayBuffer(0);head=0;constructor(e){if(typeof e=="string")this.httpClient=new Qe(e);else if(e instanceof Qe)this.httpClient=e;else throw new Error("Unknown source ")}async getRange(e,r,s,i){this.bytesEverUsed+=r;let a=e-this.head,n=a+r;if(a>=0&&n<=this.buffer.byteLength)return this.buffer.slice(a,n);let o=Math.max(r,s);return this.bytesEverFetched+=o,F.debug(`requesting for new Range: ${e}-${e+o-1}`),this.buffer=await this.httpClient.getRange(e,o,i),this.head=e,this.buffer.slice(0,r)}logUsage(e){let r=e.split(" ")[0],s=this.bytesEverUsed,i=this.bytesEverFetched,a=(100*s/i).toFixed(2);F.info(`${r} bytes used/requested: ${s} / ${i} = ${a}%`)}},Qe=class{url;requestsEverMade=0;bytesEverRequested=0;constructor(e){this.url=e}async getRange(e,r,s){this.requestsEverMade+=1,this.bytesEverRequested+=r;let i=`bytes=${e}-${e+r-1}`;return F.info(`request: #${this.requestsEverMade}, purpose: ${s}), bytes: (this_request: ${r}, ever: ${this.bytesEverRequested}), Range: ${i}`),(await fetch(this.url,{headers:{Range:i}})).arrayBuffer()}};function Ye(t,e,r){if(!t.subarray(0,3).every((c,l)=>mt[l]===c))throw new Error("Not a FlatGeobuf file");let s=new H(t),i=s.readUint32(mt.length);s.setPosition(mt.length+lt);let a=me(s);r&&r(a);let n=mt.length+lt+i,{indexNodeSize:o,featuresCount:h}=a;o>0&&(n+=ve(h,o));let f=[];for(;n<s.capacity();){let c=s.readUint32(n);s.setPosition(n+lt);let l=X.getRootAsFeature(s);f.push(e(l,a)),n+=lt+c}return f}async function*tr(t,e,r){let s=br(t),i=async u=>await s.slice(u),a=new Uint8Array(await i(8,"magic bytes"));if(!a.subarray(0,3).every((u,m)=>mt[m]===u))throw new Error("Not a FlatGeobuf file");a=new Uint8Array(await i(4,"header length"));let n=new H(a),o=n.readUint32(0);a=new Uint8Array(await i(o,"header data")),n=new H(a);let h=me(n);r&&r(h);let{indexNodeSize:f,featuresCount:c}=h;if(f>0){let u=ve(c,f);await i(u,"entire index, w/o rect")}let l;for(;l=await Ih(i,h,e);)yield l}async function*er(t,e,r,s){let i=await te.open(t);F.debug("opened reader"),s&&s(i.header);for await(let a of i.selectBbox(e))yield r(a,i.header)}async function Ih(t,e,r){let s=new Uint8Array(await t(4,"feature length"));if(s.byteLength===0)return;let i=new H(s),a=i.readUint32(0);s=new Uint8Array(await t(a,"feature data"));let n=new Uint8Array(a+4);n.set(s,4),i=new H(n),i.setPosition(lt);let o=X.getRootAsFeature(i);return r(o,e)}function mi(t,e){return{type:"FeatureCollection",features:Ye(t,Ve,e)}}function pi(t,e){return tr(t,Ve,e)}function bi(t,e,r){return er(t,e,Ve,r)}function vi(t,e,r){return t instanceof Uint8Array?mi(t,r):t instanceof ReadableStream?pi(t,r):bi(t,e,r)}function _i(t,e,r){return t instanceof Uint8Array?Ye(t,e):t instanceof ReadableStream?tr(t,e):er(t,r,e)}var gi=vi,Mi=_i;function xi(t,e){let r=e.shape;switch(r){case"geojson-table":return Sh(t,e);case"columnar-table":return{shape:"columnar-table",data:yi(t,e)};case"binary":return yi(t,e);default:throw new Error(r)}}function yi(t,e={}){let r=new Uint8Array(t);return Mi(r,dr)}function Sh(t,e){if(t.byteLength===0)return{shape:"geojson-table",type:"FeatureCollection",features:[]};let{reproject:r=!1,crs:s="WGS84"}=e,i=new Uint8Array(t),a,n,o=e.boundingBox&&Ii(e.boundingBox),{features:h}=gi(i,o,l=>{a=l,n=si(a)}),f=a?.crs?.wkt,c;if(r&&f)try{c=new Xt({from:f,to:s})}catch{}return c&&(h=Ue(h,l=>c.project(l))),{shape:"geojson-table",schema:n,type:"FeatureCollection",features:h}}function wi(t,e){let r=e.shape;switch(r){case"binary":return Ah(t,e);case"geojson-table":return Nh(t,e);default:throw new Error(r)}}function Ah(t,e){let r=e.boundingBox&&Ii(e.boundingBox);return Mi(t,Fh,r)}async function*Nh(t,e){let{reproject:r=!1,crs:s="WGS84"}=e||{},i,a=gi(t,void 0,h=>{i=h}),n,o=!0;for await(let h of a){if(o){let f=i?.crs?.wkt;r&&f&&(n=new Xt({from:f,to:s})),o=!1}r&&n?yield Ue([h],f=>n.project(f)):yield h}}function Ii(t){return{minX:t[0][0],minY:t[0][1],maxX:t[1][0],maxY:t[1][1]}}function Fh(t,e){let r=t.geometry(),s=e.geometryType||r?.type(),i=dr(r,s);return i.properties=ke(t,e.columns),i}var Oh="4.4.0-alpha.1",Rh=[102,103,98,3,102,103,98,1],wr={...zt,dataType:null,batchType:null,version:Oh,worker:!0,tests:[new Uint8Array(Rh).buffer],options:{flatgeobuf:{shape:"geojson-table"},gis:{reproject:!1}}},ee={...wr,parse:async(t,e={})=>Pi(t,e),parseSync:Pi,parseInBatchesFromStream:Lh,binary:!0};function Pi(t,e={}){return xi(t,Ei(e))}function Lh(t,e){return wi(t,Ei(e))}function Ei(t){return t={...t,flatgeobuf:{...ee.options.flatgeobuf,...t?.flatgeobuf},gis:{...ee.options.gis,...t?.gis}},{shape:t?.flatgeobuf?.shape??"geojson-table",boundingBox:t?.flatgeobuf?.boundingBox,crs:t?.gis?._targetCrs||"WGS84",reproject:t?.gis?.reproject||!1}}function Si(t,e){return Ai(t||{},e)}function Ai(t,e,r=0){if(r>3)return e;let s={...t};for(let[i,a]of Object.entries(e))a&&typeof a=="object"&&!Array.isArray(a)?s[i]=Ai(s[i]||{},e[i],r+1):s[i]=e[i];return s}var Ch="",Ni={};function Fi(t){for(let e in Ni)if(t.startsWith(e)){let r=Ni[e];t=t.replace(e,r)}return!t.startsWith("http://")&&!t.startsWith("https://")&&(t=`${Ch}${t}`),t}var Ir=class{optionsType;options;data;url;loadOptions;fetch;_needsRefresh=!0;constructor(e,r,s){s?this.options=Si({...s,core:Ir.defaultOptions},r):this.options={...r},this.data=e,this.url=typeof e=="string"?Fi(e):"",this.loadOptions={...this.options.core?.loadOptions},this.fetch=Th(this.loadOptions)}setProps(e){this.options=Object.assign(this.options,e),this.setNeedsRefresh()}setNeedsRefresh(){this._needsRefresh=!0}getNeedsRefresh(e=!0){let r=this._needsRefresh;return e&&(this._needsRefresh=!1),r}},re=Ir;Ut(re,"defaultOptions",{core:{type:"auto",attributions:[],loadOptions:{},loaders:[]}});function Th(t){let e=t?.fetch;if(e&&typeof e=="function")return(s,i)=>e(s,i);let r=t?.fetch;return r&&typeof r!="function"?s=>fetch(s,r):s=>fetch(s)}var Er={...zt,version:"0.0.0",type:"flatgeobuf-server",fromUrl:!0,fromBlob:!1,defaultOptions:{flatgeobuf:{}},testURL:t=>t.toLowerCase().includes("FeatureServer"),createDataSource:(t,e)=>new Pr(t,e)},Pr=class extends re{formatSpecificMetadata=null;constructor(e,r){super(e,r,Er.defaultOptions)}async getSchema(){return await this.getMetadata({formatSpecificMetadata:!0}),{metadata:{},fields:[]}}async getMetadata(e){return this.formatSpecificMetadata,e.formatSpecificMetadata,{}}async getFeatures(e){let s=await(await this.fetch(this.url)).arrayBuffer();return await ee.parse(s,{})}};return Di(_e);})();
|
|
11
11
|
/*! Bundled license information:
|
|
12
12
|
|
|
13
13
|
@repeaterjs/repeater/repeater.js:
|