@mapxus/mapxus-visual-jp 1.8.1 → 1.9.0
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/bitbucket-pipelines.yml +50 -0
- package/config/rollup.js +33 -0
- package/config/rollup.serve.config.js +3 -0
- package/debug/circlemarker.html +444 -0
- package/debug/create_tags.html +474 -0
- package/debug/distance.html +220 -0
- package/debug/index.html +92 -0
- package/debug/integration.html +1084 -0
- package/debug/leaflet.html +54 -0
- package/debug/markers.html +115 -0
- package/debug/multi_monitor_sync.html +377 -0
- package/debug/outdoor.html +1026 -0
- package/debug/rect_tags.html +147 -0
- package/debug/rotate.html +236 -0
- package/debug/sample.html +324 -0
- package/debug/sequence.html +75 -0
- package/debug/tags.html +218 -0
- package/package.json +34 -10
- package/rollup.config.js +39 -0
- package/server.js +35 -0
- package/spec/api/APIv3.spec.ts +86 -0
- package/spec/component/Component.spec.ts +68 -0
- package/spec/component/StatsComponent.spec.ts +33 -0
- package/spec/component/direction/DirectionComponent.spec.ts +163 -0
- package/spec/component/direction/DirectionDOMRenderer.spec.ts +233 -0
- package/spec/component/keyboard/KeyZoomHandler.spec.ts +236 -0
- package/spec/component/marker/Marker.spec.ts +104 -0
- package/spec/component/marker/MarkerComponent.spec.ts +88 -0
- package/spec/component/marker/MarkerScene.spec.ts +223 -0
- package/spec/component/marker/MarkerSet.spec.ts +453 -0
- package/spec/component/mouse/DoubleClickZoomHandler.spec.ts +211 -0
- package/spec/component/popup/Popup.spec.ts +479 -0
- package/spec/component/popup/PopupComponent.spec.ts +414 -0
- package/spec/component/tag/CreateHandlerBase.spec.ts +83 -0
- package/spec/component/tag/CreatePointHandler.spec.ts +190 -0
- package/spec/component/tag/OutlineRenderTag.spec.ts +91 -0
- package/spec/component/tag/PointGeometry.spec.ts +131 -0
- package/spec/component/tag/PolygonGeometry.spec.ts +497 -0
- package/spec/component/tag/RectGeometry.spec.ts +1157 -0
- package/spec/component/tag/TagComponent.spec.ts +513 -0
- package/spec/component/tag/TagScene.spec.ts +346 -0
- package/spec/component/tag/TagSet.spec.ts +241 -0
- package/spec/component/utils/HandlerBase.spec.ts +203 -0
- package/spec/geo/Camera.spec.ts +250 -0
- package/spec/geo/GeoCoords.spec.ts +364 -0
- package/spec/geo/Spatial.spec.ts +711 -0
- package/spec/geo/Transform.spec.ts +850 -0
- package/spec/geo/ViewportCoords.spec.ts +534 -0
- package/spec/graph/FilterCreator.spec.ts +892 -0
- package/spec/graph/Graph.spec.ts +2078 -0
- package/spec/graph/GraphCalculator.spec.ts +263 -0
- package/spec/graph/GraphService.spec.ts +663 -0
- package/spec/graph/Node.spec.ts +373 -0
- package/spec/graph/NodeCache.spec.ts +206 -0
- package/spec/graph/Sequence.spec.ts +37 -0
- package/spec/graph/edge/EdgeCalculator.Pano.spec.ts +963 -0
- package/spec/graph/edge/EdgeCalculator.Sequence.spec.ts +108 -0
- package/spec/graph/edge/EdgeCalculator.Similar.spec.ts +272 -0
- package/spec/graph/edge/EdgeCalculator.Step.spec.ts +383 -0
- package/spec/graph/edge/EdgeCalculator.Turn.spec.ts +278 -0
- package/spec/graph/edge/EdgeCalculator.spec.ts +747 -0
- package/spec/helper/ContainerMockCreator.spec.ts +33 -0
- package/spec/helper/DOMRendererMockCreator.spec.ts +22 -0
- package/spec/helper/EdgeCalculatorHelper.spec.ts +96 -0
- package/spec/helper/EventHelper.spec.ts +92 -0
- package/spec/helper/GLRendererMockCreator.spec.ts +23 -0
- package/spec/helper/GeoHelper.spec.ts +16 -0
- package/spec/helper/ImageLoadingServiceMockCreator.spec.ts +24 -0
- package/spec/helper/KeyboardServiceMockCreator.spec.ts +21 -0
- package/spec/helper/LoadingServiceMockCreator.spec.ts +21 -0
- package/spec/helper/MockCreator.spec.ts +18 -0
- package/spec/helper/MockCreatorBase.spec.ts +17 -0
- package/spec/helper/MouseServiceMockCreator.spec.ts +38 -0
- package/spec/helper/NavigatorMockCreator.spec.ts +28 -0
- package/spec/helper/NodeHelper.spec.ts +77 -0
- package/spec/helper/NodeMockCreator.spec.ts +19 -0
- package/spec/helper/RenderServiceMockCreator.spec.ts +25 -0
- package/spec/helper/SpriteServiceMockCreator.spec.ts +22 -0
- package/spec/helper/StateServiceMockCreator.spec.ts +33 -0
- package/spec/helper/TouchServiceMockCreator.spec.ts +29 -0
- package/spec/helper/TransformHelper.spec.ts +17 -0
- package/spec/render/DOMRenderer.spec.ts +112 -0
- package/spec/render/GLRenderer.spec.ts +453 -0
- package/spec/render/RenderCamera.spec.ts +535 -0
- package/spec/render/RenderService.spec.ts +531 -0
- package/spec/state/StateBase.spec.ts +369 -0
- package/spec/state/StateService.spec.ts +9 -0
- package/spec/state/TraversingState.spec.ts +262 -0
- package/spec/state/WaitingState.spec.ts +319 -0
- package/spec/tiles/TextureProvider.spec.ts +653 -0
- package/spec/utils/EventEmitter.spec.ts +71 -0
- package/spec/utils/Support.spec.ts +54 -0
- package/spec/viewer/CacheService.spec.ts +160 -0
- package/spec/viewer/ComponentController.spec.ts +310 -0
- package/spec/viewer/LoadingService.spec.ts +19 -0
- package/spec/viewer/MouseService.spec.ts +1344 -0
- package/spec/viewer/Navigator.spec.ts +970 -0
- package/spec/viewer/Observer.spec.ts +96 -0
- package/spec/viewer/SpriteService.spec.ts +224 -0
- package/src/API.ts +3 -0
- package/src/Component.ts +77 -0
- package/src/Edge.ts +6 -0
- package/src/Error.ts +3 -0
- package/src/FilterRender.ts +27 -0
- package/src/Geo.ts +7 -0
- package/src/Graph.ts +19 -0
- package/src/MapxusVisual.ts +66 -0
- package/src/Render.ts +7 -0
- package/src/State.ts +8 -0
- package/src/Support.ts +35 -0
- package/src/Tiles.ts +5 -0
- package/src/Utils.ts +6 -0
- package/src/Viewer.ts +16 -0
- package/src/api/API.ts +396 -0
- package/src/api/Auth.ts +76 -0
- package/src/api/AuthStore.ts +11 -0
- package/src/api/GraphQLCreator.ts +100 -0
- package/src/api/interfaces/IAuth.ts +7 -0
- package/src/api/interfaces/IBuildingBase.ts +7 -0
- package/src/api/interfaces/IBuildingInfo.ts +19 -0
- package/src/api/interfaces/ICoreNode.ts +28 -0
- package/src/api/interfaces/IFillNode.ts +96 -0
- package/src/api/interfaces/IFloorInfo.ts +10 -0
- package/src/api/interfaces/IFullNode.ts +10 -0
- package/src/api/interfaces/IGPano.ts +38 -0
- package/src/api/interfaces/IImageTagInfo.ts +14 -0
- package/src/api/interfaces/IKey.ts +13 -0
- package/src/api/interfaces/ILatLon.ts +19 -0
- package/src/api/interfaces/IOutdoor.ts +14 -0
- package/src/api/interfaces/IPathNode.ts +37 -0
- package/src/api/interfaces/IProject.ts +8 -0
- package/src/api/interfaces/IQueryBuilding.ts +37 -0
- package/src/api/interfaces/IResponse.ts +7 -0
- package/src/api/interfaces/ISequence.ts +16 -0
- package/src/api/interfaces/IUser.ts +13 -0
- package/src/api/interfaces/interfaces.ts +17 -0
- package/src/component/AttributionComponent.ts +48 -0
- package/src/component/BackgroundComponent.ts +39 -0
- package/src/component/BearingComponent.ts +282 -0
- package/src/component/CacheComponent.ts +295 -0
- package/src/component/Component.ts +130 -0
- package/src/component/ComponentService.ts +150 -0
- package/src/component/CoverComponent.ts +132 -0
- package/src/component/DebugComponent.ts +157 -0
- package/src/component/ImageComponent.ts +96 -0
- package/src/component/LoadingComponent.ts +85 -0
- package/src/component/NavigationComponent.ts +233 -0
- package/src/component/RouteComponent.ts +354 -0
- package/src/component/StatsComponent.ts +100 -0
- package/src/component/direction/DirectionComponent.ts +254 -0
- package/src/component/direction/DirectionDOMCalculator.ts +243 -0
- package/src/component/direction/DirectionDOMRenderer.ts +631 -0
- package/src/component/imageplane/ImagePlaneComponent.ts +497 -0
- package/src/component/imageplane/ImagePlaneFactory.ts +314 -0
- package/src/component/imageplane/ImagePlaneGLRenderer.ts +247 -0
- package/src/component/imageplane/ImagePlaneScene.ts +87 -0
- package/src/component/imageplane/ImagePlaneShaders.ts +16 -0
- package/src/component/imageplane/SliderComponent.ts +697 -0
- package/src/component/imageplane/interfaces/IBBoxShaderMaterial.ts +10 -0
- package/src/component/imageplane/interfaces/IShaderMaterial.ts +9 -0
- package/src/component/imageplane/interfaces/interfaces.ts +2 -0
- package/src/component/imageplane/shaders/equirectangular.fragment.glsl.ts +26 -0
- package/src/component/imageplane/shaders/equirectangular.vertex.glsl.ts +15 -0
- package/src/component/imageplane/shaders/perspective.fragment.glsl.ts +27 -0
- package/src/component/imageplane/shaders/perspective.vertex.glsl.ts +15 -0
- package/src/component/interfaces/ICacheConfiguration.ts +72 -0
- package/src/component/interfaces/IComponentConfiguration.ts +5 -0
- package/src/component/interfaces/ICoverConfiguration.ts +15 -0
- package/src/component/interfaces/IDirectionConfiguration.ts +63 -0
- package/src/component/interfaces/IImagePlaneConfiguration.ts +17 -0
- package/src/component/interfaces/IKeyboardConfiguration.ts +44 -0
- package/src/component/interfaces/IMarkerConfiguration.ts +31 -0
- package/src/component/interfaces/IMouseConfiguration.ts +52 -0
- package/src/component/interfaces/INavigationConfiguration.ts +35 -0
- package/src/component/interfaces/IRouteConfiguration.ts +20 -0
- package/src/component/interfaces/ISequenceConfiguration.ts +72 -0
- package/src/component/interfaces/IShader.ts +6 -0
- package/src/component/interfaces/ISliderConfiguration.ts +61 -0
- package/src/component/interfaces/ITagConfiguration.ts +40 -0
- package/src/component/interfaces/interfaces.ts +17 -0
- package/src/component/keyboard/KeySequenceNavigationHandler.ts +86 -0
- package/src/component/keyboard/KeySpatialNavigationHandler.ts +216 -0
- package/src/component/keyboard/KeyZoomHandler.ts +106 -0
- package/src/component/keyboard/KeyboardComponent.ts +125 -0
- package/src/component/marker/Marker.ts +5 -0
- package/src/component/marker/MarkerComponent.ts +856 -0
- package/src/component/marker/MarkerScene.ts +145 -0
- package/src/component/marker/MarkerSet.ts +142 -0
- package/src/component/marker/interfaces/IArrowMarkerOptions.ts +41 -0
- package/src/component/marker/interfaces/ICircleMarkerOptions.ts +30 -0
- package/src/component/marker/interfaces/IDotMarkerOptions.ts +18 -0
- package/src/component/marker/interfaces/IMarkerEvent.ts +28 -0
- package/src/component/marker/interfaces/ISimpleMarkerOptions.ts +54 -0
- package/src/component/marker/interfaces/interfaces.ts +5 -0
- package/src/component/marker/marker/ArrowMarker.ts +84 -0
- package/src/component/marker/marker/CircleMarker.ts +82 -0
- package/src/component/marker/marker/DotMarker.ts +68 -0
- package/src/component/marker/marker/ImageMarker.ts +45 -0
- package/src/component/marker/marker/Marker.ts +99 -0
- package/src/component/marker/marker/SimpleMarker.ts +187 -0
- package/src/component/mouse/BounceHandler.ts +148 -0
- package/src/component/mouse/DoubleClickZoomHandler.ts +106 -0
- package/src/component/mouse/DragPanHandler.ts +489 -0
- package/src/component/mouse/HandlerTypes.ts +13 -0
- package/src/component/mouse/MouseComponent.ts +170 -0
- package/src/component/mouse/ScrollZoomHandler.ts +137 -0
- package/src/component/mouse/TouchZoomHandler.ts +136 -0
- package/src/component/path/PathComponent.ts +75 -0
- package/src/component/path/PathEvent.ts +245 -0
- package/src/component/path/PathMarker.ts +42 -0
- package/src/component/path/PathRender.ts +163 -0
- package/src/component/popup/Popup.ts +2 -0
- package/src/component/popup/PopupComponent.ts +244 -0
- package/src/component/popup/interfaces/IPopupOffset.ts +37 -0
- package/src/component/popup/interfaces/IPopupOptions.ts +81 -0
- package/src/component/popup/popup/Popup.ts +594 -0
- package/src/component/popup/popup/PopupAlignment.ts +3 -0
- package/src/component/sequence/SequenceComponent.ts +500 -0
- package/src/component/sequence/SequenceDOMInteraction.ts +23 -0
- package/src/component/sequence/SequenceDOMRenderer.ts +179 -0
- package/src/component/tag/Tag.ts +9 -0
- package/src/component/tag/TagComponent.ts +787 -0
- package/src/component/tag/TagCreator.ts +138 -0
- package/src/component/tag/TagDOMRenderer.ts +35 -0
- package/src/component/tag/TagMode.ts +37 -0
- package/src/component/tag/TagOperation.ts +7 -0
- package/src/component/tag/TagScene.ts +216 -0
- package/src/component/tag/TagSet.ts +186 -0
- package/src/component/tag/error/GeometryTagError.ts +11 -0
- package/src/component/tag/geometry/Geometry.ts +62 -0
- package/src/component/tag/geometry/PointGeometry.ts +89 -0
- package/src/component/tag/geometry/PolygonGeometry.ts +349 -0
- package/src/component/tag/geometry/RectGeometry.ts +759 -0
- package/src/component/tag/geometry/VertexGeometry.ts +185 -0
- package/src/component/tag/handlers/CreateHandlerBase.ts +81 -0
- package/src/component/tag/handlers/CreatePointHandler.ts +35 -0
- package/src/component/tag/handlers/CreatePolygonHandler.ts +33 -0
- package/src/component/tag/handlers/CreateRectDragHandler.ts +199 -0
- package/src/component/tag/handlers/CreateRectHandler.ts +57 -0
- package/src/component/tag/handlers/CreateVertexHandler.ts +165 -0
- package/src/component/tag/handlers/EditVertexHandler.ts +275 -0
- package/src/component/tag/handlers/TagHandlerBase.ts +57 -0
- package/src/component/tag/interfaces/IInteraction.ts +14 -0
- package/src/component/tag/interfaces/IOutlineCreateTagOptions.ts +15 -0
- package/src/component/tag/interfaces/IOutlineTagOptions.ts +89 -0
- package/src/component/tag/interfaces/ISpotTagOptions.ts +37 -0
- package/src/component/tag/interfaces/interfaces.ts +4 -0
- package/src/component/tag/tag/OutlineCreateTag.ts +330 -0
- package/src/component/tag/tag/OutlineRenderTag.ts +569 -0
- package/src/component/tag/tag/OutlineTag.ts +380 -0
- package/src/component/tag/tag/RenderTag.ts +50 -0
- package/src/component/tag/tag/SpotRenderTag.ts +160 -0
- package/src/component/tag/tag/SpotTag.ts +170 -0
- package/src/component/tag/tag/Tag.ts +103 -0
- package/src/component/utils/HandlerBase.ts +71 -0
- package/src/error/ArgumentBeeviewError.ts +11 -0
- package/src/error/BeeviewError.ts +9 -0
- package/src/error/GraphBeeviewError.ts +11 -0
- package/src/geo/Camera.ts +149 -0
- package/src/geo/GeoCoords.ts +280 -0
- package/src/geo/GeoRBush.ts +25 -0
- package/src/geo/Spatial.ts +259 -0
- package/src/geo/Transform.ts +543 -0
- package/src/geo/ViewportCoords.ts +518 -0
- package/src/geo/interfaces/ILatLonAlt.ts +7 -0
- package/src/geo/interfaces/interfaces.ts +1 -0
- package/src/graph/FilterCreator.ts +106 -0
- package/src/graph/FilterExpression.ts +16 -0
- package/src/graph/Graph.ts +1516 -0
- package/src/graph/GraphCalculator.ts +197 -0
- package/src/graph/GraphService.ts +516 -0
- package/src/graph/ImageLoadingService.ts +44 -0
- package/src/graph/MeshReader.ts +19 -0
- package/src/graph/Node.ts +622 -0
- package/src/graph/NodeCache.ts +548 -0
- package/src/graph/Sequence.ts +117 -0
- package/src/graph/edge/EdgeCalculator.ts +919 -0
- package/src/graph/edge/EdgeCalculatorCoefficients.ts +43 -0
- package/src/graph/edge/EdgeCalculatorDirections.ts +80 -0
- package/src/graph/edge/EdgeCalculatorSettings.ts +61 -0
- package/src/graph/edge/EdgeDirection.ts +63 -0
- package/src/graph/edge/interfaces/IEdge.ts +26 -0
- package/src/graph/edge/interfaces/IEdgeData.ts +22 -0
- package/src/graph/edge/interfaces/IPano.ts +8 -0
- package/src/graph/edge/interfaces/IPotentialEdge.ts +106 -0
- package/src/graph/edge/interfaces/IStep.ts +7 -0
- package/src/graph/edge/interfaces/ITurn.ts +7 -0
- package/src/graph/edge/interfaces/interfaces.ts +6 -0
- package/src/graph/interfaces/IEdgeStatus.ts +25 -0
- package/src/graph/interfaces/IGraphConfiguration.ts +26 -0
- package/src/graph/interfaces/ILoadStatus.ts +18 -0
- package/src/graph/interfaces/ILoadStatusObject.ts +8 -0
- package/src/graph/interfaces/IMesh.ts +20 -0
- package/src/graph/interfaces/interfaces.ts +5 -0
- package/src/render/DOMRenderer.ts +288 -0
- package/src/render/GLRenderStage.ts +6 -0
- package/src/render/GLRenderer.ts +436 -0
- package/src/render/RenderCamera.ts +212 -0
- package/src/render/RenderMode.ts +34 -0
- package/src/render/RenderService.ts +264 -0
- package/src/render/interfaces/IGLRender.ts +10 -0
- package/src/render/interfaces/IGLRenderFunction.ts +10 -0
- package/src/render/interfaces/IGLRenderHash.ts +8 -0
- package/src/render/interfaces/ISize.ts +6 -0
- package/src/render/interfaces/IVNodeHash.ts +8 -0
- package/src/render/interfaces/interfaces.ts +5 -0
- package/src/state/FrameGenerator.ts +36 -0
- package/src/state/State.ts +6 -0
- package/src/state/StateContext.ts +180 -0
- package/src/state/StateService.ts +600 -0
- package/src/state/StateTransitionMatrix.ts +58 -0
- package/src/state/interfaces/ICurrentState.ts +21 -0
- package/src/state/interfaces/IFrame.ts +9 -0
- package/src/state/interfaces/IRotation.ts +6 -0
- package/src/state/interfaces/IState.ts +11 -0
- package/src/state/interfaces/IStateContext.ts +31 -0
- package/src/state/interfaces/interfaces.ts +5 -0
- package/src/state/states/StateBase.ts +425 -0
- package/src/state/states/TraversingState.ts +861 -0
- package/src/state/states/WaitingState.ts +109 -0
- package/src/tiles/ImageTileLoader.ts +121 -0
- package/src/tiles/ImageTileStore.ts +70 -0
- package/src/tiles/RegionOfInterestCalculator.ts +158 -0
- package/src/tiles/TextureProvider.ts +609 -0
- package/src/tiles/interfaces/IBoundingBox.ts +28 -0
- package/src/tiles/interfaces/IRegionOfInterest.ts +25 -0
- package/src/tiles/interfaces/interfaces.ts +2 -0
- package/src/utils/DOM.ts +28 -0
- package/src/utils/EventEmitter.ts +61 -0
- package/src/utils/Func.ts +3 -0
- package/src/utils/Settings.ts +39 -0
- package/src/utils/Support.ts +70 -0
- package/src/utils/Urls.ts +43 -0
- package/src/viewer/Alignment.ts +53 -0
- package/src/viewer/CacheService.ts +75 -0
- package/src/viewer/ComponentController.ts +237 -0
- package/src/viewer/Container.ts +100 -0
- package/src/viewer/EventNames.ts +192 -0
- package/src/viewer/ImageSize.ts +28 -0
- package/src/viewer/KeyboardService.ts +15 -0
- package/src/viewer/LoadingService.ts +66 -0
- package/src/viewer/MouseService.ts +541 -0
- package/src/viewer/Navigator.ts +362 -0
- package/src/viewer/Observer.ts +441 -0
- package/src/viewer/Projection.ts +162 -0
- package/src/viewer/SpriteService.ts +281 -0
- package/src/viewer/TouchService.ts +336 -0
- package/src/viewer/Viewer.ts +1132 -0
- package/src/viewer/interfaces/IComponentOptions.ts +176 -0
- package/src/viewer/interfaces/IMouseClaim.ts +6 -0
- package/src/viewer/interfaces/IMouseDeferPixels.ts +6 -0
- package/src/viewer/interfaces/IPinch.ts +81 -0
- package/src/viewer/interfaces/ISpriteAtlas.ts +12 -0
- package/src/viewer/interfaces/IUnprojection.ts +9 -0
- package/src/viewer/interfaces/IViewerMouseEvent.ts +56 -0
- package/src/viewer/interfaces/IViewerOptions.ts +88 -0
- package/src/viewer/interfaces/PointOfView.ts +19 -0
- package/src/viewer/interfaces/interfaces.ts +9 -0
- package/styles/AttributionComponent.css +26 -0
- package/styles/BackgroundComponent.css +21 -0
- package/styles/BearingComponent.css +48 -0
- package/styles/CoverComponent.css +169 -0
- package/styles/DebugComponent.css +28 -0
- package/styles/DirectionComponent.css +154 -0
- package/styles/LoadingComponent.css +14 -0
- package/styles/NavigationComponent.css +64 -0
- package/styles/NorthBg.png +0 -0
- package/styles/PopupComponent.css +188 -0
- package/styles/RouteComponent.css +21 -0
- package/styles/SequenceComponent.css +120 -0
- package/styles/SliderComponent.css +82 -0
- package/styles/TagComponent.css +105 -0
- package/styles/cover-logo.png +0 -0
- package/styles/mapillary-js.css +29 -0
- package/styles/pano-indicator.svg +3 -0
- package/styles/pano.svg +20 -0
- package/styles/pointer-wheat.svg +3 -0
- package/styles/pointer-white.svg +3 -0
- package/styles/spinner.svg +1 -0
- package/styles/stepper-left.svg +1 -0
- package/styles/stepper-play.svg +1 -0
- package/styles/stepper-right.svg +1 -0
- package/styles/stepper-stop.svg +1 -0
- package/styles/turn-around.svg +3 -0
- package/styles/turn.svg +3 -0
- package/tsconfig.json +28 -0
- package/tslint.json +81 -0
- package/types/graphql/index.d.ts +28 -0
- package/types/graphql/language/ast/index.d.ts +7 -0
- package/types/images/index.d.ts +7 -0
- package/types/pbf/index.d.ts +16 -0
- package/types/rbush/index.d.ts +28 -0
- package/version/beeview-0.1.0.css +2 -0
- package/version/beeview-0.1.0.js +1 -0
- package/version/beeview-0.1.1.css +2 -0
- package/version/beeview-0.1.1.js +1 -0
- package/version/beeview-0.1.2.css +2 -0
- package/version/beeview-0.1.2.js +1 -0
- package/version/beeview-0.2.0.css +2 -0
- package/version/beeview-0.2.0.js +1 -0
- package/version/beeview-0.2.1.css +2 -0
- package/version/beeview-0.2.1.js +1 -0
- package/version/beeview-0.3.0.css +2 -0
- package/version/beeview-0.3.0.js +1 -0
- package/version/beeview-0.4.0.css +2 -0
- package/version/beeview-0.4.0.js +1 -0
- package/version/beeview-0.4.1.css +2 -0
- package/version/beeview-0.4.1.js +1 -0
- package/version/mapxus-visual-1.0.0.css +2 -0
- package/version/mapxus-visual-1.0.0.js +1 -0
- package/version/mapxus-visual-1.1.0.css +2 -0
- package/version/mapxus-visual-1.1.0.js +1 -0
- package/version/mapxus-visual-1.1.1.css +2 -0
- package/version/mapxus-visual-1.1.1.js +1 -0
- package/version/mapxus-visual-1.1.2.css +2 -0
- package/version/mapxus-visual-1.1.2.js +1 -0
- package/version/mapxus-visual-1.2.0.css +2 -0
- package/version/mapxus-visual-1.2.0.js +1 -0
- package/version/mapxus-visual-1.3.0.css +2 -0
- package/version/mapxus-visual-1.3.0.js +1 -0
- package/LICENSE +0 -11
- package/README.md +0 -28
- package/index.css +0 -2
- package/index.d.ts +0 -163
- package/index.js +0 -1
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
/// <reference path="../../typings/index.d.ts" />
|
|
2
|
+
|
|
3
|
+
import {GeoCoords, ILatLonAlt} from "../../src/Geo";
|
|
4
|
+
|
|
5
|
+
let precision: number = 8;
|
|
6
|
+
|
|
7
|
+
let wgs84a: number = 6378137;
|
|
8
|
+
let wgs84b: number = 6356752.31424518;
|
|
9
|
+
|
|
10
|
+
describe("GeoCoords.geodeticToEcef", () => {
|
|
11
|
+
let geoCoords: GeoCoords;
|
|
12
|
+
|
|
13
|
+
beforeEach(() => {
|
|
14
|
+
geoCoords = new GeoCoords();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it("should convert Equator - Greenwich to X axis value", () => {
|
|
18
|
+
let position: ILatLonAlt = { alt: 0, lat: 0, lon: 0 };
|
|
19
|
+
|
|
20
|
+
let ecef: number[] = geoCoords.geodeticToEcef(position.lat, position.lon, position.alt);
|
|
21
|
+
|
|
22
|
+
expect(ecef[0]).toBeCloseTo(wgs84a, precision);
|
|
23
|
+
expect(ecef[1]).toBeCloseTo(0, precision);
|
|
24
|
+
expect(ecef[2]).toBeCloseTo(0, precision);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("should convert positions on Equator to WGS84 a distance", () => {
|
|
28
|
+
let position1: ILatLonAlt = { alt: 0, lat: 0, lon: 90 };
|
|
29
|
+
|
|
30
|
+
let ecef1: number[] = geoCoords.geodeticToEcef(position1.lat, position1.lon, position1.alt);
|
|
31
|
+
|
|
32
|
+
expect(ecef1[0]).toBeCloseTo(0, precision);
|
|
33
|
+
expect(ecef1[1]).toBeCloseTo(wgs84a, precision);
|
|
34
|
+
expect(ecef1[2]).toBeCloseTo(0, precision);
|
|
35
|
+
|
|
36
|
+
let position2: ILatLonAlt = { alt: 0, lat: 0, lon: 180 };
|
|
37
|
+
|
|
38
|
+
let ecef2: number[] = geoCoords.geodeticToEcef(position2.lat, position2.lon, position2.alt);
|
|
39
|
+
|
|
40
|
+
expect(ecef2[0]).toBeCloseTo(-wgs84a, precision);
|
|
41
|
+
expect(ecef2[1]).toBeCloseTo(0, precision);
|
|
42
|
+
expect(ecef2[2]).toBeCloseTo(0, precision);
|
|
43
|
+
|
|
44
|
+
let position3: ILatLonAlt = { alt: 0, lat: 0, lon: -90 };
|
|
45
|
+
|
|
46
|
+
let ecef3: number[] = geoCoords.geodeticToEcef(position3.lat, position3.lon, position3.alt);
|
|
47
|
+
|
|
48
|
+
expect(ecef3[0]).toBeCloseTo(0, precision);
|
|
49
|
+
expect(ecef3[1]).toBeCloseTo(-wgs84a, precision);
|
|
50
|
+
expect(ecef3[2]).toBeCloseTo(0, precision);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
it("should convert random Equator postion correctly", () => {
|
|
55
|
+
let position: ILatLonAlt = { alt: 0, lat: 0, lon: 35.6589 };
|
|
56
|
+
|
|
57
|
+
let ecef: number[] = geoCoords.geodeticToEcef(position.lat, position.lon, position.alt);
|
|
58
|
+
|
|
59
|
+
expect(ecef[0]).toBeCloseTo(wgs84a * Math.cos(Math.PI * position.lon / 180), precision);
|
|
60
|
+
expect(ecef[1]).toBeCloseTo(wgs84a * Math.sin(Math.PI * position.lon / 180), precision);
|
|
61
|
+
expect(ecef[2]).toBeCloseTo(0, precision);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it("should convert value with altitude correctly", () => {
|
|
65
|
+
let position: ILatLonAlt = { alt: 452.43537987, lat: 0, lon: 0 };
|
|
66
|
+
|
|
67
|
+
let ecef: number[] = geoCoords.geodeticToEcef(position.lat, position.lon, position.alt);
|
|
68
|
+
|
|
69
|
+
expect(ecef[0]).toBeCloseTo(wgs84a + position.alt, precision);
|
|
70
|
+
expect(ecef[1]).toBeCloseTo(0, precision);
|
|
71
|
+
expect(ecef[2]).toBeCloseTo(0, precision);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it("should convert North Pole value correctly", () => {
|
|
75
|
+
let position: ILatLonAlt = { alt: 0, lat: 90, lon: 0 };
|
|
76
|
+
|
|
77
|
+
let ecef: number[] = geoCoords.geodeticToEcef(position.lat, position.lon, position.alt);
|
|
78
|
+
|
|
79
|
+
expect(ecef[0]).toBeCloseTo(0, precision);
|
|
80
|
+
expect(ecef[1]).toBeCloseTo(0, precision);
|
|
81
|
+
expect(ecef[2]).toBeCloseTo(wgs84b, precision);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it("should convert back and forth between WGS84 and ECEF and correspond", () => {
|
|
85
|
+
let position: ILatLonAlt = { alt: 25.34543543, lat: 12.469889789, lon: -33.34589734 };
|
|
86
|
+
|
|
87
|
+
let ecef: number[] = geoCoords.geodeticToEcef(position.lat, position.lon, position.alt);
|
|
88
|
+
let rePosition: number[] = geoCoords.ecefToGeodetic(ecef[0], ecef[1], ecef[2]);
|
|
89
|
+
|
|
90
|
+
expect(rePosition[0]).toBeCloseTo(position.lat, precision);
|
|
91
|
+
expect(rePosition[1]).toBeCloseTo(position.lon, precision);
|
|
92
|
+
expect(rePosition[2]).toBeCloseTo(position.alt, precision);
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
describe("GeoCoords.ecefToGeodetic", () => {
|
|
97
|
+
let geoCoords: GeoCoords;
|
|
98
|
+
|
|
99
|
+
beforeEach(() => {
|
|
100
|
+
geoCoords = new GeoCoords();
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it("should convert X-axis value to Equator - Greenwich", () => {
|
|
104
|
+
let ecef: number[] = [wgs84a, 0, 0];
|
|
105
|
+
|
|
106
|
+
let position: number[] = geoCoords.ecefToGeodetic(ecef[0], ecef[1], ecef[2]);
|
|
107
|
+
|
|
108
|
+
expect(position[0]).toBeCloseTo(0, precision);
|
|
109
|
+
expect(position[1]).toBeCloseTo(0, precision);
|
|
110
|
+
expect(position[2]).toBeCloseTo(0, precision);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
it("should convert XY-axis values to Equator", () => {
|
|
114
|
+
let ecef1: number[] = [0, wgs84a, 0];
|
|
115
|
+
|
|
116
|
+
let position1: number[] = geoCoords.ecefToGeodetic(ecef1[0], ecef1[1], ecef1[2]);
|
|
117
|
+
|
|
118
|
+
expect(position1[0]).toBeCloseTo(0, precision);
|
|
119
|
+
expect(position1[1]).toBeCloseTo(90, precision);
|
|
120
|
+
expect(position1[2]).toBeCloseTo(0, precision);
|
|
121
|
+
|
|
122
|
+
let ecef2: number[] = [-wgs84a, 0, 0];
|
|
123
|
+
|
|
124
|
+
let position2: number[] = geoCoords.ecefToGeodetic(ecef2[0], ecef2[1], ecef2[2]);
|
|
125
|
+
|
|
126
|
+
expect(position2[0]).toBeCloseTo(0, precision);
|
|
127
|
+
expect(position2[1]).toBeCloseTo(180, precision);
|
|
128
|
+
expect(position2[2]).toBeCloseTo(0, precision);
|
|
129
|
+
|
|
130
|
+
let ecef3: number[] = [0, -wgs84a, 0];
|
|
131
|
+
|
|
132
|
+
let position3: number[] = geoCoords.ecefToGeodetic(ecef3[0], ecef3[1], ecef3[2]);
|
|
133
|
+
|
|
134
|
+
expect(position3[0]).toBeCloseTo(0, precision);
|
|
135
|
+
expect(position3[1]).toBeCloseTo(-90, precision);
|
|
136
|
+
expect(position3[2]).toBeCloseTo(0, precision);
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
it("should convert X-axis value to correct altitude", () => {
|
|
140
|
+
let offset: number = 65.343454534;
|
|
141
|
+
|
|
142
|
+
let ecef: number[] = [wgs84a + offset, 0, 0];
|
|
143
|
+
|
|
144
|
+
let position: number[] = geoCoords.ecefToGeodetic(ecef[0], ecef[1], ecef[2]);
|
|
145
|
+
|
|
146
|
+
expect(position[0]).toBeCloseTo(0, precision);
|
|
147
|
+
expect(position[1]).toBeCloseTo(0, precision);
|
|
148
|
+
expect(position[2]).toBeCloseTo(offset, precision);
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
it("should convert back and forth between ECEF and WGS84 and correspond", () => {
|
|
152
|
+
let ecef: number[] = [wgs84a * Math.sin(Math.PI / 6), wgs84a * Math.sin(Math.PI / 6), 22.433453];
|
|
153
|
+
|
|
154
|
+
let position: number[] = geoCoords.ecefToGeodetic(ecef[0], ecef[1], ecef[2]);
|
|
155
|
+
let reEcef: number[] = geoCoords.geodeticToEcef(position[0], position[1], position[2]);
|
|
156
|
+
|
|
157
|
+
expect(reEcef[0]).toBeCloseTo(ecef[0], precision);
|
|
158
|
+
expect(reEcef[1]).toBeCloseTo(ecef[1], precision);
|
|
159
|
+
expect(reEcef[2]).toBeCloseTo(ecef[2], precision);
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
describe("GeoCoords.ecefToEnu", () => {
|
|
164
|
+
let geoCoords: GeoCoords;
|
|
165
|
+
|
|
166
|
+
beforeEach(() => {
|
|
167
|
+
geoCoords = new GeoCoords();
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
it("should convert to ECEF position corresponding to geodetic to ENU at origin", () => {
|
|
171
|
+
let ref: ILatLonAlt = { alt: 0, lat: 0, lon: 0 };
|
|
172
|
+
let ecef: number[] = [wgs84a, 0, 0];
|
|
173
|
+
|
|
174
|
+
let enu: number[] = geoCoords.ecefToEnu(ecef[0], ecef[1], ecef[2], ref.lat, ref.lon, ref.alt);
|
|
175
|
+
|
|
176
|
+
expect(enu[0]).toBeCloseTo(0, precision);
|
|
177
|
+
expect(enu[1]).toBeCloseTo(0, precision);
|
|
178
|
+
expect(enu[2]).toBeCloseTo(0, precision);
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
it("should convert positions on Equator to ENU positions at origin", () => {
|
|
182
|
+
let ref1: ILatLonAlt = { alt: 0, lat: 0, lon: 90 };
|
|
183
|
+
let ecef1: number[] = [0, wgs84a, 0];
|
|
184
|
+
|
|
185
|
+
let enu1: number[] = geoCoords.ecefToEnu(ecef1[0], ecef1[1], ecef1[2], ref1.lat, ref1.lon, ref1.alt);
|
|
186
|
+
|
|
187
|
+
expect(enu1[0]).toBeCloseTo(0, precision);
|
|
188
|
+
expect(enu1[1]).toBeCloseTo(0, precision);
|
|
189
|
+
expect(enu1[2]).toBeCloseTo(0, precision);
|
|
190
|
+
|
|
191
|
+
let ref2: ILatLonAlt = { alt: 0, lat: 0, lon: 180 };
|
|
192
|
+
let ecef2: number[] = [-wgs84a, 0, 0];
|
|
193
|
+
|
|
194
|
+
let enu2: number[] = geoCoords.ecefToEnu(ecef2[0], ecef2[1], ecef2[2], ref2.lat, ref2.lon, ref2.alt);
|
|
195
|
+
|
|
196
|
+
expect(enu2[0]).toBeCloseTo(0, precision);
|
|
197
|
+
expect(enu2[1]).toBeCloseTo(0, precision);
|
|
198
|
+
expect(enu2[2]).toBeCloseTo(0, precision);
|
|
199
|
+
|
|
200
|
+
let ref3: ILatLonAlt = { alt: 0, lat: 0, lon: -90 };
|
|
201
|
+
let ecef3: number[] = [0, -wgs84a, 0];
|
|
202
|
+
|
|
203
|
+
let enu3: number[] = geoCoords.ecefToEnu(ecef3[0], ecef3[1], ecef3[2], ref3.lat, ref3.lon, ref3.alt);
|
|
204
|
+
|
|
205
|
+
expect(enu3[0]).toBeCloseTo(0, precision);
|
|
206
|
+
expect(enu3[1]).toBeCloseTo(0, precision);
|
|
207
|
+
expect(enu3[2]).toBeCloseTo(0, precision);
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
it("should convert ECEF position with altitude to ENU with correct z-value", () => {
|
|
211
|
+
let ref: ILatLonAlt = { alt: 0, lat: 0, lon: 0 };
|
|
212
|
+
|
|
213
|
+
let altitude: number = 5.38973284;
|
|
214
|
+
let ecef: number[] = [wgs84a + altitude, 0, 0];
|
|
215
|
+
|
|
216
|
+
let enu: number[] = geoCoords.ecefToEnu(ecef[0], ecef[1], ecef[2], ref.lat, ref.lon, ref.alt);
|
|
217
|
+
|
|
218
|
+
expect(enu[0]).toBeCloseTo(0, precision);
|
|
219
|
+
expect(enu[1]).toBeCloseTo(0, precision);
|
|
220
|
+
expect(enu[2]).toBeCloseTo(altitude, precision);
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
it("should convert ECEF position with translation to correct ENU position", () => {
|
|
224
|
+
let ref: ILatLonAlt = { alt: 0, lat: 0, lon: 0 };
|
|
225
|
+
|
|
226
|
+
let translation: number = 1.38973284;
|
|
227
|
+
let ecef: number[] = [wgs84a, translation, translation];
|
|
228
|
+
|
|
229
|
+
let enu: number[] = geoCoords.ecefToEnu(ecef[0], ecef[1], ecef[2], ref.lat, ref.lon, ref.alt);
|
|
230
|
+
|
|
231
|
+
expect(enu[0]).toBeCloseTo(translation, precision);
|
|
232
|
+
expect(enu[1]).toBeCloseTo(translation, precision);
|
|
233
|
+
expect(enu[2]).toBeCloseTo(0, precision);
|
|
234
|
+
});
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
describe("GeoCoords.enuToEcef", () => {
|
|
238
|
+
let geoCoords: GeoCoords;
|
|
239
|
+
|
|
240
|
+
beforeEach(() => {
|
|
241
|
+
geoCoords = new GeoCoords();
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
it("should convert to ENU position at origin to ECEF X-value", () => {
|
|
245
|
+
let ref: ILatLonAlt = { alt: 0, lat: 0, lon: 0 };
|
|
246
|
+
let enu: number[] = [0, 0, 0];
|
|
247
|
+
|
|
248
|
+
let ecef: number[] = geoCoords.enuToEcef(enu[0], enu[1], enu[2], ref.lat, ref.lon, ref.alt);
|
|
249
|
+
|
|
250
|
+
expect(ecef[0]).toBeCloseTo(wgs84a, precision);
|
|
251
|
+
expect(ecef[1]).toBeCloseTo(0, precision);
|
|
252
|
+
expect(ecef[2]).toBeCloseTo(0, precision);
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
it("should convert to ENU position with up value to ECEF X-value", () => {
|
|
256
|
+
let ref: ILatLonAlt = { alt: 0, lat: 0, lon: 0 };
|
|
257
|
+
let enu: number[] = [0, 0, 7.3823847239847];
|
|
258
|
+
|
|
259
|
+
let ecef: number[] = geoCoords.enuToEcef(enu[0], enu[1], enu[2], ref.lat, ref.lon, ref.alt);
|
|
260
|
+
|
|
261
|
+
expect(ecef[0]).toBeCloseTo(wgs84a + enu[2], precision);
|
|
262
|
+
expect(ecef[1]).toBeCloseTo(0, precision);
|
|
263
|
+
expect(ecef[2]).toBeCloseTo(0, precision);
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
it("should convert ECEF position with translation to correct ENU position", () => {
|
|
267
|
+
let ref: ILatLonAlt = { alt: 0, lat: 0, lon: 0 };
|
|
268
|
+
|
|
269
|
+
let translation: number = -2.34875843758493;
|
|
270
|
+
let enu: number[] = [translation, translation, 0];
|
|
271
|
+
|
|
272
|
+
let ecef: number[] = geoCoords.enuToEcef(enu[0], enu[1], enu[2], ref.lat, ref.lon, ref.alt);
|
|
273
|
+
|
|
274
|
+
expect(ecef[0]).toBeCloseTo(wgs84a, precision);
|
|
275
|
+
expect(ecef[1]).toBeCloseTo(translation, precision);
|
|
276
|
+
expect(ecef[2]).toBeCloseTo(translation, precision);
|
|
277
|
+
});
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
describe("GeoCoords.geodeticToEnu", () => {
|
|
281
|
+
let geoCoords: GeoCoords;
|
|
282
|
+
|
|
283
|
+
beforeEach(() => {
|
|
284
|
+
geoCoords = new GeoCoords();
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
it("should convert to ENU position at origin when lla is at reference", () => {
|
|
288
|
+
let ref: ILatLonAlt = { alt: 12.523892390, lat: 12.9450823, lon: 133.34589734 };
|
|
289
|
+
let lla: ILatLonAlt = { alt: ref.alt, lat: ref.lat, lon: ref.lon };
|
|
290
|
+
|
|
291
|
+
let enu: number[] = geoCoords.geodeticToEnu(lla.lat, lla.lon, lla.alt, ref.lat, ref.lon, ref.alt);
|
|
292
|
+
|
|
293
|
+
expect(enu[0]).toBeCloseTo(0, precision);
|
|
294
|
+
expect(enu[1]).toBeCloseTo(0, precision);
|
|
295
|
+
expect(enu[2]).toBeCloseTo(0, precision);
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
it("should convert to ENU z value corresponding to diff with reference lla", () => {
|
|
299
|
+
let ref: ILatLonAlt = { alt: 12.523892390, lat: 12.9450823, lon: 133.34589734 };
|
|
300
|
+
|
|
301
|
+
let altTranslation: number = 4.4556433242;
|
|
302
|
+
let lla: ILatLonAlt = { alt: ref.alt + altTranslation, lat: ref.lat, lon: ref.lon };
|
|
303
|
+
|
|
304
|
+
let enu: number[] = geoCoords.geodeticToEnu(lla.lat, lla.lon, lla.alt, ref.lat, ref.lon, ref.alt);
|
|
305
|
+
|
|
306
|
+
expect(enu[0]).toBeCloseTo(0, precision);
|
|
307
|
+
expect(enu[1]).toBeCloseTo(0, precision);
|
|
308
|
+
expect(enu[2]).toBeCloseTo(altTranslation, precision);
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
it("should convert back and forth between WGS84 and ENU and correspond", () => {
|
|
312
|
+
let ref: ILatLonAlt = { alt: -3.645563324, lat: 13.469889789, lon: 92.376689734 };
|
|
313
|
+
let lla: ILatLonAlt = { alt: ref.alt + 20, lat: ref.lat - 0.01, lon: ref.lon + 0.01 };
|
|
314
|
+
|
|
315
|
+
let enu: number[] = geoCoords.geodeticToEnu(lla.lat, lla.lon, lla.alt, ref.lat, ref.lon, ref.alt);
|
|
316
|
+
let reLla: number[] = geoCoords.enuToGeodetic(enu[0], enu[1], enu[2], ref.lat, ref.lon, ref.alt);
|
|
317
|
+
|
|
318
|
+
expect(reLla[0]).toBeCloseTo(lla.lat, precision);
|
|
319
|
+
expect(reLla[1]).toBeCloseTo(lla.lon, precision);
|
|
320
|
+
expect(reLla[2]).toBeCloseTo(lla.alt, precision);
|
|
321
|
+
});
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
describe("GeoCoords.enuToGeodetic", () => {
|
|
325
|
+
let geoCoords: GeoCoords;
|
|
326
|
+
|
|
327
|
+
beforeEach(() => {
|
|
328
|
+
geoCoords = new GeoCoords();
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
it("should convert to reference WGS84 when ENU position is origin", () => {
|
|
332
|
+
let ref: ILatLonAlt = { alt: 12.523892390, lat: 12.9450823, lon: 133.34589734 };
|
|
333
|
+
let enu: number[] = [0, 0, 0];
|
|
334
|
+
|
|
335
|
+
let lla: number[] = geoCoords.enuToGeodetic(enu[0], enu[1], enu[2], ref.lat, ref.lon, ref.alt);
|
|
336
|
+
|
|
337
|
+
expect(lla[0]).toBeCloseTo(ref.lat, precision);
|
|
338
|
+
expect(lla[1]).toBeCloseTo(ref.lon, precision);
|
|
339
|
+
expect(lla[2]).toBeCloseTo(ref.alt, precision);
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
it("should convert to reference WGS84 at correct altitude when ENU position has non zero z value", () => {
|
|
343
|
+
let ref: ILatLonAlt = { alt: 12.523892390, lat: 12.9450823, lon: 133.34589734 };
|
|
344
|
+
let enu: number[] = [0, 0, 5.234872384927];
|
|
345
|
+
|
|
346
|
+
let lla: number[] = geoCoords.enuToGeodetic(enu[0], enu[1], enu[2], ref.lat, ref.lon, ref.alt);
|
|
347
|
+
|
|
348
|
+
expect(lla[0]).toBeCloseTo(ref.lat, precision);
|
|
349
|
+
expect(lla[1]).toBeCloseTo(ref.lon, precision);
|
|
350
|
+
expect(lla[2]).toBeCloseTo(ref.alt + enu[2], precision);
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
it("should convert back and forth between ENU and WGS84 and correspond", () => {
|
|
354
|
+
let ref: ILatLonAlt = { alt: 7.34543543, lat: -52.469889789, lon: -113.34589734 };
|
|
355
|
+
let enu: number[] = [12.435534543, -55.34242121, 5.98023489];
|
|
356
|
+
|
|
357
|
+
let lla: number[] = geoCoords.enuToGeodetic(enu[0], enu[1], enu[2], ref.lat, ref.lon, ref.alt);
|
|
358
|
+
let reEnu: number[] = geoCoords.geodeticToEnu(lla[0], lla[1], lla[2], ref.lat, ref.lon, ref.alt);
|
|
359
|
+
|
|
360
|
+
expect(reEnu[0]).toBeCloseTo(enu[0], precision);
|
|
361
|
+
expect(reEnu[1]).toBeCloseTo(enu[1], precision);
|
|
362
|
+
expect(reEnu[2]).toBeCloseTo(enu[2], precision);
|
|
363
|
+
});
|
|
364
|
+
});
|