mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-11-28 18:28:04 -08:00
1 line
58 KiB
JavaScript
1 line
58 KiB
JavaScript
(()=>{"use strict";const t={};function e(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");for(var e=1;e<=60;++e)t("EPSG:"+(32600+e),"+proj=utm +zone="+e+" +datum=WGS84 +units=m"),t("EPSG:"+(32700+e),"+proj=utm +zone="+e+" +south +datum=WGS84 +units=m");t("EPSG:5041","+title=WGS 84 / UPS North (E,N) +proj=stere +lat_0=90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),t("EPSG:5042","+title=WGS 84 / UPS South (E,N) +proj=stere +lat_0=-90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),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"]}t.dn=t=>{var e=Object.getOwnPropertyDescriptor(t,"name");(!e||!e.writable&&e.configurable)&&Object.defineProperty(t,"name",{value:"default",configurable:!0})},t.dn(e);var a=6378137,s=.0066943799901413165,o=484813681109536e-20,r=Math.PI/2,i=1e-10,n=.017453292519943295,l=57.29577951308232,_=Math.PI/4,u=2*Math.PI;const g={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667},d={mm:{to_meter:.001},cm:{to_meter:.01},ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937},fath:{to_meter:1.8288},kmi:{to_meter:1852},"us-ch":{to_meter:20.1168402336805},"us-mi":{to_meter:1609.34721869444},km:{to_meter:1e3},"ind-ft":{to_meter:.30479841},"ind-yd":{to_meter:.91439523},mi:{to_meter:1609.344},yd:{to_meter:.9144},ch:{to_meter:20.1168},link:{to_meter:.201168},dm:{to_meter:.1},in:{to_meter:.0254},"ind-ch":{to_meter:20.11669506},"us-in":{to_meter:.025400050800101},"us-yd":{to_meter:.914401828803658}};var c=/[\s_\-\/\(\)]/g;function m(t,e){if(t[e])return t[e];for(var a,s=Object.keys(t),o=e.toLowerCase().replace(c,""),r=-1;++r<s.length;)if((a=s[r]).toLowerCase().replace(c,"")===o)return t[a]}function G(t){var e,a,s,o={},r=t.split("+").map(function(t){return t.trim()}).filter(function(t){return t}).reduce(function(t,e){var a=e.split("=");return a.push(!0),t[a[0].toLowerCase()]=a[1],t},{}),i={proj:function(t){o.projName=["lonlat","latlon","latlong"].includes(t)?"longlat":t},datum:"datumCode",rf:function(t){o.rf=parseFloat(t)},lat_0:function(t){o.lat0=t*n},lat_1:function(t){o.lat1=t*n},lat_2:function(t){o.lat2=t*n},lat_ts:function(t){o.lat_ts=t*n},lon_0:function(t){o.long0=t*n},lon_wrap:function(t){o.long_wrap=parseFloat(t)*n},lon_1:function(t){o.long1=t*n},lon_2:function(t){o.long2=t*n},alpha:function(t){o.alpha=parseFloat(t)*n},gamma:function(t){o.rectified_grid_angle=parseFloat(t)*n},lonc:function(t){o.longc=t*n},x_0:function(t){o.x0=parseFloat(t)},y_0:function(t){o.y0=parseFloat(t)},k_0:function(t){o.k0=parseFloat(t)},k:function(t){o.k0=parseFloat(t)},a:function(t){o.a=parseFloat(t)},b:function(t){o.b=parseFloat(t)},r:function(t){o.a=o.b=parseFloat(t)},r_a:function(){o.R_A=!0},zone:function(t){o.zone=parseInt(t,10)},south:function(){o.utmSouth=!0},towgs84:function(t){o.datum_params=t.split(",").map(function(t){return parseFloat(t)})},to_meter:function(t){o.to_meter=parseFloat(t)},units:function(t){o.units=t;var e=m(d,t);e&&(o.to_meter=e.to_meter)},from_greenwich:function(t){o.from_greenwich=t*n},pm:function(t){var e=m(g,t);o.from_greenwich=(e||parseFloat(t))*n},nadgrids:function(t){"@null"===t?o.datumCode="none":o.nadgrids=t},axis:function(t){var e="ewnsud";3===t.length&&-1!==e.indexOf(t.substr(0,1))&&-1!==e.indexOf(t.substr(1,1))&&-1!==e.indexOf(t.substr(2,1))&&(o.axis=t)},approx:function(){o.approx=!0},over:function(){o.over=!0}};for(e in r)a=r[e],e in i?"function"==typeof(s=i[e])?s(a):o[s]=a:o[e]=a;return"string"==typeof o.datumCode&&"WGS84"!==o.datumCode&&(o.datumCode=o.datumCode.toLowerCase()),o.projStr=t,o}t.dn(G);const S=class{static getId(t){const e=t.find(t=>Array.isArray(t)&&"ID"===t[0]);return e&&e.length>=3?{authority:e[1],code:parseInt(e[2],10)}:null}static convertUnit(t,e="unit"){if(!t||t.length<3)return{type:e,name:"unknown",conversion_factor:null};const a=t[1],s=parseFloat(t[2])||null,o=t.find(t=>Array.isArray(t)&&"ID"===t[0]);return{type:e,name:a,conversion_factor:s,id:o?{authority:o[1],code:parseInt(o[2],10)}:null}}static convertAxis(t){const e=t[1]||"Unknown";let a;const s=e.match(/^\((.)\)$/);if(s){const e=s[1].toUpperCase();if("E"===e)a="east";else if("N"===e)a="north";else if("U"===e)a="up";else{if(!t[2])throw new Error(`Unknown axis abbreviation: ${e}`);a=t[2]}}else a=t[2]||"unknown";const o=t.find(t=>Array.isArray(t)&&"ORDER"===t[0]),r=o?parseInt(o[1],10):null,i=t.find(t=>Array.isArray(t)&&("LENGTHUNIT"===t[0]||"ANGLEUNIT"===t[0]||"SCALEUNIT"===t[0]));return{name:e,direction:a,unit:this.convertUnit(i),order:r}}static extractAxes(t){return t.filter(t=>Array.isArray(t)&&"AXIS"===t[0]).map(t=>this.convertAxis(t)).sort((t,e)=>(t.order||0)-(e.order||0))}static convert(t,e={}){switch(t[0]){case"PROJCRS":e.type="ProjectedCRS",e.name=t[1],e.base_crs=t.find(t=>Array.isArray(t)&&"BASEGEOGCRS"===t[0])?this.convert(t.find(t=>Array.isArray(t)&&"BASEGEOGCRS"===t[0])):null,e.conversion=t.find(t=>Array.isArray(t)&&"CONVERSION"===t[0])?this.convert(t.find(t=>Array.isArray(t)&&"CONVERSION"===t[0])):null;const a=t.find(t=>Array.isArray(t)&&"CS"===t[0]);a&&(e.coordinate_system={subtype:a[1],axis:this.extractAxes(t)});const s=t.find(t=>Array.isArray(t)&&"LENGTHUNIT"===t[0]);if(s){const t=this.convertUnit(s);e.coordinate_system.unit=t}e.id=this.getId(t);break;case"BASEGEOGCRS":case"GEOGCRS":case"GEODCRS":e.type="GEODCRS"===t[0]?"GeodeticCRS":"GeographicCRS",e.name=t[1];const o=t.find(t=>Array.isArray(t)&&("DATUM"===t[0]||"ENSEMBLE"===t[0]));if(o){const a=this.convert(o);"ENSEMBLE"===o[0]?e.datum_ensemble=a:e.datum=a;const s=t.find(t=>Array.isArray(t)&&"PRIMEM"===t[0]);s&&"Greenwich"!==s[1]&&(a.prime_meridian={name:s[1],longitude:parseFloat(s[2])})}const r=t.find(t=>Array.isArray(t)&&"CS"===t[0]);e.coordinate_system={subtype:r?r[1]:"ellipsoidal",axis:this.extractAxes(t)},e.id=this.getId(t);break;case"DATUM":e.type="GeodeticReferenceFrame",e.name=t[1],e.ellipsoid=t.find(t=>Array.isArray(t)&&"ELLIPSOID"===t[0])?this.convert(t.find(t=>Array.isArray(t)&&"ELLIPSOID"===t[0])):null;break;case"ENSEMBLE":e.type="DatumEnsemble",e.name=t[1],e.members=t.filter(t=>Array.isArray(t)&&"MEMBER"===t[0]).map(t=>({type:"DatumEnsembleMember",name:t[1],id:this.getId(t)}));const i=t.find(t=>Array.isArray(t)&&"ENSEMBLEACCURACY"===t[0]);i&&(e.accuracy=parseFloat(i[1]));const n=t.find(t=>Array.isArray(t)&&"ELLIPSOID"===t[0]);n&&(e.ellipsoid=this.convert(n)),e.id=this.getId(t);break;case"ELLIPSOID":e.type="Ellipsoid",e.name=t[1],e.semi_major_axis=parseFloat(t[2]),e.inverse_flattening=parseFloat(t[3]),t.find(t=>Array.isArray(t)&&"LENGTHUNIT"===t[0])&&this.convert(t.find(t=>Array.isArray(t)&&"LENGTHUNIT"===t[0]),e);break;case"CONVERSION":e.type="Conversion",e.name=t[1],e.method=t.find(t=>Array.isArray(t)&&"METHOD"===t[0])?this.convert(t.find(t=>Array.isArray(t)&&"METHOD"===t[0])):null,e.parameters=t.filter(t=>Array.isArray(t)&&"PARAMETER"===t[0]).map(t=>this.convert(t));break;case"METHOD":e.type="Method",e.name=t[1],e.id=this.getId(t);break;case"PARAMETER":e.type="Parameter",e.name=t[1],e.value=parseFloat(t[2]),e.unit=this.convertUnit(t.find(t=>Array.isArray(t)&&("LENGTHUNIT"===t[0]||"ANGLEUNIT"===t[0]||"SCALEUNIT"===t[0]))),e.id=this.getId(t);break;case"BOUNDCRS":e.type="BoundCRS";const l=t.find(t=>Array.isArray(t)&&"SOURCECRS"===t[0]);if(l){const t=l.find(t=>Array.isArray(t));e.source_crs=t?this.convert(t):null}const _=t.find(t=>Array.isArray(t)&&"TARGETCRS"===t[0]);if(_){const t=_.find(t=>Array.isArray(t));e.target_crs=t?this.convert(t):null}const u=t.find(t=>Array.isArray(t)&&"ABRIDGEDTRANSFORMATION"===t[0]);e.transformation=u?this.convert(u):null;break;case"ABRIDGEDTRANSFORMATION":if(e.type="Transformation",e.name=t[1],e.method=t.find(t=>Array.isArray(t)&&"METHOD"===t[0])?this.convert(t.find(t=>Array.isArray(t)&&"METHOD"===t[0])):null,e.parameters=t.filter(t=>Array.isArray(t)&&("PARAMETER"===t[0]||"PARAMETERFILE"===t[0])).map(t=>"PARAMETER"===t[0]?this.convert(t):"PARAMETERFILE"===t[0]?{name:t[1],value:t[2],id:{authority:"EPSG",code:8656}}:void 0),7===e.parameters.length){const t=e.parameters[6];"Scale difference"===t.name&&(t.value=Math.round(1e12*(t.value-1))/1e6)}e.id=this.getId(t);break;case"AXIS":e.coordinate_system||(e.coordinate_system={type:"unspecified",axis:[]}),e.coordinate_system.axis.push(this.convertAxis(t));break;case"LENGTHUNIT":const g=this.convertUnit(t,"LinearUnit");e.coordinate_system&&e.coordinate_system.axis&&e.coordinate_system.axis.forEach(t=>{t.unit||(t.unit=g)}),g.conversion_factor&&1!==g.conversion_factor&&e.semi_major_axis&&(e.semi_major_axis={value:e.semi_major_axis,unit:g});break;default:e.keyword=t[0]}return e}};var E=1,w=/\s/,f=/[A-Za-z]/,h=/[A-Za-z84_]/,P=/[,\]]/,p=/[\d\.E\-\+]/;function y(t){if("string"!=typeof t)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=E}function v(t,e,a){Array.isArray(e)&&(a.unshift(e),e=null);var s=e?{}:t,o=a.reduce(function(t,e){return N(e,t),t},s);e&&(t[e]=o)}function N(t,e){if(Array.isArray(t)){var a=t.shift();if("PARAMETER"===a&&(a=t.shift()),1===t.length)return Array.isArray(t[0])?(e[a]={},void N(t[0],e[a])):void(e[a]=t[0]);if(t.length)if("TOWGS84"!==a){if("AXIS"===a)return a in e||(e[a]=[]),void e[a].push(t);var s;switch(Array.isArray(a)||(e[a]={}),a){case"UNIT":case"PRIMEM":case"VERT_DATUM":return e[a]={name:t[0].toLowerCase(),convert:t[1]},void(3===t.length&&N(t[2],e[a]));case"SPHEROID":case"ELLIPSOID":return e[a]={name:t[0],a:t[1],rf:t[2]},void(4===t.length&&N(t[3],e[a]));case"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":return t[0]=["name",t[0]],void v(e,a,t);case"COMPD_CS":case"COMPOUNDCRS":case"FITTED_CS":case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"ENGCRS":case"ENGINEERINGCRS":return t[0]=["name",t[0]],v(e,a,t),void(e[a].type=a);default:for(s=-1;++s<t.length;)if(!Array.isArray(t[s]))return N(t,e[a]);return v(e,a,t)}}else e[a]=t;else e[a]=!0}else e[t]=!0}function A(t){return.017453292519943295*t}function x(t){const e=(t.projName||"").toLowerCase().replace(/_/g," ");void 0===t.long0&&void 0!==t.longc&&(t.long0=t.longc),t.lat_ts||!t.lat1||"stereographic south pole"!==e&&"polar stereographic (variant b)"!==e?t.lat_ts||!t.lat0||"polar stereographic"!==e&&"polar stereographic (variant a)"!==e||(t.lat_ts=t.lat0,t.lat0=A(t.lat0>0?90:-90),delete t.lat1):(t.lat0=A(t.lat1>0?90:-90),t.lat_ts=t.lat1,delete t.lat1)}function I(t){let e={units:null,to_meter:void 0};return"string"==typeof t?(e.units=t.toLowerCase(),"metre"===e.units&&(e.units="meter"),"meter"===e.units&&(e.to_meter=1)):t&&t.name&&(e.units=t.name.toLowerCase(),"metre"===e.units&&(e.units="meter"),e.to_meter=t.conversion_factor),e}function b(t){return"object"==typeof t?t.value*t.unit.conversion_factor:t}function C(t,e){t.ellipsoid.radius?(e.a=t.ellipsoid.radius,e.rf=0):(e.a=b(t.ellipsoid.semi_major_axis),void 0!==t.ellipsoid.inverse_flattening?e.rf=t.ellipsoid.inverse_flattening:void 0!==t.ellipsoid.semi_major_axis&&void 0!==t.ellipsoid.semi_minor_axis&&(e.rf=e.a/(e.a-b(t.ellipsoid.semi_minor_axis))))}function M(t,e={}){return t&&"object"==typeof t?"BoundCRS"===t.type?(M(t.source_crs,e),t.transformation&&(t.transformation.method&&"NTv2"===t.transformation.method.name?e.nadgrids=t.transformation.parameters[0].value:e.datum_params=t.transformation.parameters.map(t=>t.value)),e):(Object.keys(t).forEach(a=>{const s=t[a];if(null!==s)switch(a){case"name":if(e.srsCode)break;e.name=s,e.srsCode=s;break;case"type":"GeographicCRS"===s?e.projName="longlat":"GeodeticCRS"===s?t.coordinate_system&&"Cartesian"===t.coordinate_system.subtype?e.projName="geocent":e.projName="longlat":"ProjectedCRS"===s&&t.conversion&&t.conversion.method&&(e.projName=t.conversion.method.name);break;case"datum":case"datum_ensemble":s.ellipsoid&&(e.ellps=s.ellipsoid.name,C(s,e)),s.prime_meridian&&(e.from_greenwich=s.prime_meridian.longitude*Math.PI/180);break;case"ellipsoid":e.ellps=s.name,C(s,e);break;case"prime_meridian":e.long0=(s.longitude||0)*Math.PI/180;break;case"coordinate_system":if(s.axis){const t={east:"e",north:"n",west:"w",south:"s",up:"u",down:"d",geocentricx:"e",geocentricy:"n",geocentricz:"u"},a=s.axis.map(e=>t[e.direction.toLowerCase()]);if(a.every(Boolean)&&(e.axis=a.join(""),2===e.axis.length&&(e.axis+="u")),s.unit){const{units:t,to_meter:a}=I(s.unit);e.units=t,e.to_meter=a}else if(s.axis[0]&&s.axis[0].unit){const{units:t,to_meter:a}=I(s.axis[0].unit);e.units=t,e.to_meter=a}}break;case"id":s.authority&&s.code&&(e.title=s.authority+":"+s.code);break;case"conversion":s.method&&s.method.name&&(e.projName=s.method.name),s.parameters&&s.parameters.forEach(t=>{const a=t.name.toLowerCase().replace(/\s+/g,"_"),s=t.value;t.unit&&t.unit.conversion_factor?e[a]=s*t.unit.conversion_factor:"degree"===t.unit?e[a]=s*Math.PI/180:e[a]=s});break;case"unit":s.name&&(e.units=s.name.toLowerCase(),"metre"===e.units&&(e.units="meter")),s.conversion_factor&&(e.to_meter=s.conversion_factor);break;case"base_crs":M(s,e),e.datumCode=s.id?s.id.authority+"_"+s.id.code:s.name}}),void 0!==e.latitude_of_false_origin&&(e.lat0=e.latitude_of_false_origin),void 0!==e.longitude_of_false_origin&&(e.long0=e.longitude_of_false_origin),void 0!==e.latitude_of_standard_parallel&&(e.lat0=e.latitude_of_standard_parallel,e.lat1=e.latitude_of_standard_parallel),void 0!==e.latitude_of_1st_standard_parallel&&(e.lat1=e.latitude_of_1st_standard_parallel),void 0!==e.latitude_of_2nd_standard_parallel&&(e.lat2=e.latitude_of_2nd_standard_parallel),void 0!==e.latitude_of_projection_centre&&(e.lat0=e.latitude_of_projection_centre),void 0!==e.longitude_of_projection_centre&&(e.longc=e.longitude_of_projection_centre),void 0!==e.easting_at_false_origin&&(e.x0=e.easting_at_false_origin),void 0!==e.northing_at_false_origin&&(e.y0=e.northing_at_false_origin),void 0!==e.latitude_of_natural_origin&&(e.lat0=e.latitude_of_natural_origin),void 0!==e.longitude_of_natural_origin&&(e.long0=e.longitude_of_natural_origin),void 0!==e.longitude_of_origin&&(e.long0=e.longitude_of_origin),void 0!==e.false_easting&&(e.x0=e.false_easting),e.easting_at_projection_centre&&(e.x0=e.easting_at_projection_centre),void 0!==e.false_northing&&(e.y0=e.false_northing),e.northing_at_projection_centre&&(e.y0=e.northing_at_projection_centre),void 0!==e.standard_parallel_1&&(e.lat1=e.standard_parallel_1),void 0!==e.standard_parallel_2&&(e.lat2=e.standard_parallel_2),void 0!==e.scale_factor_at_natural_origin&&(e.k0=e.scale_factor_at_natural_origin),void 0!==e.scale_factor_at_projection_centre&&(e.k0=e.scale_factor_at_projection_centre),void 0!==e.scale_factor_on_pseudo_standard_parallel&&(e.k0=e.scale_factor_on_pseudo_standard_parallel),void 0!==e.azimuth&&(e.alpha=e.azimuth),void 0!==e.azimuth_at_projection_centre&&(e.alpha=e.azimuth_at_projection_centre),e.angle_from_rectified_to_skew_grid&&(e.rectified_grid_angle=e.angle_from_rectified_to_skew_grid),x(e),e):t}y.prototype.readCharicter=function(){var t=this.text[this.place++];if(4!==this.state)for(;w.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case E:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},y.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(P.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},y.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=E)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=E,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},y.prototype.number=function(t){if(!p.test(t)){if(P.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},y.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},y.prototype.keyword=function(t){if(h.test(t))this.word+=t;else{if("["===t){var e=[];return e.push(this.word),this.level++,null===this.root?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,void(this.state=E)}if(!P.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},y.prototype.neutral=function(t){if(f.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(p.test(t))return this.word=t,void(this.state=3);if(!P.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},y.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)},t.dn(k);var R=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function O(t){for(var e=Object.keys(t),a=0,s=e.length;a<s;++a){var o=e[a];-1!==R.indexOf(o)&&T(t[o]),"object"==typeof t[o]&&O(t[o])}}function T(t){if(t.AUTHORITY){var e=Object.keys(t.AUTHORITY)[0];e&&e in t.AUTHORITY&&(t.title=e+":"+t.AUTHORITY[e])}if("GEOGCS"===t.type?t.projName="longlat":"LOCAL_CS"===t.type?(t.projName="identity",t.local=!0):"object"==typeof t.PROJECTION?t.projName=Object.keys(t.PROJECTION)[0]:t.projName=t.PROJECTION,t.AXIS){for(var a="",s=0,o=t.AXIS.length;s<o;++s){var r=[t.AXIS[s][0].toLowerCase(),t.AXIS[s][1].toLowerCase()];-1!==r[0].indexOf("north")||("y"===r[0]||"lat"===r[0])&&"north"===r[1]?a+="n":-1!==r[0].indexOf("south")||("y"===r[0]||"lat"===r[0])&&"south"===r[1]?a+="s":-1!==r[0].indexOf("east")||("x"===r[0]||"lon"===r[0])&&"east"===r[1]?a+="e":-1===r[0].indexOf("west")&&("x"!==r[0]&&"lon"!==r[0]||"west"!==r[1])||(a+="w")}2===a.length&&(a+="u"),3===a.length&&(t.axis=a)}t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),"metre"===t.units&&(t.units="meter"),t.UNIT.convert&&("GEOGCS"===t.type?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a):t.to_meter=t.UNIT.convert));var i=t.GEOGCS;function n(e){return e*(t.to_meter||1)}"GEOGCS"===t.type&&(i=t),i&&(i.PRIMEM&&i.PRIMEM.convert&&(t.from_greenwich=A(i.PRIMEM.convert)),i.DATUM?t.datumCode=i.DATUM.name.toLowerCase():t.datumCode=i.name.toLowerCase(),"d_"===t.datumCode.slice(0,2)&&(t.datumCode=t.datumCode.slice(2)),"new_zealand_1949"===t.datumCode&&(t.datumCode="nzgd49"),"wgs_1984"!==t.datumCode&&"world_geodetic_system_1984"!==t.datumCode||("Mercator_Auxiliary_Sphere"===t.PROJECTION&&(t.sphere=!0),t.datumCode="wgs84"),"belge_1972"===t.datumCode&&(t.datumCode="rnb72"),i.DATUM&&i.DATUM.SPHEROID&&(t.ellps=i.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===t.ellps.toLowerCase().slice(0,13)&&(t.ellps="intl"),t.a=i.DATUM.SPHEROID.a,t.rf=parseFloat(i.DATUM.SPHEROID.rf)),i.DATUM&&i.DATUM.TOWGS84&&(t.datum_params=i.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"),"ch1903+"===t.datumCode&&(t.datumCode="ch1903"),~t.datumCode.indexOf("israel")&&(t.datumCode="isr93")),t.b&&!isFinite(t.b)&&(t.b=t.a),t.rectified_grid_angle&&(t.rectified_grid_angle=A(t.rectified_grid_angle)),[["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",A],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",A],["x0","false_easting",n],["y0","false_northing",n],["long0","central_meridian",A],["lat0","latitude_of_origin",A],["lat0","standard_parallel_1",A],["lat1","standard_parallel_1",A],["lat2","standard_parallel_2",A],["azimuth","Azimuth"],["alpha","azimuth",A],["srsCode","name"]].forEach(function(e){return a=t,o=(s=e)[0],r=s[1],void(!(o in a)&&r in a&&(a[o]=a[r],3===s.length&&(a[o]=s[2](a[o]))));var a,s,o,r}),x(t)}function k(t){if("object"==typeof t)return M(t);const e=function(t){const e=t.toUpperCase();return e.includes("PROJCRS")||e.includes("GEOGCRS")||e.includes("BOUNDCRS")||e.includes("VERTCRS")||e.includes("LENGTHUNIT")||e.includes("ANGLEUNIT")||e.includes("SCALEUNIT")?"WKT2":(e.includes("PROJCS")||e.includes("GEOGCS")||e.includes("LOCAL_CS")||e.includes("VERT_CS")||e.includes("UNIT"),"WKT1")}(t);var a=new y(t).output();if("WKT2"===e)return M(S.convert(a));var s=a[0],o={};return N(a,o),O(o),o[s]}function D(t){var e=this;if(2===arguments.length){var a=arguments[1];"string"==typeof a?"+"===a.charAt(0)?D[t]=G(arguments[1]):D[t]=k(arguments[1]):a&&"object"==typeof a&&!("projName"in a)?D[t]=k(arguments[1]):(D[t]=a,a||delete D[t])}else if(1===arguments.length){if(Array.isArray(t))return t.map(function(t){return Array.isArray(t)?D.apply(e,t):D(t)});if("string"==typeof t){if(t in D)return D[t]}else"EPSG"in t?D["EPSG:"+t.EPSG]=t:"ESRI"in t?D["ESRI:"+t.ESRI]=t:"IAU2000"in t?D["IAU2000:"+t.IAU2000]=t:console.log(t);return}}e(D);const F=D;var L=["3857","900913","3785","102113"];function j(t,e){var a,s;if(t=t||{},!e)return t;for(s in e)void 0!==(a=e[s])&&(t[s]=a);return t}function U(t,e,a){var s=t*e;return a/Math.sqrt(1-s*s)}function z(t){return t<0?-1:1}function W(t,e){return e||Math.abs(t)<=3.14159265359?t:t-z(t)*u}function H(t,e,a){var s=t*a,o=.5*t;return s=Math.pow((1-s)/(1+s),o),Math.tan(.5*(r-e))/s}function B(t,e){for(var a,s,o=.5*t,i=r-2*Math.atan(e),n=0;n<=15;n++)if(a=t*Math.sin(i),i+=s=r-2*Math.atan(e*Math.pow((1-a)/(1+a),o))-i,Math.abs(s)<=1e-10)return i;return-9999}function q(t){return t}t.dn(j),t.dn(U),t.dn(z),t.dn(W),t.dn(H),t.dn(B);var J=[{init:function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.long0=this.long0||0,this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=U(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(t){var e,a,s=t.x,o=t.y;if(o*l>90&&o*l<-90&&s*l>180&&s*l<-180)return null;if(Math.abs(Math.abs(o)-r)<=i)return null;if(this.sphere)e=this.x0+this.a*this.k0*W(s-this.long0,this.over),a=this.y0+this.a*this.k0*Math.log(Math.tan(_+.5*o));else{var n=Math.sin(o),u=H(this.e,o,n);e=this.x0+this.a*this.k0*W(s-this.long0,this.over),a=this.y0-this.a*this.k0*Math.log(u)}return t.x=e,t.y=a,t},inverse:function(t){var e,a,s=t.x-this.x0,o=t.y-this.y0;if(this.sphere)a=r-2*Math.atan(Math.exp(-o/(this.a*this.k0)));else{var i=Math.exp(-o/(this.a*this.k0));if(-9999===(a=B(this.e,i)))return null}return e=W(this.long0+s/(this.a*this.k0),this.over),t.x=e,t.y=a,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A","merc"]},{init:function(){},forward:q,inverse:q,names:["longlat","identity","lonlat","latlon","latlong"]}],V={},K=[];function X(t,e){var a=K.length;return t.names?(K[a]=t,t.names.forEach(function(t){V[t.toLowerCase()]=a}),this):(console.log(e),!0)}const Y={start:function(){J.forEach(X)},add:X,get:function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==V[e]&&K[V[e]]||(e=function(t){return t.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}(e))in V&&K[V[e]]?K[V[e]]:void 0}},Z={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,b:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"},WGS84:{a:6378137,rf:298.257223563,ellipseName:"WGS 84"},sphere:{a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}},$=Z.WGS84;var Q={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clrk80ign",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},mgi:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Ordnance Survey of Great Britain 1936"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"},EPSG_5451:{towgs84:"6.41,-49.05,-11.28,1.5657,0.5242,6.9718,-5.7649"},IGNF_LURESG:{towgs84:"-192.986,13.673,-39.309,-0.4099,-2.9332,2.6881,0.43"},EPSG_4614:{towgs84:"-119.4248,-303.65872,-11.00061,1.164298,0.174458,1.096259,3.657065"},EPSG_4615:{towgs84:"-494.088,-312.129,279.877,-1.423,-1.013,1.59,-0.748"},ESRI_37241:{towgs84:"-76.822,257.457,-12.817,2.136,-0.033,-2.392,-0.031"},ESRI_37249:{towgs84:"-440.296,58.548,296.265,1.128,10.202,4.559,-0.438"},ESRI_37245:{towgs84:"-511.151,-181.269,139.609,1.05,2.703,1.798,3.071"},EPSG_4178:{towgs84:"24.9,-126.4,-93.2,-0.063,-0.247,-0.041,1.01"},EPSG_4622:{towgs84:"-472.29,-5.63,-304.12,0.4362,-0.8374,0.2563,1.8984"},EPSG_4625:{towgs84:"126.93,547.94,130.41,-2.7867,5.1612,-0.8584,13.8227"},EPSG_5252:{towgs84:"0.023,0.036,-0.068,0.00176,0.00912,-0.01136,0.00439"},EPSG_4314:{towgs84:"597.1,71.4,412.1,0.894,0.068,-1.563,7.58"},EPSG_4282:{towgs84:"-178.3,-316.7,-131.5,5.278,6.077,10.979,19.166"},EPSG_4231:{towgs84:"-83.11,-97.38,-117.22,0.005693,-0.044698,0.044285,0.1218"},EPSG_4274:{towgs84:"-230.994,102.591,25.199,0.633,-0.239,0.9,1.95"},EPSG_4134:{towgs84:"-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.71006"},EPSG_4254:{towgs84:"18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013"},EPSG_4159:{towgs84:"-194.513,-63.978,-25.759,-3.4027,3.756,-3.352,-0.9175"},EPSG_4687:{towgs84:"0.072,-0.507,-0.245,0.0183,-0.0003,0.007,-0.0093"},EPSG_4227:{towgs84:"-83.58,-397.54,458.78,-17.595,-2.847,4.256,3.225"},EPSG_4746:{towgs84:"599.4,72.4,419.2,-0.062,-0.022,-2.723,6.46"},EPSG_4745:{towgs84:"612.4,77,440.2,-0.054,0.057,-2.797,2.55"},EPSG_6311:{towgs84:"8.846,-4.394,-1.122,-0.00237,-0.146528,0.130428,0.783926"},EPSG_4289:{towgs84:"565.7381,50.4018,465.2904,-0.395026,0.330772,-1.876073,4.07244"},EPSG_4230:{towgs84:"-68.863,-134.888,-111.49,-0.53,-0.14,0.57,-3.4"},EPSG_4154:{towgs84:"-123.02,-158.95,-168.47"},EPSG_4156:{towgs84:"570.8,85.7,462.8,4.998,1.587,5.261,3.56"},EPSG_4299:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4179:{towgs84:"33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84"},EPSG_4313:{towgs84:"-106.8686,52.2978,-103.7239,0.3366,-0.457,1.8422,-1.2747"},EPSG_4194:{towgs84:"163.511,127.533,-159.789"},EPSG_4195:{towgs84:"105,326,-102.5"},EPSG_4196:{towgs84:"-45,417,-3.5"},EPSG_4611:{towgs84:"-162.619,-276.959,-161.764,0.067753,-2.243648,-1.158828,-1.094246"},EPSG_4633:{towgs84:"137.092,131.66,91.475,-1.9436,-11.5993,-4.3321,-7.4824"},EPSG_4641:{towgs84:"-408.809,366.856,-412.987,1.8842,-0.5308,2.1655,-121.0993"},EPSG_4643:{towgs84:"-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7002"},EPSG_4300:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4188:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4660:{towgs84:"982.6087,552.753,-540.873,6.681627,-31.611492,-19.848161,16.805"},EPSG_4662:{towgs84:"97.295,-263.247,310.882,-1.5999,0.8386,3.1409,13.3259"},EPSG_3906:{towgs84:"577.88891,165.22205,391.18289,4.9145,-0.94729,-13.05098,7.78664"},EPSG_4307:{towgs84:"-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547"},EPSG_6892:{towgs84:"-76.269,-16.683,68.562,-6.275,10.536,-4.286,-13.686"},EPSG_4690:{towgs84:"221.597,152.441,176.523,2.403,1.3893,0.884,11.4648"},EPSG_4691:{towgs84:"218.769,150.75,176.75,3.5231,2.0037,1.288,10.9817"},EPSG_4629:{towgs84:"72.51,345.411,79.241,-1.5862,-0.8826,-0.5495,1.3653"},EPSG_4630:{towgs84:"165.804,216.213,180.26,-0.6251,-0.4515,-0.0721,7.4111"},EPSG_4692:{towgs84:"217.109,86.452,23.711,0.0183,-0.0003,0.007,-0.0093"},EPSG_9333:{towgs84:"0,0,0,-0.008393,0.000749,-0.010276,0"},EPSG_9059:{towgs84:"0,0,0"},EPSG_4312:{towgs84:"601.705,84.263,485.227,4.7354,1.3145,5.393,-2.3887"},EPSG_4123:{towgs84:"-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496"},EPSG_4309:{towgs84:"-124.45,183.74,44.64,-0.4384,0.5446,-0.9706,-2.1365"},ESRI_104106:{towgs84:"-283.088,-70.693,117.445,-1.157,0.059,-0.652,-4.058"},EPSG_4281:{towgs84:"-219.247,-73.802,269.529"},EPSG_4322:{towgs84:"0,0,4.5"},EPSG_4324:{towgs84:"0,0,1.9"},EPSG_4284:{towgs84:"43.822,-108.842,-119.585,1.455,-0.761,0.737,0.549"},EPSG_4277:{towgs84:"446.448,-125.157,542.06,0.15,0.247,0.842,-20.489"},EPSG_4207:{towgs84:"-282.1,-72.2,120,-1.529,0.145,-0.89,-4.46"},EPSG_4688:{towgs84:"347.175,1077.618,2623.677,33.9058,-70.6776,9.4013,186.0647"},EPSG_4689:{towgs84:"410.793,54.542,80.501,-2.5596,-2.3517,-0.6594,17.3218"},EPSG_4720:{towgs84:"0,0,4.5"},EPSG_4273:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},EPSG_4240:{towgs84:"204.64,834.74,293.8"},EPSG_4817:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},ESRI_104131:{towgs84:"426.62,142.62,460.09,4.98,4.49,-12.42,-17.1"},EPSG_4265:{towgs84:"-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68"},EPSG_4263:{towgs84:"-111.92,-87.85,114.5,1.875,0.202,0.219,0.032"},EPSG_4298:{towgs84:"-689.5937,623.84046,-65.93566,-0.02331,1.17094,-0.80054,5.88536"},EPSG_4270:{towgs84:"-253.4392,-148.452,386.5267,0.15605,0.43,-0.1013,-0.0424"},EPSG_4229:{towgs84:"-121.8,98.1,-10.7"},EPSG_4220:{towgs84:"-55.5,-348,-229.2"},EPSG_4214:{towgs84:"12.646,-155.176,-80.863"},EPSG_4232:{towgs84:"-345,3,223"},EPSG_4238:{towgs84:"-1.977,-13.06,-9.993,0.364,0.254,0.689,-1.037"},EPSG_4168:{towgs84:"-170,33,326"},EPSG_4131:{towgs84:"199,931,318.9"},EPSG_4152:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_5228:{towgs84:"572.213,85.334,461.94,4.9732,1.529,5.2484,3.5378"},EPSG_8351:{towgs84:"485.021,169.465,483.839,7.786342,4.397554,4.102655,0"},EPSG_4683:{towgs84:"-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06"},EPSG_4133:{towgs84:"0,0,0"},EPSG_7373:{towgs84:"0.819,-0.5762,-1.6446,-0.00378,-0.03317,0.00318,0.0693"},EPSG_9075:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9072:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9294:{towgs84:"1.16835,-1.42001,-2.24431,-0.00822,-0.05508,0.01818,0.23388"},EPSG_4212:{towgs84:"-267.434,173.496,181.814,-13.4704,8.7154,7.3926,14.7492"},EPSG_4191:{towgs84:"-44.183,-0.58,-38.489,2.3867,2.7072,-3.5196,-8.2703"},EPSG_4237:{towgs84:"52.684,-71.194,-13.975,-0.312,-0.1063,-0.3729,1.0191"},EPSG_4740:{towgs84:"-1.08,-0.27,-0.9"},EPSG_4124:{towgs84:"419.3836,99.3335,591.3451,0.850389,1.817277,-7.862238,-0.99496"},EPSG_5681:{towgs84:"584.9636,107.7175,413.8067,1.1155,0.2824,-3.1384,7.9922"},EPSG_4141:{towgs84:"23.772,17.49,17.859,-0.3132,-1.85274,1.67299,-5.4262"},EPSG_4204:{towgs84:"-85.645,-273.077,-79.708,2.289,-1.421,2.532,3.194"},EPSG_4319:{towgs84:"226.702,-193.337,-35.371,-2.229,-4.391,9.238,0.9798"},EPSG_4200:{towgs84:"24.82,-131.21,-82.66"},EPSG_4130:{towgs84:"0,0,0"},EPSG_4127:{towgs84:"-82.875,-57.097,-156.768,-2.158,1.524,-0.982,-0.359"},EPSG_4149:{towgs84:"674.374,15.056,405.346"},EPSG_4617:{towgs84:"-0.991,1.9072,0.5129,0.02579,0.00965,0.01166,0"},EPSG_4663:{towgs84:"-210.502,-66.902,-48.476,2.094,-15.067,-5.817,0.485"},EPSG_4664:{towgs84:"-211.939,137.626,58.3,-0.089,0.251,0.079,0.384"},EPSG_4665:{towgs84:"-105.854,165.589,-38.312,-0.003,-0.026,0.024,-0.048"},EPSG_4666:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},EPSG_4756:{towgs84:"-192.873,-39.382,-111.202,-0.00205,-0.0005,0.00335,0.0188"},EPSG_4723:{towgs84:"-179.483,-69.379,-27.584,-7.862,8.163,6.042,-13.925"},EPSG_4726:{towgs84:"8.853,-52.644,180.304,-0.393,-2.323,2.96,-24.081"},EPSG_4267:{towgs84:"-8.0,160.0,176.0"},EPSG_5365:{towgs84:"-0.16959,0.35312,0.51846,0.03385,-0.16325,0.03446,0.03693"},EPSG_4218:{towgs84:"304.5,306.5,-318.1"},EPSG_4242:{towgs84:"-33.722,153.789,94.959,-8.581,-4.478,4.54,8.95"},EPSG_4216:{towgs84:"-292.295,248.758,429.447,4.9971,2.99,6.6906,1.0289"},ESRI_104105:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},ESRI_104129:{towgs84:"0,0,0"},EPSG_4673:{towgs84:"174.05,-25.49,112.57"},EPSG_4202:{towgs84:"-124,-60,154"},EPSG_4203:{towgs84:"-117.763,-51.51,139.061,0.292,0.443,0.277,-0.191"},EPSG_3819:{towgs84:"595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408"},EPSG_8694:{towgs84:"-93.799,-132.737,-219.073,-1.844,0.648,-6.37,-0.169"},EPSG_4145:{towgs84:"275.57,676.78,229.6"},EPSG_4283:{towgs84:"0.06155,-0.01087,-0.04019,0.039492,0.032722,0.032898,-0.009994"},EPSG_4317:{towgs84:"2.3287,-147.0425,-92.0802,-0.309248,0.324822,0.497299,5.689063"},EPSG_4272:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993"},EPSG_4248:{towgs84:"-307.7,265.3,-363.5"},EPSG_5561:{towgs84:"24,-121,-76"},EPSG_5233:{towgs84:"-0.293,766.95,87.713,0.195704,1.695068,3.473016,-0.039338"},ESRI_104130:{towgs84:"-86,-98,-119"},ESRI_104102:{towgs84:"682,-203,480"},ESRI_37207:{towgs84:"7,-10,-26"},EPSG_4675:{towgs84:"59.935,118.4,-10.871"},ESRI_104109:{towgs84:"-89.121,-348.182,260.871"},ESRI_104112:{towgs84:"-185.583,-230.096,281.361"},ESRI_104113:{towgs84:"25.1,-275.6,222.6"},IGNF_WGS72G:{towgs84:"0,12,6"},IGNF_NTFG:{towgs84:"-168,-60,320"},IGNF_EFATE57G:{towgs84:"-127,-769,472"},IGNF_PGP50G:{towgs84:"324.8,153.6,172.1"},IGNF_REUN47G:{towgs84:"94,-948,-1262"},IGNF_CSG67G:{towgs84:"-186,230,110"},IGNF_GUAD48G:{towgs84:"-467,-16,-300"},IGNF_TAHI51G:{towgs84:"162,117,154"},IGNF_TAHAAG:{towgs84:"65,342,77"},IGNF_NUKU72G:{towgs84:"84,274,65"},IGNF_PETRELS72G:{towgs84:"365,194,166"},IGNF_WALL78G:{towgs84:"253,-133,-127"},IGNF_MAYO50G:{towgs84:"-382,-59,-262"},IGNF_TANNAG:{towgs84:"-139,-967,436"},IGNF_IGN72G:{towgs84:"-13,-348,292"},IGNF_ATIGG:{towgs84:"1118,23,66"},IGNF_FANGA84G:{towgs84:"150.57,158.33,118.32"},IGNF_RUSAT84G:{towgs84:"202.13,174.6,-15.74"},IGNF_KAUE70G:{towgs84:"126.74,300.1,-75.49"},IGNF_MOP90G:{towgs84:"-10.8,-1.8,12.77"},IGNF_MHPF67G:{towgs84:"338.08,212.58,-296.17"},IGNF_TAHI79G:{towgs84:"160.61,116.05,153.69"},IGNF_ANAA92G:{towgs84:"1.5,3.84,4.81"},IGNF_MARQUI72G:{towgs84:"330.91,-13.92,58.56"},IGNF_APAT86G:{towgs84:"143.6,197.82,74.05"},IGNF_TUBU69G:{towgs84:"237.17,171.61,-77.84"},IGNF_STPM50G:{towgs84:"11.363,424.148,373.13"},EPSG_4150:{towgs84:"674.374,15.056,405.346"},EPSG_4754:{towgs84:"-208.4058,-109.8777,-2.5764"},ESRI_104101:{towgs84:"372.87,149.23,585.29"},EPSG_4693:{towgs84:"0,-0.15,0.68"},EPSG_6207:{towgs84:"293.17,726.18,245.36"},EPSG_4153:{towgs84:"-133.63,-157.5,-158.62"},EPSG_4132:{towgs84:"-241.54,-163.64,396.06"},EPSG_4221:{towgs84:"-154.5,150.7,100.4"},EPSG_4266:{towgs84:"-80.7,-132.5,41.1"},EPSG_4193:{towgs84:"-70.9,-151.8,-41.4"},EPSG_5340:{towgs84:"-0.41,0.46,-0.35"},EPSG_4246:{towgs84:"-294.7,-200.1,525.5"},EPSG_4318:{towgs84:"-3.2,-5.7,2.8"},EPSG_4121:{towgs84:"-199.87,74.79,246.62"},EPSG_4223:{towgs84:"-260.1,5.5,432.2"},EPSG_4158:{towgs84:"-0.465,372.095,171.736"},EPSG_4285:{towgs84:"-128.16,-282.42,21.93"},EPSG_4613:{towgs84:"-404.78,685.68,45.47"},EPSG_4607:{towgs84:"195.671,332.517,274.607"},EPSG_4475:{towgs84:"-381.788,-57.501,-256.673"},EPSG_4208:{towgs84:"-157.84,308.54,-146.6"},EPSG_4743:{towgs84:"70.995,-335.916,262.898"},EPSG_4710:{towgs84:"-323.65,551.39,-491.22"},EPSG_7881:{towgs84:"-0.077,0.079,0.086"},EPSG_4682:{towgs84:"283.729,735.942,261.143"},EPSG_4739:{towgs84:"-156,-271,-189"},EPSG_4679:{towgs84:"-80.01,253.26,291.19"},EPSG_4750:{towgs84:"-56.263,16.136,-22.856"},EPSG_4644:{towgs84:"-10.18,-350.43,291.37"},EPSG_4695:{towgs84:"-103.746,-9.614,-255.95"},EPSG_4292:{towgs84:"-355,21,72"},EPSG_4302:{towgs84:"-61.702,284.488,472.052"},EPSG_4143:{towgs84:"-124.76,53,466.79"},EPSG_4606:{towgs84:"-153,153,307"},EPSG_4699:{towgs84:"-770.1,158.4,-498.2"},EPSG_4247:{towgs84:"-273.5,110.6,-357.9"},EPSG_4160:{towgs84:"8.88,184.86,106.69"},EPSG_4161:{towgs84:"-233.43,6.65,173.64"},EPSG_9251:{towgs84:"-9.5,122.9,138.2"},EPSG_9253:{towgs84:"-78.1,101.6,133.3"},EPSG_4297:{towgs84:"-198.383,-240.517,-107.909"},EPSG_4269:{towgs84:"0,0,0"},EPSG_4301:{towgs84:"-147,506,687"},EPSG_4618:{towgs84:"-59,-11,-52"},EPSG_4612:{towgs84:"0,0,0"},EPSG_4678:{towgs84:"44.585,-131.212,-39.544"},EPSG_4250:{towgs84:"-130,29,364"},EPSG_4144:{towgs84:"214,804,268"},EPSG_4147:{towgs84:"-17.51,-108.32,-62.39"},EPSG_4259:{towgs84:"-254.1,-5.36,-100.29"},EPSG_4164:{towgs84:"-76,-138,67"},EPSG_4211:{towgs84:"-378.873,676.002,-46.255"},EPSG_4182:{towgs84:"-422.651,-172.995,84.02"},EPSG_4224:{towgs84:"-143.87,243.37,-33.52"},EPSG_4225:{towgs84:"-205.57,168.77,-4.12"},EPSG_5527:{towgs84:"-67.35,3.88,-38.22"},EPSG_4752:{towgs84:"98,390,-22"},EPSG_4310:{towgs84:"-30,190,89"},EPSG_9248:{towgs84:"-192.26,65.72,132.08"},EPSG_4680:{towgs84:"124.5,-63.5,-281"},EPSG_4701:{towgs84:"-79.9,-158,-168.9"},EPSG_4706:{towgs84:"-146.21,112.63,4.05"},EPSG_4805:{towgs84:"682,-203,480"},EPSG_4201:{towgs84:"-165,-11,206"},EPSG_4210:{towgs84:"-157,-2,-299"},EPSG_4183:{towgs84:"-104,167,-38"},EPSG_4139:{towgs84:"11,72,-101"},EPSG_4668:{towgs84:"-86,-98,-119"},EPSG_4717:{towgs84:"-2,151,181"},EPSG_4732:{towgs84:"102,52,-38"},EPSG_4280:{towgs84:"-377,681,-50"},EPSG_4209:{towgs84:"-138,-105,-289"},EPSG_4261:{towgs84:"31,146,47"},EPSG_4658:{towgs84:"-73,46,-86"},EPSG_4721:{towgs84:"265.025,384.929,-194.046"},EPSG_4222:{towgs84:"-136,-108,-292"},EPSG_4601:{towgs84:"-255,-15,71"},EPSG_4602:{towgs84:"725,685,536"},EPSG_4603:{towgs84:"72,213.7,93"},EPSG_4605:{towgs84:"9,183,236"},EPSG_4621:{towgs84:"137,248,-430"},EPSG_4657:{towgs84:"-28,199,5"},EPSG_4316:{towgs84:"103.25,-100.4,-307.19"},EPSG_4642:{towgs84:"-13,-348,292"},EPSG_4698:{towgs84:"145,-187,103"},EPSG_4192:{towgs84:"-206.1,-174.7,-87.7"},EPSG_4311:{towgs84:"-265,120,-358"},EPSG_4135:{towgs84:"58,-283,-182"},ESRI_104138:{towgs84:"198,-226,-347"},EPSG_4245:{towgs84:"-11,851,5"},EPSG_4142:{towgs84:"-125,53,467"},EPSG_4213:{towgs84:"-106,-87,188"},EPSG_4253:{towgs84:"-133,-77,-51"},EPSG_4129:{towgs84:"-132,-110,-335"},EPSG_4713:{towgs84:"-77,-128,142"},EPSG_4239:{towgs84:"217,823,299"},EPSG_4146:{towgs84:"295,736,257"},EPSG_4155:{towgs84:"-83,37,124"},EPSG_4165:{towgs84:"-173,253,27"},EPSG_4672:{towgs84:"175,-38,113"},EPSG_4236:{towgs84:"-637,-549,-203"},EPSG_4251:{towgs84:"-90,40,88"},EPSG_4271:{towgs84:"-2,374,172"},EPSG_4175:{towgs84:"-88,4,101"},EPSG_4716:{towgs84:"298,-304,-375"},EPSG_4315:{towgs84:"-23,259,-9"},EPSG_4744:{towgs84:"-242.2,-144.9,370.3"},EPSG_4244:{towgs84:"-97,787,86"},EPSG_4293:{towgs84:"616,97,-251"},EPSG_4714:{towgs84:"-127,-769,472"},EPSG_4736:{towgs84:"260,12,-147"},EPSG_6883:{towgs84:"-235,-110,393"},EPSG_6894:{towgs84:"-63,176,185"},EPSG_4205:{towgs84:"-43,-163,45"},EPSG_4256:{towgs84:"41,-220,-134"},EPSG_4262:{towgs84:"639,405,60"},EPSG_4604:{towgs84:"174,359,365"},EPSG_4169:{towgs84:"-115,118,426"},EPSG_4620:{towgs84:"-106,-129,165"},EPSG_4184:{towgs84:"-203,141,53"},EPSG_4616:{towgs84:"-289,-124,60"},EPSG_9403:{towgs84:"-307,-92,127"},EPSG_4684:{towgs84:"-133,-321,50"},EPSG_4708:{towgs84:"-491,-22,435"},EPSG_4707:{towgs84:"114,-116,-333"},EPSG_4709:{towgs84:"145,75,-272"},EPSG_4712:{towgs84:"-205,107,53"},EPSG_4711:{towgs84:"124,-234,-25"},EPSG_4718:{towgs84:"230,-199,-752"},EPSG_4719:{towgs84:"211,147,111"},EPSG_4724:{towgs84:"208,-435,-229"},EPSG_4725:{towgs84:"189,-79,-202"},EPSG_4735:{towgs84:"647,1777,-1124"},EPSG_4722:{towgs84:"-794,119,-298"},EPSG_4728:{towgs84:"-307,-92,127"},EPSG_4734:{towgs84:"-632,438,-609"},EPSG_4727:{towgs84:"912,-58,1227"},EPSG_4729:{towgs84:"185,165,42"},EPSG_4730:{towgs84:"170,42,84"},EPSG_4733:{towgs84:"276,-57,149"},ESRI_37218:{towgs84:"230,-199,-752"},ESRI_37240:{towgs84:"-7,215,225"},ESRI_37221:{towgs84:"252,-209,-751"},ESRI_4305:{towgs84:"-123,-206,219"},ESRI_104139:{towgs84:"-73,-247,227"},EPSG_4748:{towgs84:"51,391,-36"},EPSG_4219:{towgs84:"-384,664,-48"},EPSG_4255:{towgs84:"-333,-222,114"},EPSG_4257:{towgs84:"-587.8,519.75,145.76"},EPSG_4646:{towgs84:"-963,510,-359"},EPSG_6881:{towgs84:"-24,-203,268"},EPSG_6882:{towgs84:"-183,-15,273"},EPSG_4715:{towgs84:"-104,-129,239"},IGNF_RGF93GDD:{towgs84:"0,0,0"},IGNF_RGM04GDD:{towgs84:"0,0,0"},IGNF_RGSPM06GDD:{towgs84:"0,0,0"},IGNF_RGTAAF07GDD:{towgs84:"0,0,0"},IGNF_RGFG95GDD:{towgs84:"0,0,0"},IGNF_RGNCG:{towgs84:"0,0,0"},IGNF_RGPFGDD:{towgs84:"0,0,0"},IGNF_ETRS89G:{towgs84:"0,0,0"},IGNF_RGR92GDD:{towgs84:"0,0,0"},EPSG_4173:{towgs84:"0,0,0"},EPSG_4180:{towgs84:"0,0,0"},EPSG_4619:{towgs84:"0,0,0"},EPSG_4667:{towgs84:"0,0,0"},EPSG_4075:{towgs84:"0,0,0"},EPSG_6706:{towgs84:"0,0,0"},EPSG_7798:{towgs84:"0,0,0"},EPSG_4661:{towgs84:"0,0,0"},EPSG_4669:{towgs84:"0,0,0"},EPSG_8685:{towgs84:"0,0,0"},EPSG_4151:{towgs84:"0,0,0"},EPSG_9702:{towgs84:"0,0,0"},EPSG_4758:{towgs84:"0,0,0"},EPSG_4761:{towgs84:"0,0,0"},EPSG_4765:{towgs84:"0,0,0"},EPSG_8997:{towgs84:"0,0,0"},EPSG_4023:{towgs84:"0,0,0"},EPSG_4670:{towgs84:"0,0,0"},EPSG_4694:{towgs84:"0,0,0"},EPSG_4148:{towgs84:"0,0,0"},EPSG_4163:{towgs84:"0,0,0"},EPSG_4167:{towgs84:"0,0,0"},EPSG_4189:{towgs84:"0,0,0"},EPSG_4190:{towgs84:"0,0,0"},EPSG_4176:{towgs84:"0,0,0"},EPSG_4659:{towgs84:"0,0,0"},EPSG_3824:{towgs84:"0,0,0"},EPSG_3889:{towgs84:"0,0,0"},EPSG_4046:{towgs84:"0,0,0"},EPSG_4081:{towgs84:"0,0,0"},EPSG_4558:{towgs84:"0,0,0"},EPSG_4483:{towgs84:"0,0,0"},EPSG_5013:{towgs84:"0,0,0"},EPSG_5264:{towgs84:"0,0,0"},EPSG_5324:{towgs84:"0,0,0"},EPSG_5354:{towgs84:"0,0,0"},EPSG_5371:{towgs84:"0,0,0"},EPSG_5373:{towgs84:"0,0,0"},EPSG_5381:{towgs84:"0,0,0"},EPSG_5393:{towgs84:"0,0,0"},EPSG_5489:{towgs84:"0,0,0"},EPSG_5593:{towgs84:"0,0,0"},EPSG_6135:{towgs84:"0,0,0"},EPSG_6365:{towgs84:"0,0,0"},EPSG_5246:{towgs84:"0,0,0"},EPSG_7886:{towgs84:"0,0,0"},EPSG_8431:{towgs84:"0,0,0"},EPSG_8427:{towgs84:"0,0,0"},EPSG_8699:{towgs84:"0,0,0"},EPSG_8818:{towgs84:"0,0,0"},EPSG_4757:{towgs84:"0,0,0"},EPSG_9140:{towgs84:"0,0,0"},EPSG_8086:{towgs84:"0,0,0"},EPSG_4686:{towgs84:"0,0,0"},EPSG_4737:{towgs84:"0,0,0"},EPSG_4702:{towgs84:"0,0,0"},EPSG_4747:{towgs84:"0,0,0"},EPSG_4749:{towgs84:"0,0,0"},EPSG_4674:{towgs84:"0,0,0"},EPSG_4755:{towgs84:"0,0,0"},EPSG_4759:{towgs84:"0,0,0"},EPSG_4762:{towgs84:"0,0,0"},EPSG_4763:{towgs84:"0,0,0"},EPSG_4764:{towgs84:"0,0,0"},EPSG_4166:{towgs84:"0,0,0"},EPSG_4170:{towgs84:"0,0,0"},EPSG_5546:{towgs84:"0,0,0"},EPSG_7844:{towgs84:"0,0,0"},EPSG_4818:{towgs84:"589,76,480"},EPSG_10328:{towgs84:"0,0,0"},EPSG_9782:{towgs84:"0,0,0"},EPSG_9777:{towgs84:"0,0,0"},EPSG_10690:{towgs84:"0,0,0"},EPSG_10639:{towgs84:"0,0,0"},EPSG_10739:{towgs84:"0,0,0"},EPSG_7686:{towgs84:"0,0,0"},EPSG_8900:{towgs84:"0,0,0"},EPSG_5886:{towgs84:"0,0,0"},EPSG_7683:{towgs84:"0,0,0"},EPSG_6668:{towgs84:"0,0,0"},EPSG_20046:{towgs84:"0,0,0"},EPSG_10299:{towgs84:"0,0,0"},EPSG_10310:{towgs84:"0,0,0"},EPSG_10475:{towgs84:"0,0,0"},EPSG_4742:{towgs84:"0,0,0"},EPSG_10671:{towgs84:"0,0,0"},EPSG_10762:{towgs84:"0,0,0"},EPSG_10725:{towgs84:"0,0,0"},EPSG_10791:{towgs84:"0,0,0"},EPSG_10800:{towgs84:"0,0,0"},EPSG_10305:{towgs84:"0,0,0"},EPSG_10941:{towgs84:"0,0,0"},EPSG_10968:{towgs84:"0,0,0"},EPSG_10875:{towgs84:"0,0,0"},EPSG_6318:{towgs84:"0,0,0"},EPSG_10910:{towgs84:"0,0,0"}};for(var tt in Q){var et=Q[tt];et.datumName&&(Q[et.datumName]=et)}const at=Q;var st={};function ot(t){if(0===t.length)return null;var e="@"===t[0];return e&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:st[t]||null,isNull:!1}}function rt(t,e){if(!(this instanceof rt))return new rt(t);this.forward=null,this.inverse=null,this.init=null,this.name,this.axis,this.names=null,this.title,e=e||function(t){if(t)throw t};var a=function(t){let e;if(function(t){return"string"==typeof t}(t))if(function(t){return t in F}(t))e=F[t];else if(function(t){return 0!==t.indexOf("+")&&-1!==t.indexOf("[")||"object"==typeof t&&!("srsCode"in t)}(t)){e=k(t);var a=function(t){var e=m(t,"extension");if(e)return m(e,"proj4")}(e);a&&(e=G(a))}else(function(t){return"+"===t[0]})(t)&&(e=G(t));else e="projName"in t?t:k(t);return e&&function(t){if(t.title)return 0===t.title.toLowerCase().indexOf("epsg:")&&L.indexOf(t.title.substr(5))>-1;var e=m(t,"authority");if(e){var a=m(e,"epsg");return a&&L.indexOf(a)>-1}}(e)?F["EPSG:3857"]:e}(t);if("object"==typeof a){var s=rt.projections.get(a.projName);if(s){if(a.datumCode&&"none"!==a.datumCode){var r=m(at,a.datumCode);r&&(a.datum_params=a.datum_params||(r.towgs84?r.towgs84.split(","):null),a.ellps=r.ellipse,a.datumName=r.datumName?r.datumName:a.datumCode)}a.axis=a.axis||"enu",a.ellps=a.ellps||"wgs84",a.lat1=a.lat1||a.lat0;var n,l,_,u,g,d,c=function(t,e,a,s,o){if(!t){var r=m(Z,s);r||(r=$),t=r.a,e=r.b,a=r.rf}return a&&!e&&(e=(1-1/a)*t),(0===a||Math.abs(t-e)<i)&&(o=!0,e=t),{a:t,b:e,rf:a,sphere:o}}(a.a,a.b,a.rf,a.ellps,a.sphere),S=(n=c.a,l=c.b,c.rf,g=((_=n*n)-(u=l*l))/_,d=0,a.R_A?(_=(n*=1-g*(.16666666666666666+g*(.04722222222222222+.022156084656084655*g)))*n,g=0):d=Math.sqrt(g),{es:g,e:d,ep2:(_-u)/u}),E=function(t){return void 0===t?null:t.split(",").map(ot)}(a.nadgrids),w=a.datum||function(t,e,a,s,r,i,n){var l={datum_type:5};return e&&(l.datum_type=4,l.datum_params=e.map(parseFloat),0===l.datum_params[0]&&0===l.datum_params[1]&&0===l.datum_params[2]||(l.datum_type=1),l.datum_params.length>3&&(0===l.datum_params[3]&&0===l.datum_params[4]&&0===l.datum_params[5]&&0===l.datum_params[6]||(l.datum_type=2,l.datum_params[3]*=o,l.datum_params[4]*=o,l.datum_params[5]*=o,l.datum_params[6]=l.datum_params[6]/1e6+1))),n&&(l.datum_type=3,l.grids=n),l.a=a,l.b=s,l.es=r,l.ep2=i,l}(a.datumCode,a.datum_params,c.a,c.b,S.es,S.ep2,E);j(this,a),j(this,s),this.a=c.a,this.b=c.b,this.rf=c.rf,this.sphere=c.sphere,this.es=S.es,this.e=S.e,this.ep2=S.ep2,this.datum=w,"init"in this&&"function"==typeof this.init&&this.init(),this.k0||(this.k0=1),e(null,this)}else e("Could not get projection name from: "+t)}else e("Could not parse to valid json: "+t)}rt.projections=Y,rt.projections.start();const it=rt;function nt(t){return 1===t||2===t}function lt(t,e,o){if(function(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?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:2!==t.datum_type||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])}(t,e))return o;if(5===t.datum_type||5===e.datum_type)return o;var i=t.a,n=t.es;if(3===t.datum_type){if(0!==_t(t,!1,o))return;i=a,n=s}var l=e.a,_=e.b,u=e.es;return 3===e.datum_type&&(l=a,_=6356752.314,u=s),n!==u||i!==l||nt(t.datum_type)||nt(e.datum_type)?(o=function(t,e,a){var s,o,i,n,l=t.x,_=t.y,u=t.z?t.z:0;if(_<-r&&_>-1.001*r)_=-r;else if(_>r&&_<1.001*r)_=r;else{if(_<-r)return{x:-1/0,y:-1/0,z:t.z};if(_>r)return{x:1/0,y:1/0,z:t.z}}return l>Math.PI&&(l-=2*Math.PI),o=Math.sin(_),n=Math.cos(_),i=o*o,{x:((s=a/Math.sqrt(1-e*i))+u)*n*Math.cos(l),y:(s+u)*n*Math.sin(l),z:(s*(1-e)+u)*o}}(o,n,i),nt(t.datum_type)&&(o=function(t,e,a){if(1===e)return{x:t.x+a[0],y:t.y+a[1],z:t.z+a[2]};if(2===e){var s=a[0],o=a[1],r=a[2],i=a[3],n=a[4],l=a[5],_=a[6];return{x:_*(t.x-l*t.y+n*t.z)+s,y:_*(l*t.x+t.y-i*t.z)+o,z:_*(-n*t.x+i*t.y+t.z)+r}}}(o,t.datum_type,t.datum_params)),nt(e.datum_type)&&(o=function(t,e,a){if(1===e)return{x:t.x-a[0],y:t.y-a[1],z:t.z-a[2]};if(2===e){var s=a[0],o=a[1],r=a[2],i=a[3],n=a[4],l=a[5],_=a[6],u=(t.x-s)/_,g=(t.y-o)/_,d=(t.z-r)/_;return{x:u+l*g-n*d,y:-l*u+g+i*d,z:n*u-i*g+d}}}(o,e.datum_type,e.datum_params)),o=function(t,e,a,s){var o,r,i,n,l,_,u,g,d,c,m,G,S,E,w,f=t.x,h=t.y,P=t.z?t.z:0;if(o=Math.sqrt(f*f+h*h),r=Math.sqrt(f*f+h*h+P*P),o/a<1e-12){if(E=0,r/a<1e-12)return w=-s,{x:t.x,y:t.y,z:t.z}}else E=Math.atan2(h,f);i=P/r,g=(n=o/r)*(1-e)*(l=1/Math.sqrt(1-e*(2-e)*n*n)),d=i*l,S=0;do{S++,_=e*(u=a/Math.sqrt(1-e*d*d))/(u+(w=o*g+P*d-u*(1-e*d*d))),G=(m=i*(l=1/Math.sqrt(1-_*(2-_)*n*n)))*g-(c=n*(1-_)*l)*d,g=c,d=m}while(G*G>1e-24&&S<30);return{x:E,y:Math.atan(m/Math.abs(c)),z:w}}(o,u,l,_),3!==e.datum_type||0===_t(e,!0,o)?o:void 0):o}function _t(t,e,a){if(null===t.grids||0===t.grids.length)return console.log("Grid shift grids not found"),-1;var s={x:-a.x,y:a.y},o={x:Number.NaN,y:Number.NaN},r=[];t:for(var i=0;i<t.grids.length;i++){var n=t.grids[i];if(r.push(n.name),n.isNull){o=s;break}if(null!==n.grid)for(var _=n.grid.subgrids,u=0,g=_.length;u<g;u++){var d=_[u],c=(Math.abs(d.del[1])+Math.abs(d.del[0]))/1e4,m=d.ll[0]-c,G=d.ll[1]-c,S=d.ll[0]+(d.lim[0]-1)*d.del[0]+c,E=d.ll[1]+(d.lim[1]-1)*d.del[1]+c;if(!(G>s.y||m>s.x||E<s.y||S<s.x||(o=ut(s,e,d),isNaN(o.x))))break t}else if(n.mandatory)return console.log("Unable to find mandatory grid '"+n.name+"'"),-1}return isNaN(o.x)?(console.log("Failed to find a grid shift table for location '"+-s.x*l+" "+s.y*l+" tried: '"+r+"'"),-1):(a.x=-o.x,a.y=o.y,0)}function ut(t,e,a){var s={x:Number.NaN,y:Number.NaN};if(isNaN(t.x))return s;var o={x:t.x,y:t.y};o.x-=a.ll[0],o.y-=a.ll[1],o.x=W(o.x-Math.PI)+Math.PI;var r=gt(o,a);if(e){if(isNaN(r.x))return s;r.x=o.x-r.x,r.y=o.y-r.y;var i,n,l=9;do{if(n=gt(r,a),isNaN(n.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}i={x:o.x-(n.x+r.x),y:o.y-(n.y+r.y)},r.x+=i.x,r.y+=i.y}while(l--&&Math.abs(i.x)>1e-12&&Math.abs(i.y)>1e-12);if(l<0)return console.log("Inverse grid shift iterator failed to converge."),s;s.x=W(r.x+a.ll[0]),s.y=r.y+a.ll[1]}else isNaN(r.x)||(s.x=t.x+r.x,s.y=t.y+r.y);return s}function gt(t,e){var a,s={x:t.x/e.del[0],y:t.y/e.del[1]},o=Math.floor(s.x),r=Math.floor(s.y),i=s.x-1*o,n=s.y-1*r,l={x:Number.NaN,y:Number.NaN};if(o<0||o>=e.lim[0])return l;if(r<0||r>=e.lim[1])return l;a=r*e.lim[0]+o;var _=e.cvs[a][0],u=e.cvs[a][1];a++;var g=e.cvs[a][0],d=e.cvs[a][1];a+=e.lim[0];var c=e.cvs[a][0],m=e.cvs[a][1];a--;var G=e.cvs[a][0],S=e.cvs[a][1],E=i*n,w=i*(1-n),f=(1-i)*(1-n),h=(1-i)*n;return l.x=f*_+w*g+h*G+E*c,l.y=f*u+w*d+h*S+E*m,l}t.dn(lt);var dt=["x","y","z"];function ct(t){mt(t.x),mt(t.y)}function mt(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function Gt(t,e,a,s){var o,r=void 0!==a.z;if(ct(a),t.datum&&e.datum&&function(t,e){return(1===t.datum.datum_type||2===t.datum.datum_type||3===t.datum.datum_type)&&"WGS84"!==e.datumCode||(1===e.datum.datum_type||2===e.datum.datum_type||3===e.datum.datum_type)&&"WGS84"!==t.datumCode}(t,e)&&(a=Gt(t,o=new it("WGS84"),a,s),t=o),s&&"enu"!==t.axis&&(a=function(t,e){const a={};for(let s=0,o=t.axis.length;s<o;s++){if(2===s&&void 0===e.z)continue;let o=e[dt[s]];switch(t.axis[s]){case"e":a.x=o;break;case"w":a.x=-o;break;case"n":a.y=o;break;case"s":a.y=-o;break;case"u":a.z=o;break;case"d":a.z=-o;break;default:return null}}return a}(t,a)),"longlat"===t.projName)a={x:a.x*n,y:a.y*n,z:a.z||0};else if(t.to_meter&&(a={x:a.x*t.to_meter,y:a.y*t.to_meter,z:a.z||0}),!(a=t.inverse(a)))return;if(t.from_greenwich&&(a.x+=t.from_greenwich),a=lt(t.datum,e.datum,a))return e.from_greenwich&&(a={x:a.x-e.from_greenwich,y:a.y,z:a.z||0}),"longlat"===e.projName?(void 0!==e.long_wrap&&(a.x=e.long_wrap+W(a.x-e.long_wrap)),a={x:a.x*l,y:a.y*l,z:a.z||0}):(a=e.forward(a),e.to_meter&&(a={x:a.x/e.to_meter,y:a.y/e.to_meter,z:a.z||0})),s&&"enu"!==e.axis?function(t,e){const a={};for(let s=0,o=t.axis.length;s<o;s++)if(2!==s||void 0!==e.z)switch(t.axis[s]){case"e":a[dt[s]]=e.x;break;case"w":a[dt[s]]=-e.x;break;case"n":a[dt[s]]=e.y;break;case"s":a[dt[s]]=-e.y;break;case"u":a[dt[s]]=e.z;break;case"d":a[dt[s]]=-e.z;break;default:return null}return a}(e,a):(a&&!r&&"geocent"!==e.projName&&delete a.z,a)}function St(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}t.dn(ct),t.dn(St);var Et=it("WGS84");function wt(t,e,a,s){var o,r,i;return Array.isArray(a)?(o=Gt(t,e,St(a),s)||{x:NaN,y:NaN},a.length>2?(r=void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name)?"number"==typeof o.z?[o.x,o.y,o.z].concat(a.slice(3)):[o.x,o.y,a[2]].concat(a.slice(3)):s&&"number"==typeof o.z?[o.x,o.y,o.z].concat(a.slice(3)):[o.x,o.y].concat(a.slice(2)):[o.x,o.y]):(o=Gt(t,e,{x:a.x,y:a.y,z:a.z,m:a.m},s)||{x:NaN,y:NaN},2===(i=Object.keys(a)).length||(r=void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name,i.forEach(function(t){"x"!==t&&"y"!==t&&("z"===t&&(r||s)||(o[t]=a[t]))})),o)}function ft(t){return t instanceof it?t:"object"==typeof t&&"oProj"in t?t.oProj:it(t)}const ht={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,!(Math.abs(this.lat1+this.lat2)<i)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var e=Math.sin(this.lat1),a=Math.cos(this.lat1),s=U(this.e,e,a),o=H(this.e,this.lat1,e),n=Math.sin(this.lat2),l=Math.cos(this.lat2),_=U(this.e,n,l),u=H(this.e,this.lat2,n),g=H(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>i?this.ns=Math.log(s/_)/Math.log(o/u):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=s/(this.ns*Math.pow(o,this.ns)),this.rh=Math.abs(Math.abs(this.lat0)-r)<i?0:this.a*this.f0*Math.pow(g,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var e=t.x,a=t.y;Math.abs(2*Math.abs(a)-Math.PI)<=i&&(a=z(a)*(r-2e-10));var s,o,n=Math.abs(Math.abs(a)-r);if(n>i)s=H(this.e,a,Math.sin(a)),o=this.a*this.f0*Math.pow(s,this.ns);else{if((n=a*this.ns)<=0)return null;o=0}var l=this.ns*W(e-this.long0,this.over);return t.x=this.k0*(o*Math.sin(l))+this.x0,t.y=this.k0*(this.rh-o*Math.cos(l))+this.y0,t},inverse:function(t){var e,a,s,o,i,n=(t.x-this.x0)/this.k0,l=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(n*n+l*l),a=1):(e=-Math.sqrt(n*n+l*l),a=-1);var _=0;if(0!==e&&(_=Math.atan2(a*n,a*l)),0!==e||this.ns>0){if(a=1/this.ns,s=Math.pow(e/(this.a*this.f0),a),-9999===(o=B(this.e,s)))return null}else o=-r;return i=W(_/this.ns+this.long0,this.over),t.x=i,t.y=o,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]};it.projections.add(ht),globalThis.proj4=function(t,e,a){var s,o,r,i=!1;return void 0===e?(o=ft(t),s=Et,i=!0):(void 0!==e.x||Array.isArray(e))&&(a=e,o=ft(t),s=Et,i=!0),s||(s=ft(t)),o||(o=ft(e)),a?wt(s,o,a):(r={forward:function(t,e){return wt(s,o,t,e)},inverse:function(t,e){return wt(o,s,t,e)}},i&&(r.oProj=o),r)}})(); |