1 |
- define(["exports","./Cartographic-67e73ef9","./Check-52a7d806","./when-92c6cf3c","./Math-92c3b5f7"],(function(t,e,r,a,n){"use strict";function i(t,i,o,u){i=a.u(i,0),o=a.u(o,0),u=a.u(u,0),r.o.typeOf.number.greaterThanOrEquals("x",i,0),r.o.typeOf.number.greaterThanOrEquals("y",o,0),r.o.typeOf.number.greaterThanOrEquals("z",u,0),n.e.equalsEpsilon(u,6356752.314245179,n.e.EPSILON10)&&(n.e.Radius=u),t._radii=new e.t(i,o,u),t._radiiSquared=new e.t(i*i,o*o,u*u),t._radiiToTheFourth=new e.t(i*i*i*i,o*o*o*o,u*u*u*u),t._oneOverRadii=new e.t(0===i?0:1/i,0===o?0:1/o,0===u?0:1/u),t._oneOverRadiiSquared=new e.t(0===i?0:1/(i*i),0===o?0:1/(o*o),0===u?0:1/(u*u)),t._minimumRadius=Math.min(i,o,u),t._maximumRadius=Math.max(i,o,u),t._centerToleranceSquared=n.e.EPSILON1,0!==t._radiiSquared.z&&(t._squaredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function o(t,e,r){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,i(this,t,e,r)}Object.defineProperties(o.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}}),o.clone=function(t,r){if(a.e(t)){var n=t._radii;return a.e(r)?(e.t.clone(n,r._radii),e.t.clone(t._radiiSquared,r._radiiSquared),e.t.clone(t._radiiToTheFourth,r._radiiToTheFourth),e.t.clone(t._oneOverRadii,r._oneOverRadii),e.t.clone(t._oneOverRadiiSquared,r._oneOverRadiiSquared),r._minimumRadius=t._minimumRadius,r._maximumRadius=t._maximumRadius,r._centerToleranceSquared=t._centerToleranceSquared,r):new o(n.x,n.y,n.z)}},o.fromCartesian3=function(t,e){return a.e(e)||(e=new o),a.e(t)&&i(e,t.x,t.y,t.z),e},o.WGS84=Object.freeze(new o(6378137,6378137,n.e.Radius)),o.XIAN80=Object.freeze(new o(6378140,6378140,6356755.29)),o.CGCS2000=Object.freeze(new o(6378137,6378137,6356752.31)),o.UNIT_SPHERE=Object.freeze(new o(1,1,1)),o.MOON=Object.freeze(new o(n.e.LUNAR_RADIUS,n.e.LUNAR_RADIUS,n.e.LUNAR_RADIUS)),o.prototype.clone=function(t){return o.clone(this,t)},o.packedLength=e.t.packedLength,o.pack=function(t,n,i){return r.o.typeOf.object("value",t),r.o.defined("array",n),i=a.u(i,0),e.t.pack(t._radii,n,i),n},o.unpack=function(t,n,i){r.o.defined("array",t),n=a.u(n,0);var u=e.t.unpack(t,n);return o.fromCartesian3(u,i)},o.prototype.geocentricSurfaceNormal=e.t.normalize,o.prototype.geodeticSurfaceNormalCartographic=function(t,n){r.o.typeOf.object("cartographic",t);var i=t.longitude,o=t.latitude,u=Math.cos(o),s=u*Math.cos(i),h=u*Math.sin(i),c=Math.sin(o);return a.e(n)||(n=new e.t),n.x=s,n.y=h,n.z=c,e.t.normalize(n,n)},o.prototype.geodeticSurfaceNormal=function(t,r){return a.e(r)||(r=new e.t),r=e.t.multiplyComponents(t,this._oneOverRadiiSquared,r),e.t.normalize(r,r)};var u=new e.t,s=new e.t;o.prototype.cartographicToCartesian=function(t,r){var n=u,i=s;this.geodeticSurfaceNormalCartographic(t,n),e.t.multiplyComponents(this._radiiSquared,n,i);var o=Math.sqrt(e.t.dot(n,i));return e.t.divideByScalar(i,o,i),e.t.multiplyByScalar(n,t.height,n),a.e(r)||(r=new e.t),e.t.add(i,n,r)},o.prototype.cartographicArrayToCartesianArray=function(t,e){r.o.defined("cartographics",t);var n=t.length;a.e(e)?e.length=n:e=new Array(n);for(var i=0;i<n;i++)e[i]=this.cartographicToCartesian(t[i],e[i]);return e};var h=new e.t,c=new e.t,d=new e.t;function l(t,e,r,n){this.west=a.u(t,0),this.south=a.u(e,0),this.east=a.u(r,0),this.north=a.u(n,0)}o.prototype.cartesianToCartographic=function(t,r){var i=this.scaleToGeodeticSurface(t,c);if(a.e(i)){var o=this.geodeticSurfaceNormal(i,h),u=e.t.subtract(t,i,d),s=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=n.e.sign(e.t.dot(u,t))*e.t.magnitude(u);return a.e(r)?(r.longitude=s,r.latitude=l,r.height=f,r):new e.t$1(s,l,f)}},o.prototype.cartesianArrayToCartographicArray=function(t,e){r.o.defined("cartesians",t);var n=t.length;a.e(e)?e.length=n:e=new Array(n);for(var i=0;i<n;++i)e[i]=this.cartesianToCartographic(t[i],e[i]);return e},o.prototype.scaleToGeodeticSurface=function(t,r){return e.P(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,r)},o.prototype.scaleToGeocentricSurface=function(t,n){r.o.typeOf.object("cartesian",t),a.e(n)||(n=new e.t);var i=t.x,o=t.y,u=t.z,s=this._oneOverRadiiSquared,h=1/Math.sqrt(i*i*s.x+o*o*s.y+u*u*s.z);return e.t.multiplyByScalar(t,h,n)},o.prototype.transformPositionToScaledSpace=function(t,r){return a.e(r)||(r=new e.t),e.t.multiplyComponents(t,this._oneOverRadii,r)},o.prototype.transformPositionFromScaledSpace=function(t,r){return a.e(r)||(r=new e.t),e.t.multiplyComponents(t,this._radii,r)},o.prototype.equals=function(t){return this===t||a.e(t)&&e.t.equals(this._radii,t._radii)},o.prototype.toString=function(){return this._radii.toString()},o.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,o){if(r.o.typeOf.object("position",t),!n.e.equalsEpsilon(this._radii.x,this._radii.y,n.e.EPSILON15))throw new r.t("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");r.o.typeOf.number.greaterThan("Ellipsoid.radii.z",this._radii.z,0),i=a.u(i,0);var u=this._squaredXOverSquaredZ;if(a.e(o)||(o=new e.t),o.x=0,o.y=0,o.z=t.z*(1-u),!(Math.abs(o.z)>=this._radii.z-i))return o},Object.defineProperties(l.prototype,{width:{get:function(){return l.computeWidth(this)}},height:{get:function(){return l.computeHeight(this)}}}),l.packedLength=4,l.pack=function(t,e,n){return r.o.typeOf.object("value",t),r.o.defined("array",e),n=a.u(n,0),e[n++]=t.west,e[n++]=t.south,e[n++]=t.east,e[n]=t.north,e},l.unpack=function(t,e,n){return r.o.defined("array",t),e=a.u(e,0),a.e(n)||(n=new l),n.west=t[e++],n.south=t[e++],n.east=t[e++],n.north=t[e],n},l.computeWidth=function(t){r.o.typeOf.object("rectangle",t);var e=t.east,a=t.west;return e<a&&(e+=n.e.TWO_PI),e-a},l.computeHeight=function(t){return r.o.typeOf.object("rectangle",t),t.north-t.south},l.fromDegrees=function(t,e,r,i,o){return t=n.e.toRadians(a.u(t,0)),e=n.e.toRadians(a.u(e,0)),r=n.e.toRadians(a.u(r,0)),i=n.e.toRadians(a.u(i,0)),a.e(o)?(o.west=t,o.south=e,o.east=r,o.north=i,o):new l(t,e,r,i)},l.fromRadians=function(t,e,r,n,i){return a.e(i)?(i.west=a.u(t,0),i.south=a.u(e,0),i.east=a.u(r,0),i.north=a.u(n,0),i):new l(t,e,r,n)},l.fromCartographicArray=function(t,e){r.o.defined("cartographics",t);for(var i=Number.MAX_VALUE,o=-Number.MAX_VALUE,u=Number.MAX_VALUE,s=-Number.MAX_VALUE,h=Number.MAX_VALUE,c=-Number.MAX_VALUE,d=0,f=t.length;d<f;d++){var p=t[d];i=Math.min(i,p.longitude),o=Math.max(o,p.longitude),h=Math.min(h,p.latitude),c=Math.max(c,p.latitude);var m=p.longitude>=0?p.longitude:p.longitude+n.e.TWO_PI;u=Math.min(u,m),s=Math.max(s,m)}return o-i>s-u&&(i=u,(o=s)>n.e.PI&&(o-=n.e.TWO_PI),i>n.e.PI&&(i-=n.e.TWO_PI)),a.e(e)?(e.west=i,e.south=h,e.east=o,e.north=c,e):new l(i,h,o,c)},l.fromCartesianArray=function(t,e,i){r.o.defined("cartesians",t),e=a.u(e,o.WGS84);for(var u=Number.MAX_VALUE,s=-Number.MAX_VALUE,h=Number.MAX_VALUE,c=-Number.MAX_VALUE,d=Number.MAX_VALUE,f=-Number.MAX_VALUE,p=0,m=t.length;p<m;p++){var g=e.cartesianToCartographic(t[p]);u=Math.min(u,g.longitude),s=Math.max(s,g.longitude),d=Math.min(d,g.latitude),f=Math.max(f,g.latitude);var O=g.longitude>=0?g.longitude:g.longitude+n.e.TWO_PI;h=Math.min(h,O),c=Math.max(c,O)}return s-u>c-h&&(u=h,(s=c)>n.e.PI&&(s-=n.e.TWO_PI),u>n.e.PI&&(u-=n.e.TWO_PI)),a.e(i)?(i.west=u,i.south=d,i.east=s,i.north=f,i):new l(u,d,s,f)},l.clone=function(t,e){if(a.e(t))return a.e(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new l(t.west,t.south,t.east,t.north)},l.equalsEpsilon=function(t,e,n){return r.o.typeOf.number("absoluteEpsilon",n),t===e||a.e(t)&&a.e(e)&&Math.abs(t.west-e.west)<=n&&Math.abs(t.south-e.south)<=n&&Math.abs(t.east-e.east)<=n&&Math.abs(t.north-e.north)<=n},l.prototype.clone=function(t){return l.clone(this,t)},l.prototype.equals=function(t){return l.equals(this,t)},l.equals=function(t,e){return t===e||a.e(t)&&a.e(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},l.prototype.equalsEpsilon=function(t,e){return r.o.typeOf.number("epsilon",e),l.equalsEpsilon(this,t,e)},l.validate=function(t){r.o.typeOf.object("rectangle",t);var e=t.north;r.o.typeOf.number.greaterThanOrEquals("north",e,-n.e.PI_OVER_TWO),r.o.typeOf.number.lessThanOrEquals("north",e,n.e.PI_OVER_TWO);var a=t.south;r.o.typeOf.number.greaterThanOrEquals("south",a,-n.e.PI_OVER_TWO),r.o.typeOf.number.lessThanOrEquals("south",a,n.e.PI_OVER_TWO);var i=t.west;r.o.typeOf.number.greaterThanOrEquals("west",i,-Math.PI),r.o.typeOf.number.lessThanOrEquals("west",i,Math.PI);var o=t.east;r.o.typeOf.number.greaterThanOrEquals("east",o,-Math.PI),r.o.typeOf.number.lessThanOrEquals("east",o,Math.PI)},l.southwest=function(t,n){return r.o.typeOf.object("rectangle",t),a.e(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e.t$1(t.west,t.south)},l.northwest=function(t,n){return r.o.typeOf.object("rectangle",t),a.e(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e.t$1(t.west,t.north)},l.northeast=function(t,n){return r.o.typeOf.object("rectangle",t),a.e(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e.t$1(t.east,t.north)},l.southeast=function(t,n){return r.o.typeOf.object("rectangle",t),a.e(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e.t$1(t.east,t.south)},l.center=function(t,i){r.o.typeOf.object("rectangle",t);var o=t.east,u=t.west;o<u&&(o+=n.e.TWO_PI);var s=n.e.negativePiToPi(.5*(u+o)),h=.5*(t.south+t.north);return a.e(i)?(i.longitude=s,i.latitude=h,i.height=0,i):new e.t$1(s,h)},l.intersection=function(t,e,i){r.o.typeOf.object("rectangle",t),r.o.typeOf.object("otherRectangle",e);var o=t.east,u=t.west,s=e.east,h=e.west;o<u&&s>0?o+=n.e.TWO_PI:s<h&&o>0&&(s+=n.e.TWO_PI),o<u&&h<0?h+=n.e.TWO_PI:s<h&&u<0&&(u+=n.e.TWO_PI);var c=n.e.negativePiToPi(Math.max(u,h)),d=n.e.negativePiToPi(Math.min(o,s));if(!((t.west<t.east||e.west<e.east)&&d<=c)){var f=Math.max(t.south,e.south),p=Math.min(t.north,e.north);if(!(f>=p))return a.e(i)?(i.west=c,i.south=f,i.east=d,i.north=p,i):new l(c,f,d,p)}},l.simpleIntersection=function(t,e,n){r.o.typeOf.object("rectangle",t),r.o.typeOf.object("otherRectangle",e);var i=Math.max(t.west,e.west),o=Math.max(t.south,e.south),u=Math.min(t.east,e.east),s=Math.min(t.north,e.north);if(!(o>=s||i>=u))return a.e(n)?(n.west=i,n.south=o,n.east=u,n.north=s,n):new l(i,o,u,s)},l.union=function(t,e,i){r.o.typeOf.object("rectangle",t),r.o.typeOf.object("otherRectangle",e),a.e(i)||(i=new l);var o=t.east,u=t.west,s=e.east,h=e.west;o<u&&s>0?o+=n.e.TWO_PI:s<h&&o>0&&(s+=n.e.TWO_PI),o<u&&h<0?h+=n.e.TWO_PI:s<h&&u<0&&(u+=n.e.TWO_PI);var c=n.e.convertLongitudeRange(Math.min(u,h)),d=n.e.convertLongitudeRange(Math.max(o,s));return i.west=c,i.south=Math.min(t.south,e.south),i.east=d,i.north=Math.max(t.north,e.north),i},l.expand=function(t,e,n){return r.o.typeOf.object("rectangle",t),r.o.typeOf.object("cartographic",e),a.e(n)||(n=new l),n.west=Math.min(t.west,e.longitude),n.south=Math.min(t.south,e.latitude),n.east=Math.max(t.east,e.longitude),n.north=Math.max(t.north,e.latitude),n},l.contains=function(t,e){r.o.typeOf.object("rectangle",t),r.o.typeOf.object("cartographic",e);var a=e.longitude,i=e.latitude,o=t.west,u=t.east;return u<o&&(u+=n.e.TWO_PI,a<0&&(a+=n.e.TWO_PI)),(a>o||n.e.equalsEpsilon(a,o,n.e.EPSILON14))&&(a<u||n.e.equalsEpsilon(a,u,n.e.EPSILON14))&&i>=t.south&&i<=t.north};var f=new e.t$1;l.subsample=function(t,e,i,u){r.o.typeOf.object("rectangle",t),e=a.u(e,o.WGS84),i=a.u(i,0),a.e(u)||(u=[]);var s=0,h=t.north,c=t.south,d=t.east,p=t.west,m=f;m.height=i,m.longitude=p,m.latitude=h,u[s]=e.cartographicToCartesian(m,u[s]),s++,m.longitude=d,u[s]=e.cartographicToCartesian(m,u[s]),s++,m.latitude=c,u[s]=e.cartographicToCartesian(m,u[s]),s++,m.longitude=p,u[s]=e.cartographicToCartesian(m,u[s]),s++,m.latitude=h<0?h:c>0?c:0;for(var g=1;g<8;++g)m.longitude=-Math.PI+g*n.e.PI_OVER_TWO,l.contains(t,m)&&(u[s]=e.cartographicToCartesian(m,u[s]),s++);return 0===m.latitude&&(m.longitude=p,u[s]=e.cartographicToCartesian(m,u[s]),s++,m.longitude=d,u[s]=e.cartographicToCartesian(m,u[s]),s++),u.length=s,u};var p=new e.t$1;l.prototype.contains=function(t){return l.contains(this,l.southwest(t,p))&&l.contains(this,l.northwest(t,p))&&l.contains(this,l.southeast(t,p))&&l.contains(this,l.northeast(t,p))},l.MAX_VALUE=Object.freeze(new l(-Math.PI,-n.e.PI_OVER_TWO,Math.PI,n.e.PI_OVER_TWO)),t.h=l,t.t=o}));
|