UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 6.42 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.32/esri/copyright.txt for details. */ import e from"../../geometry/Point.js";import t from"../../geometry/Polygon.js";import r from"../../geometry/Polyline.js";import n from"../support/TelemetryData.js";import i from"../support/VideoTimeExtent.js";const o="application/x-mpegURL",a="video/mp4",u="video/webm",s={UASDatalinkLocalSet:1e4,PrecisionTimeStamp:10002,MissionId:10003,PlatformTailNumber:10004,PlatformHeadingAngle:10005,PlatformPitchAngle:10006,PlatformRollAngle:10007,PlatformTrueAirspeed:10008,PlatformIndicatedAirspeed:10009,PlatformDesignation:10010,ImageSourceSensor:10011,ImageCoordinateSystem:10012,SensorLatitude:10013,SensorLongitude:10014,SensorTrueAltitude:10015,SensorHorizontalFOV:10016,SensorVerticalFOV:10017,SensorAzimuthAngle:10018,SensorElevationAngle:10019,SensorRollAngle:10020,PlatformSlantRange:10021,TargetWidth:10022,FrameCenterLatitude:10023,FrameCenterLongitude:10024,FrameCenterElevation:10025,OffsetCorner1Latitude:10026,OffsetCorner1Longitude:10027,OffsetCorner2Latitude:10028,OffsetCorner2Longitude:10029,OffsetCorner3Latitude:10030,OffsetCorner3Longitude:10031,OffsetCorner4Latitude:10032,OffsetCorner4Longitude:10033,TargetLocationLatitude:10040,TargetLocationLongitude:10041,TargetLocationElevation:10042,TargetTrackGateWidth:10043,TargetTrackGateHeight:10044,TargetErrorEstimateHorizontal:10045,TargetErrorEstimateLateral:10046,GenericFlagData:10047,PlatformGroundSpeed:10056,PlatformGroundRange:10057,PlatformRemainingFuel:10058,PlatformCallSign:10059,SensorFOVName:10063,PlatformMagneticHeading:10064,LDSVersionNumber:10065,AlternatePlatformName:10070,EventStartTimeUTC:10072,VMTIDataSet:10074,SensorEllipsoidHeight:10075,OperationalMode:10077,CornerLatitudePoint1:10082,CornerLongitudePoint1:10083,CornerLatitudePoint2:10084,CornerLongitudePoint2:10085,CornerLatitudePoint3:10086,CornerLongitudePoint3:10087,CornerLatitudePoint4:10088,CornerLongitudePoint4:10089,SARMotionImageryMetadata:10095,SecurityClassification:20001,SecurityClassifyingAuthority:20002,SecurityClassifyingCountry:20003,SecuritySCI:20004,SecurityCaveats:20005,SecurityReleaseInstructions:20006,SecurityLDSVersion:20022,EsriVideoWidth:90001,EsriVideoHeight:90002,EsriFrameCenterLatitude:90050,EsriFrameCenterLongitude:90051,EsriCornerLatitudePt1:90052,EsriCornerLongitudePt1:90053,EsriCornerLatitudePt2:90054,EsriCornerLongitudePt2:90055,EsriCornerLatitudePt3:90056,EsriCornerLongitudePt3:90057,EsriCornerLatitudePt4:90058,EsriCornerLongitudePt4:90059,EsriFrameOutline:90060,EsriSensorPosition:90061,EsriHorizonPixelPack:90063,EsriGroundControlPoints:90064};function l(e){const{duration:t,end:r,start:n,timezone:o="UTC"}=e||{};return"number"!=typeof t?null:new i({duration:t||null,end:"number"==typeof r?new Date(r):null,start:"number"==typeof n?new Date(n):null,timezone:o})}function d(e,t){const r=[...t],n=r.findIndex((t=>t.equals(e)));return n>-1&&r.splice(n),r.push(e),r}function g(e){if(!e?.size)return new n;const t=p(e),r=C(e),i=S(e),o=y(t,r);return new n({frameCenter:r,frameOutline:i,lineOfSight:o,sensorLocation:t})}function f(e){if(!e?.size)return null;return e.get(s.EsriGroundControlPoints)?.value??null??null}function L(e){return e?.size?e.get(s.EsriHorizonPixelPack)?.value??null:null}function C(e){return c(e)??E(e)}function m(e){if(!e)return o;const t=e.match(/\.(\w{3,4})(?:$|\?)/i);if(!t)return o;switch(t[1].toLowerCase()){case"mp4":return a;case"webm":return u;default:return o}}function P(e){const t=e?.layers;return t?.length?t.map((e=>({layerId:e.id,posterUrl:e.poster,sourceType:e.serviceType,title:e.name,type:e.type||"Video Layer"}))):[]}function c(t){return t&&t.has(s.EsriFrameCenterLatitude)&&t.has(s.EsriFrameCenterLongitude)?new e({x:t.get(s.EsriFrameCenterLongitude).value,y:t.get(s.EsriFrameCenterLatitude).value,z:t.get(s.FrameCenterElevation).value}):null}function E(t){return t&&t.has(s.FrameCenterLatitude)&&t.has(s.FrameCenterLongitude)?new e({x:t.get(s.FrameCenterLongitude)?.value,y:t.get(s.FrameCenterLatitude)?.value,z:t.get(s.FrameCenterElevation)?.value}):null}function S(e){if(!e)return null;const r=e.get(s.EsriFrameOutline)?.value;return r?t.fromJSON(r.geometry):h(e)??v(e)}function h(e){if(!(e.has(s.EsriCornerLatitudePt1)&&e.has(s.EsriCornerLongitudePt1)&&e.has(s.EsriCornerLatitudePt2)&&e.has(s.EsriCornerLongitudePt2)&&e.has(s.EsriCornerLatitudePt3)&&e.has(s.EsriCornerLongitudePt3)&&e.has(s.EsriCornerLatitudePt4)&&e.has(s.EsriCornerLongitudePt4)))return null;const r=[e.get(s.EsriCornerLongitudePt1)?.value,e.get(s.EsriCornerLatitudePt1)?.value],n=[e.get(s.EsriCornerLongitudePt2)?.value,e.get(s.EsriCornerLatitudePt2)?.value],i=[e.get(s.EsriCornerLongitudePt3)?.value,e.get(s.EsriCornerLatitudePt3)?.value],o=[e.get(s.EsriCornerLongitudePt4)?.value,e.get(s.EsriCornerLatitudePt4)?.value];return new t({rings:[[r,n,i,o]]})}function v(e){if(!(e.has(s.OffsetCorner1Latitude)&&e.has(s.OffsetCorner1Longitude)&&e.has(s.OffsetCorner2Latitude)&&e.has(s.OffsetCorner2Longitude)&&e.has(s.OffsetCorner3Latitude)&&e.has(s.OffsetCorner3Longitude)&&e.has(s.OffsetCorner4Latitude)&&e.has(s.OffsetCorner4Longitude)&&e.has(s.FrameCenterLatitude)&&e.has(s.FrameCenterLongitude)))return null;const r=e.get(s.FrameCenterLatitude)?.value,n=e.get(s.FrameCenterLongitude)?.value,i=r+e.get(s.OffsetCorner1Latitude)?.value,o=n+e.get(s.OffsetCorner1Longitude)?.value,a=r+e.get(s.OffsetCorner2Latitude)?.value,u=n+e.get(s.OffsetCorner2Longitude)?.value,l=r+e.get(s.OffsetCorner3Latitude)?.value,d=n+e.get(s.OffsetCorner3Longitude)?.value,g=r+e.get(s.OffsetCorner4Latitude)?.value,f=n+e.get(s.OffsetCorner4Longitude)?.value;return new t({rings:[[[o,i],[u,a],[d,l],[f,g]]]})}function y(e,t){if(!e||!t)return null;const n=[e.x,e.y,e.z??0],i=[t.x,t.y,t.z??0];return new r({paths:[[n,i]]})}function p(t){if(!t?.size)return null;if(t.has(s.EsriSensorPosition)){const r=t.get(s.EsriSensorPosition)?.value;if(r)return e.fromJSON(r.geometry)}return t.has(s.SensorLongitude)&&t.has(s.SensorLatitude)&&t.has(s.SensorTrueAltitude)?new e({x:t.get(s.SensorLongitude)?.value,y:t.get(s.SensorLatitude)?.value,z:t.get(s.SensorTrueAltitude)?.value}):null}export{C as getFrameCenter,L as getFrameHorizonPoints,f as getGroundControlPoints,d as getSensorTrailPoints,P as getServiceLayersInfo,g as getTelemetryData,m as getVideoMimeType,l as readVideoTimeExtent,s as videoMetadataEntryId};