@itwin/core-orbitgt 4.6.0-dev.9 → 4.7.0-dev.3
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/CHANGELOG.md +11 -1
- package/lib/cjs/pointcloud/format/opc/AttributeMask.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/BlockRecord.js +1 -1
- package/lib/cjs/pointcloud/format/opc/BlockRecord.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/ContainerFile.js +1 -1
- package/lib/cjs/pointcloud/format/opc/ContainerFile.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/DirectoryReader.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/DirectoryRecord.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/EmbeddedAttributeReader.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/FileReader.js +1 -1
- package/lib/cjs/pointcloud/format/opc/FileReader.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/GeometryReader.js +1 -1
- package/lib/cjs/pointcloud/format/opc/GeometryReader.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/GeometryRecord.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/OPCReader.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/PointReader.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/TileReadBuffer.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/TileRecord.js +1 -1
- package/lib/cjs/pointcloud/format/opc/TileRecord.js.map +1 -1
- package/lib/cjs/pointcloud/model/AttributeTypes.js +1 -1
- package/lib/cjs/pointcloud/model/AttributeTypes.js.map +1 -1
- package/lib/cjs/pointcloud/model/AttributeValue.js +1 -1
- package/lib/cjs/pointcloud/model/AttributeValue.js.map +1 -1
- package/lib/cjs/pointcloud/model/CloudPoint.js +1 -1
- package/lib/cjs/pointcloud/model/CloudPoint.js.map +1 -1
- package/lib/cjs/pointcloud/model/PointDataRaw.js +1 -1
- package/lib/cjs/pointcloud/model/PointDataRaw.js.map +1 -1
- package/lib/cjs/pointcloud/model/ReadRequest.js +1 -1
- package/lib/cjs/pointcloud/model/ReadRequest.js.map +1 -1
- package/lib/cjs/pointcloud/model/StandardAttributes.js +1 -1
- package/lib/cjs/pointcloud/model/StandardAttributes.js.map +1 -1
- package/lib/cjs/pointcloud/render/Block.js.map +1 -1
- package/lib/cjs/pointcloud/render/DataManager.js +1 -1
- package/lib/cjs/pointcloud/render/DataManager.js.map +1 -1
- package/lib/cjs/pointcloud/render/TileLoadSorter.js +1 -1
- package/lib/cjs/pointcloud/render/TileLoadSorter.js.map +1 -1
- package/lib/cjs/pointcloud/render/ViewTree.js +1 -1
- package/lib/cjs/pointcloud/render/ViewTree.js.map +1 -1
- package/lib/cjs/spatial/crs/CRSEngine.js.map +1 -1
- package/lib/cjs/spatial/crs/CRSManager.js +1 -1
- package/lib/cjs/spatial/crs/CRSManager.js.map +1 -1
- package/lib/cjs/spatial/ecrs/CRS.js +1 -1
- package/lib/cjs/spatial/ecrs/CRS.js.map +1 -1
- package/lib/cjs/spatial/ecrs/CoordinateSystem.js +1 -1
- package/lib/cjs/spatial/ecrs/CoordinateSystem.js.map +1 -1
- package/lib/cjs/spatial/ecrs/DataFileUnit.js +1 -1
- package/lib/cjs/spatial/ecrs/DataFileUnit.js.map +1 -1
- package/lib/cjs/spatial/ecrs/Datum.js +1 -1
- package/lib/cjs/spatial/ecrs/Datum.js.map +1 -1
- package/lib/cjs/spatial/ecrs/Ellipsoid.js.map +1 -1
- package/lib/cjs/spatial/ecrs/OnlineEngine.js.map +1 -1
- package/lib/cjs/spatial/ecrs/OnlineRegistry.js +1 -1
- package/lib/cjs/spatial/ecrs/OnlineRegistry.js.map +1 -1
- package/lib/cjs/spatial/ecrs/Operation.js +1 -1
- package/lib/cjs/spatial/ecrs/Operation.js.map +1 -1
- package/lib/cjs/spatial/ecrs/ParameterValueList.js.map +1 -1
- package/lib/cjs/spatial/ecrs/Registry.js +1 -1
- package/lib/cjs/spatial/ecrs/Registry.js.map +1 -1
- package/lib/cjs/spatial/ecrs/Transform.js +1 -1
- package/lib/cjs/spatial/ecrs/Transform.js.map +1 -1
- package/lib/cjs/spatial/ecrs/Unit.js +1 -1
- package/lib/cjs/spatial/ecrs/Unit.js.map +1 -1
- package/lib/cjs/spatial/ecrs/WellKnownText.js +1 -1
- package/lib/cjs/spatial/ecrs/WellKnownText.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/HotineObliqueMercator.js +1 -1
- package/lib/cjs/spatial/ecrs/projection/HotineObliqueMercator.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/KrovakObliqueConformalConic.js +1 -1
- package/lib/cjs/spatial/ecrs/projection/KrovakObliqueConformalConic.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/KrovakObliqueConformalConicEN.js +1 -1
- package/lib/cjs/spatial/ecrs/projection/KrovakObliqueConformalConicEN.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/LambertConical1SP.js +1 -1
- package/lib/cjs/spatial/ecrs/projection/LambertConical1SP.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/LambertConical2SP.js +1 -1
- package/lib/cjs/spatial/ecrs/projection/LambertConical2SP.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/Mercator1SP.js +1 -1
- package/lib/cjs/spatial/ecrs/projection/Mercator1SP.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/ObliqueMercator.js +1 -1
- package/lib/cjs/spatial/ecrs/projection/ObliqueMercator.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/ObliqueStereographic.js +1 -1
- package/lib/cjs/spatial/ecrs/projection/ObliqueStereographic.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/TransverseMercator.js +1 -1
- package/lib/cjs/spatial/ecrs/projection/TransverseMercator.js.map +1 -1
- package/lib/cjs/spatial/ecrs/transformation/PositionVector.js +1 -1
- package/lib/cjs/spatial/ecrs/transformation/PositionVector.js.map +1 -1
- package/lib/cjs/spatial/geom/Bounds.js.map +1 -1
- package/lib/cjs/spatial/geom/Line.js.map +1 -1
- package/lib/cjs/spatial/geom/Transform.js.map +1 -1
- package/lib/cjs/system/buffer/Float32Buffer.js +1 -1
- package/lib/cjs/system/buffer/Float32Buffer.js.map +1 -1
- package/lib/cjs/system/buffer/LittleEndian.js.map +1 -1
- package/lib/cjs/system/buffer/Uint16Buffer.js +1 -1
- package/lib/cjs/system/buffer/Uint16Buffer.js.map +1 -1
- package/lib/cjs/system/buffer/Uint8Buffer.js +1 -1
- package/lib/cjs/system/buffer/Uint8Buffer.js.map +1 -1
- package/lib/cjs/system/collection/AList.js.map +1 -1
- package/lib/cjs/system/runtime/ALong.js +1 -1
- package/lib/cjs/system/runtime/ALong.js.map +1 -1
- package/lib/cjs/system/runtime/ASystem.js +1 -1
- package/lib/cjs/system/runtime/ASystem.js.map +1 -1
- package/lib/cjs/system/runtime/Downloader.js +1 -1
- package/lib/cjs/system/runtime/Downloader.js.map +1 -1
- package/lib/cjs/system/runtime/DownloaderNode.js.map +1 -1
- package/lib/cjs/system/runtime/DownloaderXhr.js.map +1 -1
- package/lib/cjs/system/runtime/Message.js +1 -1
- package/lib/cjs/system/runtime/Message.js.map +1 -1
- package/lib/cjs/system/runtime/Numbers.js +1 -1
- package/lib/cjs/system/runtime/Numbers.js.map +1 -1
- package/lib/cjs/system/runtime/Strings.js +1 -1
- package/lib/cjs/system/runtime/Strings.js.map +1 -1
- package/lib/cjs/system/storage/CacheList.js.map +1 -1
- package/lib/cjs/system/storage/ContentLoader.js +1 -1
- package/lib/cjs/system/storage/ContentLoader.js.map +1 -1
- package/lib/cjs/system/storage/NodeFS.js.map +1 -1
- package/lib/cjs/system/storage/PageCachedFile.js.map +1 -1
- package/lib/cjs/system/storage/UrlFS.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/AttributeMask.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/BlockRecord.js +1 -2
- package/lib/esm/pointcloud/format/opc/BlockRecord.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/ContainerFile.js +1 -2
- package/lib/esm/pointcloud/format/opc/ContainerFile.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/DirectoryReader.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/DirectoryRecord.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/EmbeddedAttributeReader.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/FileReader.js +1 -2
- package/lib/esm/pointcloud/format/opc/FileReader.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/GeometryReader.js +1 -2
- package/lib/esm/pointcloud/format/opc/GeometryReader.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/GeometryRecord.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/OPCReader.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/PointReader.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/TileReadBuffer.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/TileRecord.js +1 -2
- package/lib/esm/pointcloud/format/opc/TileRecord.js.map +1 -1
- package/lib/esm/pointcloud/model/AttributeTypes.js +1 -2
- package/lib/esm/pointcloud/model/AttributeTypes.js.map +1 -1
- package/lib/esm/pointcloud/model/AttributeValue.js +1 -2
- package/lib/esm/pointcloud/model/AttributeValue.js.map +1 -1
- package/lib/esm/pointcloud/model/CloudPoint.js +1 -2
- package/lib/esm/pointcloud/model/CloudPoint.js.map +1 -1
- package/lib/esm/pointcloud/model/PointDataRaw.js +1 -2
- package/lib/esm/pointcloud/model/PointDataRaw.js.map +1 -1
- package/lib/esm/pointcloud/model/ReadRequest.js +1 -2
- package/lib/esm/pointcloud/model/ReadRequest.js.map +1 -1
- package/lib/esm/pointcloud/model/StandardAttributes.js +1 -2
- package/lib/esm/pointcloud/model/StandardAttributes.js.map +1 -1
- package/lib/esm/pointcloud/render/Block.js.map +1 -1
- package/lib/esm/pointcloud/render/DataManager.js +1 -2
- package/lib/esm/pointcloud/render/DataManager.js.map +1 -1
- package/lib/esm/pointcloud/render/TileLoadSorter.js +1 -2
- package/lib/esm/pointcloud/render/TileLoadSorter.js.map +1 -1
- package/lib/esm/pointcloud/render/ViewTree.js +1 -2
- package/lib/esm/pointcloud/render/ViewTree.js.map +1 -1
- package/lib/esm/spatial/crs/CRSEngine.js.map +1 -1
- package/lib/esm/spatial/crs/CRSManager.js +1 -2
- package/lib/esm/spatial/crs/CRSManager.js.map +1 -1
- package/lib/esm/spatial/ecrs/CRS.js +1 -2
- package/lib/esm/spatial/ecrs/CRS.js.map +1 -1
- package/lib/esm/spatial/ecrs/CoordinateSystem.js +1 -2
- package/lib/esm/spatial/ecrs/CoordinateSystem.js.map +1 -1
- package/lib/esm/spatial/ecrs/DataFileUnit.js +1 -2
- package/lib/esm/spatial/ecrs/DataFileUnit.js.map +1 -1
- package/lib/esm/spatial/ecrs/Datum.js +1 -2
- package/lib/esm/spatial/ecrs/Datum.js.map +1 -1
- package/lib/esm/spatial/ecrs/Ellipsoid.js.map +1 -1
- package/lib/esm/spatial/ecrs/OnlineEngine.js.map +1 -1
- package/lib/esm/spatial/ecrs/OnlineRegistry.js +1 -2
- package/lib/esm/spatial/ecrs/OnlineRegistry.js.map +1 -1
- package/lib/esm/spatial/ecrs/Operation.js +1 -2
- package/lib/esm/spatial/ecrs/Operation.js.map +1 -1
- package/lib/esm/spatial/ecrs/ParameterValueList.js.map +1 -1
- package/lib/esm/spatial/ecrs/Registry.js +1 -2
- package/lib/esm/spatial/ecrs/Registry.js.map +1 -1
- package/lib/esm/spatial/ecrs/Transform.js +1 -2
- package/lib/esm/spatial/ecrs/Transform.js.map +1 -1
- package/lib/esm/spatial/ecrs/Unit.js +1 -2
- package/lib/esm/spatial/ecrs/Unit.js.map +1 -1
- package/lib/esm/spatial/ecrs/WellKnownText.js +1 -2
- package/lib/esm/spatial/ecrs/WellKnownText.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/HotineObliqueMercator.js +1 -2
- package/lib/esm/spatial/ecrs/projection/HotineObliqueMercator.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/KrovakObliqueConformalConic.js +1 -2
- package/lib/esm/spatial/ecrs/projection/KrovakObliqueConformalConic.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/KrovakObliqueConformalConicEN.js +1 -2
- package/lib/esm/spatial/ecrs/projection/KrovakObliqueConformalConicEN.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/LambertConical1SP.js +1 -2
- package/lib/esm/spatial/ecrs/projection/LambertConical1SP.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/LambertConical2SP.js +1 -2
- package/lib/esm/spatial/ecrs/projection/LambertConical2SP.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/Mercator1SP.js +1 -2
- package/lib/esm/spatial/ecrs/projection/Mercator1SP.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/ObliqueMercator.js +1 -2
- package/lib/esm/spatial/ecrs/projection/ObliqueMercator.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/ObliqueStereographic.js +1 -2
- package/lib/esm/spatial/ecrs/projection/ObliqueStereographic.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/TransverseMercator.js +1 -2
- package/lib/esm/spatial/ecrs/projection/TransverseMercator.js.map +1 -1
- package/lib/esm/spatial/ecrs/transformation/PositionVector.js +1 -2
- package/lib/esm/spatial/ecrs/transformation/PositionVector.js.map +1 -1
- package/lib/esm/spatial/geom/Bounds.js.map +1 -1
- package/lib/esm/spatial/geom/Line.js.map +1 -1
- package/lib/esm/spatial/geom/Transform.js.map +1 -1
- package/lib/esm/system/buffer/Float32Buffer.js +1 -2
- package/lib/esm/system/buffer/Float32Buffer.js.map +1 -1
- package/lib/esm/system/buffer/LittleEndian.js.map +1 -1
- package/lib/esm/system/buffer/Uint16Buffer.js +1 -2
- package/lib/esm/system/buffer/Uint16Buffer.js.map +1 -1
- package/lib/esm/system/buffer/Uint8Buffer.js +1 -2
- package/lib/esm/system/buffer/Uint8Buffer.js.map +1 -1
- package/lib/esm/system/collection/AList.js.map +1 -1
- package/lib/esm/system/runtime/ALong.js +1 -2
- package/lib/esm/system/runtime/ALong.js.map +1 -1
- package/lib/esm/system/runtime/ASystem.js +1 -2
- package/lib/esm/system/runtime/ASystem.js.map +1 -1
- package/lib/esm/system/runtime/Downloader.js +1 -2
- package/lib/esm/system/runtime/Downloader.js.map +1 -1
- package/lib/esm/system/runtime/DownloaderNode.js.map +1 -1
- package/lib/esm/system/runtime/DownloaderXhr.js.map +1 -1
- package/lib/esm/system/runtime/Message.js +1 -2
- package/lib/esm/system/runtime/Message.js.map +1 -1
- package/lib/esm/system/runtime/Numbers.js +1 -2
- package/lib/esm/system/runtime/Numbers.js.map +1 -1
- package/lib/esm/system/runtime/Strings.js +1 -2
- package/lib/esm/system/runtime/Strings.js.map +1 -1
- package/lib/esm/system/storage/CacheList.js.map +1 -1
- package/lib/esm/system/storage/ContentLoader.js +1 -2
- package/lib/esm/system/storage/ContentLoader.js.map +1 -1
- package/lib/esm/system/storage/NodeFS.js.map +1 -1
- package/lib/esm/system/storage/PageCachedFile.js.map +1 -1
- package/lib/esm/system/storage/UrlFS.js.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewTree.js","sourceRoot":"","sources":["../../../../src/pointcloud/render/ViewTree.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAWH,yDAAsD;AACtD,0DAAuD;AAEvD,kDAA+C;AAI/C,mCAAgC;AAIhC;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,QAAQ;IAgBpB;;;;OAIG;IACH,YAAmB,WAAwB,EAAE,MAAoB,EAAE,UAAkB;QACpF,0BAA0B;QAC1B,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,0BAA0B;QAC1B,IAAI,CAAC,W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K,GAAG,IAAI,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,GAAG,GAAG,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,GAAG,GAAG,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;YACxM,IAAI,WAAW,GAAW,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YACxF,IAAI,QAAQ,CAAC,KAAK;gBAAE,iBAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,kBAAkB,GAAG,WAAW,CAAC,CAAC;YACrF,IAAI,WAAW,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE;gBAC1C,mBAAmB;gBACnB,IAAI,QAAQ,CAAC,KAAK;oBAAE,iBAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;gBACjE,IAAI,CAAC,cAAc,CAAC,WAAW,EAAE,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC;aAC9H;SACD;IACF,CAAC;;AAtUD,8BAA8B;AACN,eAAM,GAAW,UAAU,CAAC;AAEpD,kBAAkB;AACM,cAAK,GAAY,KAAK,CAAC;AALnC,4BAAQ","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module OrbitGT\r\n */\r\n\r\n//package orbitgt.pointcloud.render;\r\n\r\ntype int8 = number;\r\ntype int16 = number;\r\ntype int32 = number;\r\ntype float32 = number;\r\ntype float64 = number;\r\n\r\nimport { Bounds } from \"../../spatial/geom/Bounds\";\r\nimport { AList } from \"../../system/collection/AList\";\r\nimport { Message } from \"../../system/runtime/Message\";\r\nimport { BlockIndex } from \"../model/BlockIndex\";\r\nimport { GridIndex } from \"../model/GridIndex\";\r\nimport { PointData } from \"../model/PointData\";\r\nimport { TileIndex } from \"../model/TileIndex\";\r\nimport { AViewRequest } from \"./AViewRequest\";\r\nimport { Block } from \"./Block\";\r\nimport { DataManager } from \"./DataManager\";\r\nimport { Level } from \"./Level\";\r\n\r\n/**\r\n * Class TileSpatialIndex manages a spatial index of levels, blocks and tiles in pointcloud. The index does not store data, only block and tile indexes.\r\n *\r\n * @version 1.0 November 2015\r\n */\r\n/** @internal */\r\nexport class ViewTree {\r\n\t/** The name of this module */\r\n\tprivate static readonly MODULE: string = \"ViewTree\";\r\n\r\n\t/** Debug mode? */\r\n\tprivate static readonly DEBUG: boolean = false;\r\n\r\n\t/** The data manager */\r\n\tprivate _dataManager: DataManager;\r\n\t/** The levels */\r\n\tprivate _levels: Array<Level>;\r\n\t/** The data bounds */\r\n\tprivate _dataBounds: Bounds;\r\n\t/** The root blocks */\r\n\tprivate _rootBlocks: AList<Block>;\r\n\r\n\t/**\r\n\t * Create a new tree.\r\n\t * @param levels the levels.\r\n\t * @param dataBounds the data bounds.\r\n\t */\r\n\tpublic constructor(dataManager: DataManager, levels: Array<Level>, dataBounds: Bounds) {\r\n\t\t/* Store the parameters */\r\n\t\tthis._dataManager = dataManager;\r\n\t\tthis._levels = levels;\r\n\t\tthis._dataBounds = dataBounds;\r\n\t\t/* Find the root blocks */\r\n\t\tthis._rootBlocks = this.findRootBlocks();\r\n\t}\r\n\r\n\t/**\r\n\t * Find all root blocks (dropping of single-point tiles during pyramid creation can lead to missing branches).\r\n\t * @return all root blocks.\r\n\t */\r\n\tprivate findRootBlocks(): AList<Block> {\r\n\t\t/* Check some levels below the top */\r\n\t\tlet startLevel: int32 = (this._levels.length - 6);\r\n\t\tif (startLevel < 0) startLevel = 0;\r\n\t\tMessage.print(ViewTree.MODULE, \"Finding root blocks starting at level index \" + startLevel + \" of \" + this._levels.length);\r\n\t\t/* Check the levels */\r\n\t\tlet rootBlocks: AList<Block> = new AList<Block>();\r\n\t\tlet nextLevelIndex: GridIndex = new GridIndex(0, 0, 0);\r\n\t\tfor (let i: number = startLevel; i < this._levels.length - 1; i++) {\r\n\t\t\t/* Check all blocks in the level */\r\n\t\t\tlet level: Level = this._levels[i];\r\n\t\t\tfor (let block of level.getBlocks()) {\r\n\t\t\t\t/* Non-top level? */\r\n\t\t\t\tlet isRoot: boolean = true;\r\n\t\t\t\tif (i < this._levels.length - 2) {\r\n\t\t\t\t\t/* Do we have a parent block in the next level? */\r\n\t\t\t\t\tblock.getBlockIndex().gridIndex.getNextLevelIndex(nextLevelIndex);\r\n\t\t\t\t\tisRoot = (this._levels[i + 1].findBlockGridIndex(nextLevelIndex) == null);\r\n\t\t\t\t\tif (isRoot) Message.print(ViewTree.MODULE, \"Block L\" + i + \" \" + block.getBlockIndex().gridIndex + \" is non-top root\");\r\n\t\t\t\t}\r\n\t\t\t\t/* Add to the list? */\r\n\t\t\t\tif (isRoot) rootBlocks.add(block);\r\n\t\t\t}\r\n\t\t}\r\n\t\t/* Return the roots */\r\n\t\tMessage.print(ViewTree.MODULE, \"Found \" + rootBlocks.size() + \" root blocks\");\r\n\t\treturn rootBlocks;\r\n\t}\r\n\r\n\t/**\r\n\t * Get the number of levels.\r\n\t * @return the number of levels.\r\n\t */\r\n\tpublic getLevelCount(): int32 {\r\n\t\treturn this._levels.length;\r\n\t}\r\n\r\n\t/**\r\n\t * Get a level.\r\n\t * @param index the index of the level.\r\n\t * @return the level.\r\n\t */\r\n\tpublic getLevel(index: int32): Level {\r\n\t\treturn this._levels[index];\r\n\t}\r\n\r\n\t/**\r\n\t * Get the data bounds.\r\n\t * @return the data bounds.\r\n\t */\r\n\tpublic getDataBounds(): Bounds {\r\n\t\treturn this._dataBounds;\r\n\t}\r\n\r\n\t/**\r\n\t * Set the blocks for a level (after a data load operation).\r\n\t * @param level the level.\r\n\t * @param blockIndexes the indexes of the blocks in the level.\r\n\t */\r\n\tpublic setLevelBlocks(level: Level, blockIndexes: Array<BlockIndex>): void {\r\n\t\tif (blockIndexes == null) return;\r\n\t\tlet blockList: Array<Block> = new Array<Block>(blockIndexes.length);\r\n\t\tfor (let i: number = 0; i < blockIndexes.length; i++) blockList[i] = new Block(blockIndexes[i]);\r\n\t\tlevel.setBlockList(blockList);\r\n\t\tMessage.print(ViewTree.MODULE, \"Loaded \" + blockIndexes.length + \" blocks for level \" + level.getIndex());\r\n\t}\r\n\r\n\t/**\r\n\t * Set the tiles for a block (after a data load operation).\r\n\t * @param blockIndex the index of the block.\r\n\t * @param tileIndexes the indexes of the tiles in the block.\r\n\t */\r\n\tpublic setBlockTiles(blockIndex: BlockIndex, tileIndexes: Array<TileIndex>): void {\r\n\t\tlet level: Level = this._levels[blockIndex.level];\r\n\t\tlet block: Block = level.findBlock(blockIndex);\r\n\t\tblock.setTiles(tileIndexes);\r\n\t}\r\n\r\n\t/**\r\n\t * Split a tile into lower-level tiles.\r\n\t * @param level the level of the tile to split.\r\n\t * @param tile the tile to split.\r\n\t * @param childLevel the lower level of the tile.\r\n\t * @param children the list of children to split into.\r\n * @param levelsToLoad the list of levels to load.\r\n * @param blocksToLoad the list of blocks to load.\r\n\t * @return true if the list of children is complete.\r\n\t */\r\n\tprivate splitTile(level: Level, tile: TileIndex, childLevel: Level, children: AList<TileIndex>, levelsToLoad: AList<Level>, blocksToLoad: AList<BlockIndex>): boolean {\r\n\t\t/* Clear the result */\r\n\t\tchildren.clear();\r\n\t\t/* Already calculated? */\r\n\t\tlet childList: Array<TileIndex> = tile.children;\r\n\t\tif (childList != null) {\r\n\t\t\t/* Return */\r\n\t\t\tfor (let child of childList) children.add(child);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t/* Assume we have a complete list of children */\r\n\t\tlet complete: boolean = true;\r\n\t\t/* Unloaded level? */\r\n\t\tif (childLevel.getBlockCount() == 0) {\r\n\t\t\t/* No need to continue, we need the level block list */\r\n\t\t\tif (levelsToLoad.contains(childLevel) == false) levelsToLoad.add(childLevel);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t/* Check the 8 possible child tiles */\r\n\t\tlet index: GridIndex = tile.gridIndex;\r\n\t\tlet childIndex: GridIndex = new GridIndex(0, 0, 0);\r\n\t\tfor (let z: number = 0; z < 2; z++) for (let y: number = 0; y < 2; y++) for (let x: number = 0; x < 2; x++) {\r\n\t\t\t/* Get the index of the child */\r\n\t\t\tchildIndex.x = (2 * index.x + x);\r\n\t\t\tchildIndex.y = (2 * index.y + y);\r\n\t\t\tchildIndex.z = (2 * index.z + z);\r\n\t\t\t/* Find the block */\r\n\t\t\tlet block: Block = childLevel.findBlockForTile(childIndex);\r\n\t\t\tif (block == null) {\r\n\t\t\t\t/* This should not happen */\r\n\t\t\t\tMessage.printWarning(ViewTree.MODULE, \"Unable to find tile block \" + childIndex + \" in child level \" + childLevel.getIndex() + \" (\" + childLevel.getBlockCount() + \" blocks)\");\r\n\t\t\t\tcomplete = false;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t/* No tile info in the block? */\r\n\t\t\tif (block.hasTiles() == false) {\r\n\t\t\t\t/* Load the block data */\r\n\t\t\t\tif (blocksToLoad.contains(block.getBlockIndex()) == false) blocksToLoad.add(block.getBlockIndex());\r\n\t\t\t\tcomplete = false;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t/* Find the child */\r\n\t\t\t\tlet child: TileIndex = block.findTile(childIndex);\r\n\t\t\t\tif (child != null) children.add(child);\r\n\t\t\t}\r\n\t\t}\r\n\t\t/* Store the result if complete */\r\n\t\tif (complete) {\r\n\t\t\t/* Store */\r\n\t\t\tlet tileChildren: Array<TileIndex> = new Array<TileIndex>(children.size());\r\n\t\t\tfor (let i: number = 0; i < tileChildren.length; i++) tileChildren[i] = children.get(i);\r\n\t\t\ttile.children = tileChildren;\r\n\t\t}\r\n\t\t/* Do we have all children? */\r\n\t\treturn complete;\r\n\t}\r\n\r\n\t/**\r\n\t * Is all tile data available for rendering?\r\n\t * @param viewRequest the view request.\r\n\t * @param tiles a list of tiles to check.\r\n\t * @param missingTiles the list of tiles whose data is missing.\r\n\t */\r\n\tprivate checkDataAvailable(viewRequest: AViewRequest, tiles: AList<TileIndex>, missingTiles: AList<TileIndex>): void {\r\n\t\t/* Check all tiles */\r\n\t\tmissingTiles.clear();\r\n\t\tfor (let i: number = 0; i < tiles.size(); i++) {\r\n\t\t\t/* Get the next tile */\r\n\t\t\tlet tile: TileIndex = tiles.get(i);\r\n\t\t\t/* Not available? */\r\n\t\t\tif (this._dataManager.isTileLoaded(tile) == null) {\r\n\t\t\t\t/* Request to load the block */\r\n\t\t\t\tmissingTiles.add(tile);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t/* Touch the block */\r\n\t\t\t\ttile.accessTime = viewRequest.getFrameTime();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Is all tile data available for rendering?\r\n\t * @param viewRequest the view request.\r\n\t * @param tiles a list of tiles to check.\r\n\t * @return true if the tile data is available.\r\n\t */\r\n\tprivate isDataAvailable(viewRequest: AViewRequest, tiles: Array<TileIndex>): boolean {\r\n\t\t/* Check all tiles */\r\n\t\tfor (let i: number = 0; i < tiles.length; i++) {\r\n\t\t\t/* Get the next tile */\r\n\t\t\tlet tile: TileIndex = tiles[i];\r\n\t\t\t/* Not available? */\r\n\t\t\tif (this._dataManager.isTileLoaded(tile) == null) return false;\r\n\t\t}\r\n\t\t/* Available */\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * Add visible tiles to the view.\r\n\t * @param viewRequest the view request.\r\n\t * @param level the level of the tiles.\r\n\t * @param tiles the tiles to check.\r\n\t * @param visibleTiles the list of visible tiles to add to.\r\n\t */\r\n\tprivate addTilesToView(viewRequest: AViewRequest, level: Level, tiles: Array<TileIndex>, levelsToLoad: AList<Level>, blocksToLoad: AList<BlockIndex>, tilesToLoad: AList<TileIndex>, tilesToRender: AList<PointData>): void {\r\n\t\t/* No tiles? */\r\n\t\tif (tiles == null) return;\r\n\t\t/* Make the lists */\r\n\t\tlet childTiles: AList<TileIndex> = new AList<TileIndex>();\r\n\t\tlet missingChildTiles: AList<TileIndex> = new AList<TileIndex>();\r\n\t\t/* Check all tiles */\r\n\t\tfor (let i: number = 0; i < tiles.length; i++) {\r\n\t\t\t/* Get the next tile */\r\n\t\t\tlet tile: TileIndex = tiles[i];\r\n\t\t\tif (ViewTree.DEBUG) Message.print(ViewTree.MODULE, \"Checking tile L\" + tile.level + \" (\" + tile.gridIndex.x + \",\" + tile.gridIndex.y + \",\" + tile.gridIndex.z + \")\");\r\n\t\t\t/* Visible? */\r\n\t\t\tlet tileBounds: Bounds = level.getTileGrid().getCellBounds(tile.gridIndex).getIntersection(this._dataBounds);\r\n\t\t\tif (ViewTree.DEBUG) Message.print(ViewTree.MODULE, \"> level \" + tile.level);\r\n\t\t\tif (viewRequest.isVisibleBox(tileBounds)) {\r\n\t\t\t\t/* Has the tile been loaded? */\r\n\t\t\t\tlet tileData: PointData = this._dataManager.isTileLoaded(tile);\r\n\t\t\t\tlet tileAvailable: boolean = (tileData != null);\r\n\t\t\t\ttile.accessTime = viewRequest.getFrameTime();\r\n\t\t\t\tif (ViewTree.DEBUG) Message.print(ViewTree.MODULE, \" > available? \" + tileAvailable);\r\n\t\t\t\t/* We load all intermediate tiles to avoid holes in the coverage */\r\n\t\t\t\tif (tileAvailable == false) tilesToLoad.add(tile);\r\n\t\t\t\t/* Split the tile? */\r\n\t\t\t\tlet shouldSplit: boolean = (level.getIndex() > 0) && viewRequest.shouldSplit(level, tile);\r\n\t\t\t\tif (shouldSplit) {\r\n\t\t\t\t\tif (ViewTree.DEBUG) Message.print(ViewTree.MODULE, \" > visible, but needs splitting\");\r\n\t\t\t\t\t/* Find the children at the lower level */\r\n\t\t\t\t\tlet childLevel: Level = this._levels[level.getIndex() - 1];\r\n\t\t\t\t\tlet completeChildList: boolean = this.splitTile(level, tile, childLevel, childTiles, levelsToLoad, blocksToLoad);\r\n\t\t\t\t\tif (completeChildList == false) {\r\n\t\t\t\t\t\tif (ViewTree.DEBUG) Message.print(ViewTree.MODULE, \" > loading child indexes\");\r\n\t\t\t\t\t\t/* Display the tile while we wait for the block-tiles to load */\r\n\t\t\t\t\t\tif (tileAvailable) tilesToRender.add(tileData);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t/* Are all children available with their data? */\r\n\t\t\t\t\t\tthis.checkDataAvailable(viewRequest, childTiles, missingChildTiles);\r\n\t\t\t\t\t\tif (missingChildTiles.size() == 0) {\r\n\t\t\t\t\t\t\tif (ViewTree.DEBUG) Message.print(ViewTree.MODULE, \" > rendering children\");\r\n\t\t\t\t\t\t\t/* Add the children */\r\n\t\t\t\t\t\t\tlet childTiles2: Array<TileIndex> = new Array<TileIndex>(childTiles.size());\r\n\t\t\t\t\t\t\tfor (let j: number = 0; j < childTiles2.length; j++) childTiles2[j] = childTiles.get(j);\r\n\t\t\t\t\t\t\tthis.addTilesToView(viewRequest, childLevel, childTiles2, levelsToLoad, blocksToLoad, tilesToLoad, tilesToRender);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tif (ViewTree.DEBUG) Message.print(ViewTree.MODULE, \" > loading children\");\r\n\t\t\t\t\t\t\t/* Request for the missing children to be loaded */\r\n\t\t\t\t\t\t\tfor (let j: number = 0; j < missingChildTiles.size(); j++) tilesToLoad.add(missingChildTiles.get(j));\r\n\t\t\t\t\t\t\t/* Display the tile while we wait for the child tiles to load */\r\n\t\t\t\t\t\t\tif (tileAvailable) tilesToRender.add(tileData);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t/* Display the tile */\r\n\t\t\t\t\tif (ViewTree.DEBUG) Message.print(ViewTree.MODULE, \" > visible\");\r\n\t\t\t\t\tif (tileAvailable) tilesToRender.add(tileData);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t/* Log */\r\n\t\t\t\tif (ViewTree.DEBUG) Message.print(ViewTree.MODULE, \" > not visible\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Find tile indexes for a 3D view.\r\n\t * @param viewRequest the request parameters.\r\n\t * @param visibleTiles the list of visible tiles to add to.\r\n\t * @param availableTiles the set of available tiles.\r\n\t * @param visibleAvailableTiles the list if visible and available tiles to add to.\r\n\t */\r\n\tpublic renderView3D(viewRequest: AViewRequest, levelsToLoad: AList<Level>, blocksToLoad: AList<BlockIndex>, tilesToLoad: AList<TileIndex>, tilesToRender: AList<PointData>): void {\r\n\t\t/* Log? */\r\n\t\tif (ViewTree.DEBUG) Message.print(ViewTree.MODULE, \"Finding pointcloud tiles to render\");\r\n\t\tif (ViewTree.DEBUG) Message.print(ViewTree.MODULE, \" > dataBounds: \" + this._dataBounds);\r\n\t\t//if (DEBUG) Message.print(MODULE,\" > view: \"+viewRequest.getViewProjection());\r\n\t\t//if (DEBUG) Message.print(MODULE,\" > distance: \"+viewRequest.getDistanceRange());\r\n\t\t//if (DEBUG) Message.print(MODULE,\" > model-transform: \"+viewRequest.getModelTransform());\r\n\t\t/* Check all blocks */\r\n\t\ttilesToRender.clear();\r\n\t\tif (ViewTree.DEBUG) Message.print(ViewTree.MODULE, \"Checking \" + this._rootBlocks.size() + \" root blocks\");\r\n\t\tfor (let i: number = 0; i < this._rootBlocks.size(); i++) // start from the root tiles\r\n\t\t{\r\n\t\t\t/* Visible? */\r\n\t\t\tlet block: Block = this._rootBlocks.get(i);\r\n\t\t\tlet blockIndex: BlockIndex = block.getBlockIndex();\r\n\t\t\tlet level: Level = this._levels[blockIndex.level];\r\n\t\t\t/* Visible? */\r\n\t\t\tif (ViewTree.DEBUG) Message.print(ViewTree.MODULE, \"Checking top-level block L\" + blockIndex.level + \" (\" + blockIndex.gridIndex.x + \",\" + blockIndex.gridIndex.y + \",\" + blockIndex.gridIndex.z + \")\");\r\n\t\t\tlet blockBounds: Bounds = block.getBlockBounds(level).getIntersection(this._dataBounds);\r\n\t\t\tif (ViewTree.DEBUG) Message.print(ViewTree.MODULE, \" > blockBounds: \" + blockBounds);\r\n\t\t\tif (viewRequest.isVisibleBox(blockBounds)) {\r\n\t\t\t\t/* Add the tiles */\r\n\t\t\t\tif (ViewTree.DEBUG) Message.print(ViewTree.MODULE, \" > visible\");\r\n\t\t\t\tthis.addTilesToView(viewRequest, level, block.getTiles(blocksToLoad), levelsToLoad, blocksToLoad, tilesToLoad, tilesToRender);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ViewTree.js","sourceRoot":"","sources":["../../../../src/pointcloud/render/ViewTree.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAWH,yDAAsD;AACtD,0DAAuD;AAEvD,kDAA+C;AAI/C,mCAAgC;AAIhC;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,QAAQ;IAgBpB;;;;OAIG;IACH,YAAmB,WAAwB,EAAE,MAAoB,EAAE,UAAkB;QACpF,0BAA0B;QAC1B,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,0BAA0B;QAC1B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;IAC1C,CAAC;IAED;;;OAGG;IACK,cAAc;QACrB,qCAAqC;QACrC,IAAI,UAAU,GAAU,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAClD,IAAI,UAAU,GAAG,CAAC;YAAE,UAAU,GAAG,CAAC,CAAC;QACnC,iBAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,8CAA8C,GAAG,UAAU,GAAG,MAAM,GAAG,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GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,GAAG,GAAG,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;YACxM,IAAI,WAAW,GAAW,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YACxF,IAAI,QAAQ,CAAC,KAAK;gBAAE,iBAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,kBAAkB,GAAG,WAAW,CAAC,CAAC;YACrF,IAAI,WAAW,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE,CAAC;gBAC3C,mBAAmB;gBACnB,IAAI,QAAQ,CAAC,KAAK;oBAAE,iBAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;gBACjE,IAAI,CAAC,cAAc,CAAC,WAAW,EAAE,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC;YAC/H,CAAC;QACF,CAAC;IACF,CAAC;;AAvUF,4BAwUC;AAvUA,8BAA8B;AACN,eAAM,GAAW,UAAU,CAAC;AAEpD,kBAAkB;AACM,cAAK,GAAY,KAAK,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module OrbitGT\r\n */\r\n\r\n//package orbitgt.pointcloud.render;\r\n\r\ntype int8 = number;\r\ntype int16 = number;\r\ntype int32 = number;\r\ntype float32 = number;\r\ntype float64 = number;\r\n\r\nimport { Bounds } from \"../../spatial/geom/Bounds\";\r\nimport { AList } from \"../../system/collection/AList\";\r\nimport { Message } from \"../../system/runtime/Message\";\r\nimport { BlockIndex } from \"../model/BlockIndex\";\r\nimport { GridIndex } from \"../model/GridIndex\";\r\nimport { PointData } from \"../model/PointData\";\r\nimport { TileIndex } from \"../model/TileIndex\";\r\nimport { AViewRequest } from \"./AViewRequest\";\r\nimport { Block } from \"./Block\";\r\nimport { DataManager } from \"./DataManager\";\r\nimport { Level } from \"./Level\";\r\n\r\n/**\r\n * Class TileSpatialIndex manages a spatial index of levels, blocks and tiles in pointcloud. The index does not store data, only block and tile indexes.\r\n *\r\n * @version 1.0 November 2015\r\n */\r\n/** @internal */\r\nexport class ViewTree {\r\n\t/** The name of this module */\r\n\tprivate static readonly MODULE: string = \"ViewTree\";\r\n\r\n\t/** Debug mode? */\r\n\tprivate static readonly DEBUG: boolean = false;\r\n\r\n\t/** The data manager */\r\n\tprivate _dataManager: DataManager;\r\n\t/** The levels */\r\n\tprivate _levels: Array<Level>;\r\n\t/** The data bounds */\r\n\tprivate _dataBounds: Bounds;\r\n\t/** The root blocks */\r\n\tprivate _rootBlocks: AList<Block>;\r\n\r\n\t/**\r\n\t * Create a new tree.\r\n\t * @param levels the levels.\r\n\t * @param dataBounds the data bounds.\r\n\t */\r\n\tpublic constructor(dataManager: DataManager, levels: Array<Level>, dataBounds: Bounds) {\r\n\t\t/* Store the parameters */\r\n\t\tthis._dataManager = dataManager;\r\n\t\tthis._levels = levels;\r\n\t\tthis._dataBounds = dataBounds;\r\n\t\t/* Find the root blocks */\r\n\t\tthis._rootBlocks = this.findRootBlocks();\r\n\t}\r\n\r\n\t/**\r\n\t * Find all root blocks (dropping of single-point tiles during pyramid creation can lead to missing branches).\r\n\t * @return all root blocks.\r\n\t */\r\n\tprivate findRootBlocks(): AList<Block> {\r\n\t\t/* Check some levels below the top */\r\n\t\tlet startLevel: int32 = (this._levels.length - 6);\r\n\t\tif (startLevel < 0) startLevel = 0;\r\n\t\tMessage.print(ViewTree.MODULE, \"Finding root blocks starting at level index \" + startLevel + \" of \" + this._levels.length);\r\n\t\t/* Check the levels */\r\n\t\tlet rootBlocks: AList<Block> = new AList<Block>();\r\n\t\tlet nextLevelIndex: GridIndex = new GridIndex(0, 0, 0);\r\n\t\tfor (let i: number = startLevel; i < this._levels.length - 1; i++) {\r\n\t\t\t/* Check all blocks in the level */\r\n\t\t\tlet level: Level = this._levels[i];\r\n\t\t\tfor (let block of level.getBlocks()) {\r\n\t\t\t\t/* Non-top level? */\r\n\t\t\t\tlet isRoot: boolean = true;\r\n\t\t\t\tif (i < this._levels.length - 2) {\r\n\t\t\t\t\t/* Do we have a parent block in the next level? */\r\n\t\t\t\t\tblock.getBlockIndex().gridIndex.getNextLevelIndex(nextLevelIndex);\r\n\t\t\t\t\tisRoot = (this._levels[i + 1].findBlockGridIndex(nextLevelIndex) == null);\r\n\t\t\t\t\tif (isRoot) Message.print(ViewTree.MODULE, \"Block L\" + i + \" \" + block.getBlockIndex().gridIndex + \" is non-top root\");\r\n\t\t\t\t}\r\n\t\t\t\t/* Add to the list? */\r\n\t\t\t\tif (isRoot) rootBlocks.add(block);\r\n\t\t\t}\r\n\t\t}\r\n\t\t/* Return the roots */\r\n\t\tMessage.print(ViewTree.MODULE, \"Found \" + rootBlocks.size() + \" root blocks\");\r\n\t\treturn rootBlocks;\r\n\t}\r\n\r\n\t/**\r\n\t * Get the number of levels.\r\n\t * @return the number of levels.\r\n\t */\r\n\tpublic getLevelCount(): int32 {\r\n\t\treturn this._levels.length;\r\n\t}\r\n\r\n\t/**\r\n\t * Get a level.\r\n\t * @param index the index of the level.\r\n\t * @return the level.\r\n\t */\r\n\tpublic getLevel(index: int32): Level {\r\n\t\treturn this._levels[index];\r\n\t}\r\n\r\n\t/**\r\n\t * Get the data bounds.\r\n\t * @return the data bounds.\r\n\t */\r\n\tpublic getDataBounds(): Bounds {\r\n\t\treturn this._dataBounds;\r\n\t}\r\n\r\n\t/**\r\n\t * Set the blocks for a level (after a data load operation).\r\n\t * @param level the level.\r\n\t * @param blockIndexes the indexes of the blocks in the level.\r\n\t */\r\n\tpublic setLevelBlocks(level: Level, blockIndexes: Array<BlockIndex>): void {\r\n\t\tif (blockIndexes == null) return;\r\n\t\tlet blockList: Array<Block> = new Array<Block>(blockIndexes.length);\r\n\t\tfor (let i: number = 0; i < blockIndexes.length; i++) blockList[i] = new Block(blockIndexes[i]);\r\n\t\tlevel.setBlockList(blockList);\r\n\t\tMessage.print(ViewTree.MODULE, \"Loaded \" + blockIndexes.length + \" blocks for level \" + level.getIndex());\r\n\t}\r\n\r\n\t/**\r\n\t * Set the tiles for a block (after a data load operation).\r\n\t * @param blockIndex the index of the block.\r\n\t * @param tileIndexes the indexes of the tiles in the block.\r\n\t */\r\n\tpublic setBlockTiles(blockIndex: BlockIndex, tileIndexes: Array<TileIndex>): void {\r\n\t\tlet level: Level = this._levels[blockIndex.level];\r\n\t\tlet block: Block = level.findBlock(blockIndex);\r\n\t\tblock.setTiles(tileIndexes);\r\n\t}\r\n\r\n\t/**\r\n\t * Split a tile into lower-level tiles.\r\n\t * @param level the level of the tile to split.\r\n\t * @param tile the tile to split.\r\n\t * @param childLevel the lower level of the tile.\r\n\t * @param children the list of children to split into.\r\n * @param levelsToLoad the list of levels to load.\r\n * @param blocksToLoad the list of blocks to load.\r\n\t * @return true if the list of children is complete.\r\n\t */\r\n\tprivate splitTile(level: Level, tile: TileIndex, childLevel: Level, children: AList<TileIndex>, levelsToLoad: AList<Level>, blocksToLoad: AList<BlockIndex>): boolean {\r\n\t\t/* Clear the result */\r\n\t\tchildren.clear();\r\n\t\t/* Already calculated? */\r\n\t\tlet childList: Array<TileIndex> = tile.children;\r\n\t\tif (childList != null) {\r\n\t\t\t/* Return */\r\n\t\t\tfor (let child of childList) children.add(child);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t/* Assume we have a complete list of children */\r\n\t\tlet complete: boolean = true;\r\n\t\t/* Unloaded level? */\r\n\t\tif (childLevel.getBlockCount() == 0) {\r\n\t\t\t/* No need to continue, we need the level block list */\r\n\t\t\tif (levelsToLoad.contains(childLevel) == false) levelsToLoad.add(childLevel);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t/* Check the 8 possible child tiles */\r\n\t\tlet index: GridIndex = tile.gridIndex;\r\n\t\tlet childIndex: GridIndex = new GridIndex(0, 0, 0);\r\n\t\tfor (let z: number = 0; z < 2; z++) for (let y: number = 0; y < 2; y++) for (let x: number = 0; x < 2; x++) {\r\n\t\t\t/* Get the index of the child */\r\n\t\t\tchildIndex.x = (2 * index.x + x);\r\n\t\t\tchildIndex.y = (2 * index.y + y);\r\n\t\t\tchildIndex.z = (2 * index.z + z);\r\n\t\t\t/* Find the block */\r\n\t\t\tlet block: Block = childLevel.findBlockForTile(childIndex);\r\n\t\t\tif (block == null) {\r\n\t\t\t\t/* This should not happen */\r\n\t\t\t\tMessage.printWarning(ViewTree.MODULE, \"Unable to find tile block \" + childIndex + \" in child level \" + childLevel.getIndex() + \" (\" + childLevel.getBlockCount() + \" blocks)\");\r\n\t\t\t\tcomplete = false;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t/* No tile info in the block? */\r\n\t\t\tif (block.hasTiles() == false) {\r\n\t\t\t\t/* Load the block data */\r\n\t\t\t\tif (blocksToLoad.contains(block.getBlockIndex()) == false) blocksToLoad.add(block.getBlockIndex());\r\n\t\t\t\tcomplete = false;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t/* Find the child */\r\n\t\t\t\tlet child: TileIndex = block.findTile(childIndex);\r\n\t\t\t\tif (child != null) children.add(child);\r\n\t\t\t}\r\n\t\t}\r\n\t\t/* Store the result if complete */\r\n\t\tif (complete) {\r\n\t\t\t/* Store */\r\n\t\t\tlet tileChildren: Array<TileIndex> = new Array<TileIndex>(children.size());\r\n\t\t\tfor (let i: number = 0; i < tileChildren.length; i++) tileChildren[i] = children.get(i);\r\n\t\t\ttile.children = tileChildren;\r\n\t\t}\r\n\t\t/* Do we have all children? */\r\n\t\treturn complete;\r\n\t}\r\n\r\n\t/**\r\n\t * Is all tile data available for rendering?\r\n\t * @param viewRequest the view request.\r\n\t * @param tiles a list of tiles to check.\r\n\t * @param missingTiles the list of tiles whose data is missing.\r\n\t */\r\n\tprivate checkDataAvailable(viewRequest: AViewRequest, tiles: AList<TileIndex>, missingTiles: AList<TileIndex>): void {\r\n\t\t/* Check all tiles */\r\n\t\tmissingTiles.clear();\r\n\t\tfor (let i: number = 0; i < tiles.size(); i++) {\r\n\t\t\t/* Get the next tile */\r\n\t\t\tlet tile: TileIndex = tiles.get(i);\r\n\t\t\t/* Not available? */\r\n\t\t\tif (this._dataManager.isTileLoaded(tile) == null) {\r\n\t\t\t\t/* Request to load the block */\r\n\t\t\t\tmissingTiles.add(tile);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t/* Touch the block */\r\n\t\t\t\ttile.accessTime = viewRequest.getFrameTime();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Is all tile data available for rendering?\r\n\t * @param viewRequest the view request.\r\n\t * @param tiles a list of tiles to check.\r\n\t * @return true if the tile data is available.\r\n\t */\r\n\tprivate isDataAvailable(viewRequest: AViewRequest, tiles: Array<TileIndex>): boolean {\r\n\t\t/* Check all tiles */\r\n\t\tfor (let i: number = 0; i < tiles.length; i++) {\r\n\t\t\t/* Get the next tile */\r\n\t\t\tlet tile: TileIndex = tiles[i];\r\n\t\t\t/* Not available? */\r\n\t\t\tif (this._dataManager.isTileLoaded(tile) == null) return false;\r\n\t\t}\r\n\t\t/* Available */\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * Add visible tiles to the view.\r\n\t * @param viewRequest the view request.\r\n\t * @param level the level of the tiles.\r\n\t * @param tiles the tiles to check.\r\n\t * @param visibleTiles the list of visible tiles to add to.\r\n\t */\r\n\tprivate addTilesToView(viewRequest: AViewRequest, level: Level, tiles: Array<TileIndex>, levelsToLoad: AList<Level>, blocksToLoad: AList<BlockIndex>, tilesToLoad: AList<TileIndex>, tilesToRender: AList<PointData>): void {\r\n\t\t/* No tiles? */\r\n\t\tif (tiles == null) return;\r\n\t\t/* Make the lists */\r\n\t\tlet childTiles: AList<TileIndex> = new AList<TileIndex>();\r\n\t\tlet missingChildTiles: AList<TileIndex> = new AList<TileIndex>();\r\n\t\t/* Check all tiles */\r\n\t\tfor (let i: number = 0; i < tiles.length; i++) {\r\n\t\t\t/* Get the next tile */\r\n\t\t\tlet tile: TileIndex = tiles[i];\r\n\t\t\tif (ViewTree.DEBUG) Message.print(ViewTree.MODULE, \"Checking tile L\" + tile.level + \" (\" + tile.gridIndex.x + \",\" + tile.gridIndex.y + \",\" + tile.gridIndex.z + \")\");\r\n\t\t\t/* Visible? */\r\n\t\t\tlet tileBounds: Bounds = level.getTileGrid().getCellBounds(tile.gridIndex).getIntersection(this._dataBounds);\r\n\t\t\tif (ViewTree.DEBUG) Message.print(ViewTree.MODULE, \"> level \" + tile.level);\r\n\t\t\tif (viewRequest.isVisibleBox(tileBounds)) {\r\n\t\t\t\t/* Has the tile been loaded? */\r\n\t\t\t\tlet tileData: PointData = this._dataManager.isTileLoaded(tile);\r\n\t\t\t\tlet tileAvailable: boolean = (tileData != null);\r\n\t\t\t\ttile.accessTime = viewRequest.getFrameTime();\r\n\t\t\t\tif (ViewTree.DEBUG) Message.print(ViewTree.MODULE, \" > available? \" + tileAvailable);\r\n\t\t\t\t/* We load all intermediate tiles to avoid holes in the coverage */\r\n\t\t\t\tif (tileAvailable == false) tilesToLoad.add(tile);\r\n\t\t\t\t/* Split the tile? */\r\n\t\t\t\tlet shouldSplit: boolean = (level.getIndex() > 0) && viewRequest.shouldSplit(level, tile);\r\n\t\t\t\tif (shouldSplit) {\r\n\t\t\t\t\tif (ViewTree.DEBUG) Message.print(ViewTree.MODULE, \" > visible, but needs splitting\");\r\n\t\t\t\t\t/* Find the children at the lower level */\r\n\t\t\t\t\tlet childLevel: Level = this._levels[level.getIndex() - 1];\r\n\t\t\t\t\tlet completeChildList: boolean = this.splitTile(level, tile, childLevel, childTiles, levelsToLoad, blocksToLoad);\r\n\t\t\t\t\tif (completeChildList == false) {\r\n\t\t\t\t\t\tif (ViewTree.DEBUG) Message.print(ViewTree.MODULE, \" > loading child indexes\");\r\n\t\t\t\t\t\t/* Display the tile while we wait for the block-tiles to load */\r\n\t\t\t\t\t\tif (tileAvailable) tilesToRender.add(tileData);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t/* Are all children available with their data? */\r\n\t\t\t\t\t\tthis.checkDataAvailable(viewRequest, childTiles, missingChildTiles);\r\n\t\t\t\t\t\tif (missingChildTiles.size() == 0) {\r\n\t\t\t\t\t\t\tif (ViewTree.DEBUG) Message.print(ViewTree.MODULE, \" > rendering children\");\r\n\t\t\t\t\t\t\t/* Add the children */\r\n\t\t\t\t\t\t\tlet childTiles2: Array<TileIndex> = new Array<TileIndex>(childTiles.size());\r\n\t\t\t\t\t\t\tfor (let j: number = 0; j < childTiles2.length; j++) childTiles2[j] = childTiles.get(j);\r\n\t\t\t\t\t\t\tthis.addTilesToView(viewRequest, childLevel, childTiles2, levelsToLoad, blocksToLoad, tilesToLoad, tilesToRender);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tif (ViewTree.DEBUG) Message.print(ViewTree.MODULE, \" > loading children\");\r\n\t\t\t\t\t\t\t/* Request for the missing children to be loaded */\r\n\t\t\t\t\t\t\tfor (let j: number = 0; j < missingChildTiles.size(); j++) tilesToLoad.add(missingChildTiles.get(j));\r\n\t\t\t\t\t\t\t/* Display the tile while we wait for the child tiles to load */\r\n\t\t\t\t\t\t\tif (tileAvailable) tilesToRender.add(tileData);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t/* Display the tile */\r\n\t\t\t\t\tif (ViewTree.DEBUG) Message.print(ViewTree.MODULE, \" > visible\");\r\n\t\t\t\t\tif (tileAvailable) tilesToRender.add(tileData);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t/* Log */\r\n\t\t\t\tif (ViewTree.DEBUG) Message.print(ViewTree.MODULE, \" > not visible\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Find tile indexes for a 3D view.\r\n\t * @param viewRequest the request parameters.\r\n\t * @param visibleTiles the list of visible tiles to add to.\r\n\t * @param availableTiles the set of available tiles.\r\n\t * @param visibleAvailableTiles the list if visible and available tiles to add to.\r\n\t */\r\n\tpublic renderView3D(viewRequest: AViewRequest, levelsToLoad: AList<Level>, blocksToLoad: AList<BlockIndex>, tilesToLoad: AList<TileIndex>, tilesToRender: AList<PointData>): void {\r\n\t\t/* Log? */\r\n\t\tif (ViewTree.DEBUG) Message.print(ViewTree.MODULE, \"Finding pointcloud tiles to render\");\r\n\t\tif (ViewTree.DEBUG) Message.print(ViewTree.MODULE, \" > dataBounds: \" + this._dataBounds);\r\n\t\t//if (DEBUG) Message.print(MODULE,\" > view: \"+viewRequest.getViewProjection());\r\n\t\t//if (DEBUG) Message.print(MODULE,\" > distance: \"+viewRequest.getDistanceRange());\r\n\t\t//if (DEBUG) Message.print(MODULE,\" > model-transform: \"+viewRequest.getModelTransform());\r\n\t\t/* Check all blocks */\r\n\t\ttilesToRender.clear();\r\n\t\tif (ViewTree.DEBUG) Message.print(ViewTree.MODULE, \"Checking \" + this._rootBlocks.size() + \" root blocks\");\r\n\t\tfor (let i: number = 0; i < this._rootBlocks.size(); i++) // start from the root tiles\r\n\t\t{\r\n\t\t\t/* Visible? */\r\n\t\t\tlet block: Block = this._rootBlocks.get(i);\r\n\t\t\tlet blockIndex: BlockIndex = block.getBlockIndex();\r\n\t\t\tlet level: Level = this._levels[blockIndex.level];\r\n\t\t\t/* Visible? */\r\n\t\t\tif (ViewTree.DEBUG) Message.print(ViewTree.MODULE, \"Checking top-level block L\" + blockIndex.level + \" (\" + blockIndex.gridIndex.x + \",\" + blockIndex.gridIndex.y + \",\" + blockIndex.gridIndex.z + \")\");\r\n\t\t\tlet blockBounds: Bounds = block.getBlockBounds(level).getIntersection(this._dataBounds);\r\n\t\t\tif (ViewTree.DEBUG) Message.print(ViewTree.MODULE, \" > blockBounds: \" + blockBounds);\r\n\t\t\tif (viewRequest.isVisibleBox(blockBounds)) {\r\n\t\t\t\t/* Add the tiles */\r\n\t\t\t\tif (ViewTree.DEBUG) Message.print(ViewTree.MODULE, \" > visible\");\r\n\t\t\t\tthis.addTilesToView(viewRequest, level, block.getTiles(blocksToLoad), levelsToLoad, blocksToLoad, tilesToLoad, tilesToRender);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CRSEngine.js","sourceRoot":"","sources":["../../../../src/spatial/crs/CRSEngine.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAUH,2CAAwC;AACxC,mDAAgD;AAEhD;;GAEG;AACH,gBAAgB;AAChB,MAAa,SAAS;IAClB;;OAEG;IACH;IACA,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,cAAc,CAAC,GAAW,EAAE,IAAY;QACjD,8HAA8H;QAC9H,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;;;;;OAMG;IACI,cAAc,CAAC,KAAiB,EAAE,SAAiB,EAAE,SAAiB;QACzE,yCAAyC;QACzC,OAAO,KAAK,CAAC;IACjB,CAAC;IAED;;;;OAIG;IACI,eAAe,CAAC,GAAW;QAC9B,yCAAyC;QACzC,OAAO,KAAK,CAAC;IACjB,CAAC;IAED;;;;OAIG;IACI,eAAe,CAAC,GAAW;QAC9B,yCAAyC;QACzC,OAAO,KAAK,CAAC;IACjB,CAAC;IAED;;;;OAIG;IACI,cAAc,CAAC,GAAW;QAC7B,yCAAyC;QACzC,OAAO,KAAK,CAAC;IACjB,CAAC;IAED;;;;;;OAMG;IACI,eAAe,CAAC,MAAc,EAAE,SAAiB,EAAE,SAAiB;QACvE,qDAAqD;QACrD,uBAAuB;QACvB,I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5B,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;YACxE,CAAC;QACL,CAAC;QACD,8BAA8B;QAC9B,OAAO,YAAY,CAAC;IACxB,CAAC;CACJ;AAjFD,8BAiFC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module OrbitGT\r\n */\r\n\r\n//package orbitgt.spatial.crs;\r\n\r\ntype int8 = number;\r\ntype int16 = number;\r\ntype int32 = number;\r\ntype float32 = number;\r\ntype float64 = number;\r\n\r\nimport { Bounds } from \"../geom/Bounds\";\r\nimport { Coordinate } from \"../geom/Coordinate\";\r\n\r\n/**\r\n * Abstract class CRSEngine provides a model for CRS transformation engines to implement.\r\n */\r\n/** @internal */\r\nexport class CRSEngine {\r\n /**\r\n * Create a new engine.\r\n */\r\n public constructor() {\r\n }\r\n\r\n /**\r\n * Prepare a CRS for making transforms in a certain area.\r\n * @param crs the CRS to prepare.\r\n * @param area the area to prepare for (can be invalid to prepare only for the crs).\r\n */\r\n public async prepareForArea(crs: string, area: Bounds): Promise<Bounds> {\r\n // subclasses should override this method if they need to download some part of a grid correction file, or the CRS declaration\r\n return area;\r\n }\r\n\r\n /**\r\n * Transform a coordinate from one CRS to another.\r\n * @param point the point coordinate.\r\n * @param sourceCRS the source CRS.\r\n * @param targetCRS the target CRS.\r\n * @return the transformed coordinate.\r\n */\r\n public transformPoint(point: Coordinate, sourceCRS: string, targetCRS: string): Coordinate {\r\n // subclasses should override this method\r\n return point;\r\n }\r\n\r\n /**\r\n * Check if a CRS is geocentric.\r\n * @param crs the CRS to check.\r\n * @return true if geocentric.\r\n */\r\n public isGeocentricCRS(crs: string): boolean {\r\n // subclasses should override this method\r\n return false;\r\n }\r\n\r\n /**\r\n * Check if a CRS is geographic.\r\n * @param crs the CRS to check.\r\n * @return true if geocentric.\r\n */\r\n public isGeographicCRS(crs: string): boolean {\r\n // subclasses should override this method\r\n return false;\r\n }\r\n\r\n /**\r\n * Check if a CRS is projected.\r\n * @param crs the CRS to check.\r\n * @return true if geocentric.\r\n */\r\n public isProjectedCRS(crs: string): boolean {\r\n // subclasses should override this method\r\n return false;\r\n }\r\n\r\n /**\r\n * Transform spatial bounds from one CRS to another.\r\n * @param point the point coordinate.\r\n * @param sourceCRS the source CRS.\r\n * @param targetCRS the target CRS.\r\n * @return the transformed bounds.\r\n */\r\n public transformBounds(bounds: Bounds, sourceCRS: string, targetCRS: string): Bounds {\r\n // no real need to override this method in subclasses\r\n /* Create new bounds */\r\n let targetBounds: Bounds = new Bounds();\r\n if (bounds.isValid()) {\r\n /* Transform all 8 corners */\r\n let corner: Coordinate = Coordinate.create();\r\n for (let i: number = 0; i < 8; i++) {\r\n bounds.getCorner(i, corner);\r\n targetBounds.add(this.transformPoint(corner, sourceCRS, targetCRS));\r\n }\r\n }\r\n /* Return the target bounds */\r\n return targetBounds;\r\n }\r\n}\r\n"]}
|
|
@@ -104,7 +104,7 @@ class CRSManager {
|
|
|
104
104
|
return transform;
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
+
exports.CRSManager = CRSManager;
|
|
107
108
|
/** The main instance of the CRS engine. This needs to be set by the application on startup. */
|
|
108
109
|
CRSManager.ENGINE = null;
|
|
109
|
-
exports.CRSManager = CRSManager;
|
|
110
110
|
//# sourceMappingURL=CRSManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CRSManager.js","sourceRoot":"","sources":["../../../../src/spatial/crs/CRSManager.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAWH,0DAAuD;AAEvD,mDAAgD;AAChD,iDAA8C;AAG9C;;GAEG;AACH,gBAAgB;AAChB,MAAa,UAAU;IAInB;;OAEG;IACH;IACA,CAAC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AAI,EAAE,CAAC,CAAC;QACnF,OAAO,SAAS,CAAC;IACrB,CAAC;;AArFL,gCAsFC;AArFG,+FAA+F;AACjF,iBAAM,GAAc,IAAI,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module OrbitGT\r\n */\r\n\r\n//package orbitgt.spatial.crs;\r\n\r\ntype int8 = number;\r\ntype int16 = number;\r\ntype int32 = number;\r\ntype float32 = number;\r\ntype float64 = number;\r\n\r\n\r\nimport { Strings } from \"../../system/runtime/Strings\";\r\nimport { Bounds } from \"../geom/Bounds\";\r\nimport { Coordinate } from \"../geom/Coordinate\";\r\nimport { Transform } from \"../geom/Transform\";\r\nimport { CRSEngine } from \"./CRSEngine\";\r\n\r\n/**\r\n * Class CRSManager defines the main access point to the CRS transformation engine.\r\n */\r\n/** @internal */\r\nexport class CRSManager {\r\n /** The main instance of the CRS engine. This needs to be set by the application on startup. */\r\n public static ENGINE: CRSEngine = null;\r\n\r\n /**\r\n * Allow no instances, all methods are static.\r\n */\r\n private constructor() {\r\n }\r\n\r\n /**\r\n * Prepare a CRS for making transforms in a certain area.\r\n * @param crs the CRS to prepare.\r\n * @param area the area to prepare for (can be invalid to prepare only for the crs).\r\n */\r\n public static async prepareForArea(crs: string, area: Bounds): Promise<Bounds> {\r\n if (CRSManager.ENGINE == null) return area;\r\n return CRSManager.ENGINE.prepareForArea(crs, area);\r\n }\r\n\r\n /**\r\n * Transform a coordinate from one CRS to another.\r\n * @param point the point coordinate.\r\n * @param sourceCRS the source CRS.\r\n * @param targetCRS the target CRS.\r\n * @return the transformed coordinate.\r\n */\r\n public static transformPoint(point: Coordinate, sourceCRS: string, targetCRS: string): Coordinate {\r\n if (CRSManager.ENGINE == null) return point;\r\n return CRSManager.ENGINE.transformPoint(point, sourceCRS, targetCRS);\r\n }\r\n\r\n /**\r\n * Transform spatial bounds from one CRS to another.\r\n * @param point the point coordinate.\r\n * @param sourceCRS the source CRS.\r\n * @param targetCRS the target CRS.\r\n * @return the transformed bounds.\r\n */\r\n public static transformBounds(bounds: Bounds, sourceCRS: string, targetCRS: string): Bounds {\r\n if (CRSManager.ENGINE == null) return bounds;\r\n return CRSManager.ENGINE.transformBounds(bounds, sourceCRS, targetCRS);\r\n }\r\n\r\n /**\r\n * Create an approximate 3D transformation from a source to a target CRS.\r\n * @param sourceCRS the source CRS.\r\n * @param sourcePoint the origin point in the source CRS.\r\n * @param targetCRS the target CRS.\r\n * @return the transform.\r\n */\r\n public static createTransform(sourceCRS: string, sourcePoint: Coordinate, targetCRS: string): Transform {\r\n /* Check */\r\n let transform: Transform = new Transform();\r\n if (CRSManager.ENGINE == null) return transform;\r\n if (sourceCRS == null) return transform;\r\n if (targetCRS == null) return transform;\r\n if (sourcePoint == null) return transform;\r\n /* Same? */\r\n if (Strings.equals(targetCRS, sourceCRS)) return transform;\r\n /* Transform X and Y at 100 meter distance (assume Z is metric) */\r\n let sizeXY: float64 = 100.0;\r\n if (CRSManager.ENGINE.isGeographicCRS(sourceCRS)) sizeXY = (sizeXY / 40000000.0 * 360.0);\r\n let sizeZ: float64 = 100.0;\r\n /* Create the frame */\r\n let p0: Coordinate = sourcePoint.copy();\r\n let pX: Coordinate = p0.copy();\r\n pX.add0(new Coordinate(sizeXY, 0.0, 0.0));\r\n let pY: Coordinate = p0.copy();\r\n pY.add0(new Coordinate(0.0, sizeXY, 0.0));\r\n let pZ: Coordinate = p0.copy();\r\n pZ.add0(new Coordinate(0.0, 0.0, sizeZ));\r\n /* Transform the frame */\r\n p0 = CRSManager.ENGINE.transformPoint(p0, sourceCRS, targetCRS);\r\n pX = CRSManager.ENGINE.transformPoint(pX, sourceCRS, targetCRS);\r\n pY = CRSManager.ENGINE.transformPoint(pY, sourceCRS, targetCRS);\r\n pZ = CRSManager.ENGINE.transformPoint(pZ, sourceCRS, targetCRS);\r\n /* Get the columns */\r\n let colX: Coordinate = pX.subtract(p0).scale(1.0 / sizeXY);\r\n let colY: Coordinate = pY.subtract(p0).scale(1.0 / sizeXY);\r\n let colZ: Coordinate = pZ.subtract(p0).scale(1.0 / sizeZ);\r\n /* Create the transform */\r\n transform = Transform.createWithColumns(colX, colY, colZ, p0);\r\n transform.translate(-sourcePoint.getX(), -sourcePoint.getY(), -sourcePoint.getZ());\r\n return transform;\r\n }\r\n}\r\n"]}
|
|
@@ -893,6 +893,7 @@ class CRS {
|
|
|
893
893
|
return null;
|
|
894
894
|
}
|
|
895
895
|
}
|
|
896
|
+
exports.CRS = CRS;
|
|
896
897
|
/** The type of a compound CRS */
|
|
897
898
|
CRS.COMPOUND = 1;
|
|
898
899
|
/** The type of a engineering CRS */
|
|
@@ -927,5 +928,4 @@ CRS._CACHE_WGS84_GEOCENTRIC = null;
|
|
|
927
928
|
CRS._CACHE_WGS84_3D = null;
|
|
928
929
|
/** The cache of the WGS 84 2D coordinate reference system (4326) */
|
|
929
930
|
CRS._CACHE_WGS84_2D = null;
|
|
930
|
-
exports.CRS = CRS;
|
|
931
931
|
//# sourceMappingURL=CRS.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CRS.js","sourceRoot":"","sources":["../../../../src/spatial/ecrs/CRS.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAUH,yDAAsD;AACtD,0DAAuD;AACvD,0DAAuD;AACvD,mDAAgD;AAEhD,yDAAsD;AACtD,mCAAgC;AAEhC,2CAAwC;AAExC,yCAAsC;AAEtC,iCAA8B;AAG9B;;;;;;;;;;;;;GAaG;AACH,gBAAgB;AAChB,MAAa,GAAG;IAgFZ;;;;;;;;;;;OAWG;IACH,YAAmB,IAAW,EAAE,IAAY,EAAE,IAAW,EAAE,IAAW,EAAE,MAAa,EAAE,KAAY,EAAE,OAAY,EAAE,UAAqB,EAAE,oBAAsC;QAC5K,0BAA0B;Q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e,CAAC;QACzD,IAAI,OAAO,IAAI,GAAG,CAAC,SAAS;YAAE,OAAO,WAAW,CAAC;QACjD,IAAI,OAAO,IAAI,GAAG,CAAC,QAAQ;YAAE,OAAO,UAAU,CAAC;QAC/C,iBAAO,CAAC,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,GAAG,aAAa,CAAC,CAAC;QAC/D,OAAO,IAAI,CAAC;IAChB,CAAC;;AA96BD,iCAAiC;AACV,YAAQ,GAAU,CAAC,CAAC;AAC3C,oCAAoC;AACb,eAAW,GAAU,CAAC,CAAC;AAC9C,mCAAmC;AACZ,cAAU,GAAU,CAAC,CAAC;AAC7C,sCAAsC;AACf,iBAAa,GAAU,CAAC,CAAC;AAChD,sCAAsC;AACf,iBAAa,GAAU,CAAC,CAAC;AAChD,kCAAkC;AACX,aAAS,GAAU,CAAC,CAAC;AAC5C,iCAAiC;AACV,YAAQ,GAAU,CAAC,CAAC;AAE3C,wEAAwE;AACjD,6BAAyB,GAAU,IAAI,CAAC;AAC/D,2EAA2E;AACpD,qBAAiB,GAAU,IAAI,CAAC;AACvD,2EAA2E;AACpD,qBAAiB,GAAU,IAAI,CAAC;AACvD,kDAAkD;AAC1B,oBAAgB,GAAU,IAAI,CAAC;AAEvD,mFAAmF;AAC5D,wBAAoB,GAAW,MAAM,CAAC;AAC7D,mFAAmF;AAC5D,gBAAY,GAAW,MAAM,CAAC;AACrD,2EAA2E;AACpD,gBAAY,GAAW,MAAM,CAAC;AAErD,4EAA4E;AAC7D,2BAAuB,GAAQ,IAAI,CAAC;AACnD,4EAA4E;AAC7D,mBAAe,GAAQ,IAAI,CAAC;AAC3C,oEAAoE;AACrD,mBAAe,GAAQ,IAAI,CAAC;AArClC,kBAAG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module OrbitGT\r\n */\r\n\r\n//package orbitgt.spatial.ecrs;\r\n\r\ntype int8 = number;\r\ntype int16 = number;\r\ntype int32 = number;\r\ntype float32 = number;\r\ntype float64 = number;\r\n\r\nimport { AList } from \"../../system/collection/AList\";\r\nimport { ASystem } from \"../../system/runtime/ASystem\";\r\nimport { Strings } from \"../../system/runtime/Strings\";\r\nimport { Coordinate } from \"../geom/Coordinate\";\r\nimport { Axis } from \"./Axis\";\r\nimport { CoordinateSystem } from \"./CoordinateSystem\";\r\nimport { Datum } from \"./Datum\";\r\nimport { Ellipsoid } from \"./Ellipsoid\";\r\nimport { Operation } from \"./Operation\";\r\nimport { OperationMethod } from \"./OperationMethod\";\r\nimport { Registry } from \"./Registry\";\r\nimport { Transform } from \"./Transform\";\r\nimport { Unit } from \"./Unit\";\r\nimport { VerticalModel } from \"./VerticalModel\";\r\n\r\n/**\r\n * Class CRS defines the parameters of a coordinate reference system.\r\n * NOTE: geographic (lon-lat) CRSs have their coordinates in degrees (0..360) instead of radians (0..2PI).\r\n * NOTE: geocentric (ECEF) CRSs have their coordinates in meters.\r\n *\r\n * Based on the following document:\r\n *\r\n * Coordinate Conversions and Transformations including Formulas\r\n * Guidance Note Number 7, part 2\r\n * Revised May 2005\r\n * Available at: http://www.epsg.org/\r\n *\r\n * @version 1.0 July 2005\r\n */\r\n/** @internal */\r\nexport class CRS {\r\n /** The type of a compound CRS */\r\n public static readonly COMPOUND: int32 = 1;\r\n /** The type of a engineering CRS */\r\n public static readonly ENGINEERING: int32 = 2;\r\n /** The type of a geocentric CRS */\r\n public static readonly GEOCENTRIC: int32 = 3;\r\n /** The type of a geographic-2D CRS */\r\n public static readonly GEOGRAPHIC_2D: int32 = 4;\r\n /** The type of a geographic-3D CRS */\r\n public static readonly GEOGRAPHIC_3D: int32 = 5;\r\n /** The type of a projected CRS */\r\n public static readonly PROJECTED: int32 = 6;\r\n /** The type of a vertical CRS */\r\n public static readonly VERTICAL: int32 = 7;\r\n\r\n /** The identification code of the WGS 84 geocentric reference system */\r\n public static readonly WGS84_GEOCENTRIC_CRS_CODE: int32 = 4978;\r\n /** The identification code of the WGS 84 3D coordinate reference system */\r\n public static readonly WGS84_3D_CRS_CODE: int32 = 4979;\r\n /** The identification code of the WGS 84 2D coordinate reference system */\r\n public static readonly WGS84_2D_CRS_CODE: int32 = 4326;\r\n /** The identification code of the WGS 84 datum */\r\n private static readonly WGS84_DATUM_CODE: int32 = 6326;\r\n\r\n /** The identification code of the WGS 84 geocentric coordinate reference system */\r\n public static readonly CRS_WGS84_GEOCENTRIC: string = \"4978\";\r\n /** The identification code of the WGS 84 geographic coordinate reference system */\r\n public static readonly CRS_WGS84_3D: string = \"4979\";\r\n /** The identification code of the WGS 84 2D coordinate reference system */\r\n public static readonly CRS_WGS84_2D: string = \"4326\";\r\n\r\n /** The cache of the WGS 84 geocentric coordinate reference system (4978) */\r\n private static _CACHE_WGS84_GEOCENTRIC: CRS = null;\r\n /** The cache of the WGS 84 geographic coordinate reference system (4979) */\r\n private static _CACHE_WGS84_3D: CRS = null;\r\n /** The cache of the WGS 84 2D coordinate reference system (4326) */\r\n private static _CACHE_WGS84_2D: CRS = null;\r\n\r\n /** The code */\r\n private _code: int32;\r\n /** The name */\r\n private _name: string;\r\n /** The area of use */\r\n private _area: int32;\r\n /** The type (PROJECTED,GEOGRAPHIC_2D,GEOGRAPHIC_3D,GEOCENTRIC,VERTICAL,COMPOUND,...) */\r\n private _type: int32;\r\n\r\n /** The coordinate-system code */\r\n private _csCode: int32;\r\n /** The coordinate axes (defined by the csCode) */\r\n private _axes: AList<Axis>;\r\n /** The coordinate system (can be null) */\r\n private _coordinateSystem: CoordinateSystem;\r\n /** The datum */\r\n private _datum: Datum;\r\n\r\n /** The base geographic CRS */\r\n private _baseCRS: CRS;\r\n /** The projection (from the base CRS to this CRS) */\r\n private _projection: Operation;\r\n\r\n /** The transformations from the base geocentric CRS to the geocentric WGS (CRS 4326) */\r\n private _transformationsToWGS: AList<Operation>;\r\n /** The default transformation from the base geocentric CRS to the geocentric WGS (CRS 4326) */\r\n private _transformationToWGS: Operation;\r\n\r\n /** The horizontal CRS (type COMPOUND) */\r\n private _horizontalComponent: CRS;\r\n /** The vertical CRS (type COMPOUND) */\r\n private _verticalComponent: CRS;\r\n /** The vertical model (type VERTICAL) */\r\n private _verticalModel: VerticalModel;\r\n\r\n /** The text information (WKT) of the CRS */\r\n private _textForm: string;\r\n\r\n /** The access time of the CRS (for garbage collecting the dynamic CRS) */\r\n private _accessTime: float64;\r\n\r\n /**\r\n * Create a new CRS.\r\n * @param code the code.\r\n * @param name the name.\r\n * @param area the area of use.\r\n * @param type the type.\r\n * @param csCode the coordinate-system code.\r\n * @param datum the datum.\r\n * @param baseCRS the base geographic CRS.\r\n * @param projection the projection (from the base CRS to this CRS).\r\n * @param transformationsToWGS the transformations from the base geographic CRS to the WGS 84 datum (of CRS 4326).\r\n */\r\n public constructor(code: int32, name: string, area: int32, type: int32, csCode: int32, datum: Datum, baseCRS: CRS, projection: Operation, transformationsToWGS: AList<Operation>) {\r\n /* Store the parameters */\r\n this._code = code;\r\n this._name = name;\r\n this._area = area;\r\n this._type = type;\r\n this._csCode = csCode;\r\n this._axes = null;\r\n this._coordinateSystem = null;\r\n this._datum = datum;\r\n this._baseCRS = baseCRS;\r\n this._projection = projection;\r\n this._transformationsToWGS = transformationsToWGS;\r\n /* Get the default transform */\r\n this._transformationToWGS = Operation.getLatestTransformation(transformationsToWGS);\r\n /* Clear */\r\n this._horizontalComponent = null;\r\n this._verticalComponent = null;\r\n this._verticalModel = null;\r\n this._textForm = null;\r\n this._accessTime = 0.0;\r\n }\r\n\r\n /**\r\n * Create a compound CRS.\r\n * @param code the code.\r\n * @param name the name.\r\n * @param area the area of use.\r\n * @param horizontalCRS the horizontal CRS.\r\n * @param verticalCRS the vertical CRS.\r\n * @return the compound CRS.\r\n */\r\n public static createCompound(code: int32, name: string, area: int32, horizontalCRS: CRS, verticalCRS: CRS): CRS {\r\n /* Check the parameters */\r\n ASystem.assertNot(horizontalCRS == null, \"No horizontal CRS\");\r\n ASystem.assertNot(verticalCRS == null, \"No vertical CRS\");\r\n ASystem.assertNot(horizontalCRS.isVertical(), \"CRS is not horizontal: \" + horizontalCRS);\r\n ASystem.assertNot(verticalCRS.isVertical() == false, \"CRS is not vertical: \" + verticalCRS);\r\n /* Make the CRS */\r\n let crs: CRS = new CRS(code, name, area, CRS.COMPOUND, 0/*csCode*/, null/*datum*/, null/*baseCRS*/, null/*projection*/, null/*transformationsToWGS*/);\r\n crs._horizontalComponent = horizontalCRS;\r\n crs._verticalComponent = verticalCRS;\r\n /* Return the CRS */\r\n return crs;\r\n }\r\n\r\n /**\r\n * Get the code.\r\n * @return the code.\r\n */\r\n public getCode(): int32 {\r\n return this._code;\r\n }\r\n\r\n /**\r\n * Get the string code.\r\n * @return the string code.\r\n */\r\n public getStringCode(): string {\r\n return \"\" + this._code;\r\n }\r\n\r\n /**\r\n * Check if a code matches the CRS code.\r\n * @param code the code.\r\n * @return true if the code matches.\r\n */\r\n public hasStringCode(code: string): boolean {\r\n return Strings.equals(code, this.getStringCode());\r\n }\r\n\r\n /**\r\n * Get the name.\r\n * @return the name.\r\n */\r\n public getName(): string {\r\n return this._name;\r\n }\r\n\r\n /**\r\n * Get the area of use.\r\n * @return the area.\r\n */\r\n public getArea(): int32 {\r\n return this._area;\r\n }\r\n\r\n /**\r\n * Get the type.\r\n * @return the type.\r\n */\r\n public getType(): int32 {\r\n return this._type;\r\n }\r\n\r\n /**\r\n * Get the type label.\r\n * @return the type label.\r\n */\r\n public getTypeLabel(): string {\r\n return CRS.labelCRSType(this._type);\r\n }\r\n\r\n /**\r\n * Is this a geocentric CRS?\r\n * @return true for a geocentric CRS.\r\n */\r\n public isGeoCentric(): boolean {\r\n return (this._type == CRS.GEOCENTRIC);\r\n }\r\n\r\n /**\r\n * Is this a geographic CRS?\r\n * @return true for a projected CRS.\r\n */\r\n public isGeoGraphic(): boolean {\r\n return (this._type == CRS.GEOGRAPHIC_2D || this._type == CRS.GEOGRAPHIC_3D);\r\n }\r\n\r\n /**\r\n * Is this a geographic 2D CRS?\r\n * @return true for a projected 2D CRS.\r\n */\r\n public isGeoGraphic2D(): boolean {\r\n return (this._type == CRS.GEOGRAPHIC_2D);\r\n }\r\n\r\n /**\r\n * Is this a geographic 3D CRS?\r\n * @return true for a projected 3D CRS.\r\n */\r\n public isGeoGraphic3D(): boolean {\r\n return (this._type == CRS.GEOGRAPHIC_3D);\r\n }\r\n\r\n /**\r\n * Is this a projected CRS?\r\n * @return true for a projected CRS.\r\n */\r\n public isProjectedType(): boolean {\r\n return (this._type == CRS.PROJECTED);\r\n }\r\n\r\n /**\r\n * Is this a projected CRS?\r\n * @return true for a projected CRS.\r\n */\r\n public isProjected(): boolean {\r\n if (this._type == CRS.COMPOUND) return this._horizontalComponent.isProjected();\r\n return (this._type == CRS.PROJECTED);\r\n }\r\n\r\n /**\r\n * Is this a vertical CRS?\r\n * @return true for a vertical CRS.\r\n */\r\n public isVertical(): boolean {\r\n return (this._type == CRS.VERTICAL);\r\n }\r\n\r\n /**\r\n * Is this a compound CRS?\r\n * @return true for a compound CRS.\r\n */\r\n public isCompound(): boolean {\r\n return (this._type == CRS.COMPOUND);\r\n }\r\n\r\n /**\r\n * Get the coordinate-system code.\r\n * @return the coordinate-system code.\r\n */\r\n public getCoordinateSystemCode(): int32 {\r\n return this._csCode;\r\n }\r\n\r\n /**\r\n * Get the coordinate system.\r\n * @return the coordinate system (can be null if standard).\r\n */\r\n public getCoordinateSystem(): CoordinateSystem {\r\n return this._coordinateSystem;\r\n }\r\n\r\n /**\r\n * Get the datum.\r\n * @return the datum.\r\n */\r\n public getDatum(): Datum {\r\n if (this._datum != null) return this._datum;\r\n if (this._baseCRS != null) return this._baseCRS.getDatum();\r\n return null;\r\n }\r\n\r\n /**\r\n * Get the code of the datum.\r\n * @return the code of the datum (0 if there is no datum).\r\n */\r\n public getDatumCode(): int32 {\r\n let datum: Datum = this.getDatum();\r\n return (datum == null) ? 0 : datum.getCode();\r\n }\r\n\r\n /**\r\n * Set the datum.\r\n * @param datum the new datum (if null check the base CRS).\r\n */\r\n public setDatum(datum: Datum): void {\r\n this._datum = datum;\r\n }\r\n\r\n /**\r\n * Get the ellipsoid.\r\n * @return the ellipsoid.\r\n */\r\n public getEllipsoid(): Ellipsoid {\r\n return this.getDatum().getEllipsoid();\r\n }\r\n\r\n /**\r\n * Get the base geographic CRS.\r\n * @return the base geographic CRS.\r\n */\r\n public getBaseCRS(): CRS {\r\n return this._baseCRS;\r\n }\r\n\r\n /**\r\n * Set the base geographic CRS.\r\n * @param baseCRS the new base geographic CRS.\r\n */\r\n public setBaseCRS(baseCRS: CRS): void {\r\n this._baseCRS = baseCRS;\r\n }\r\n\r\n /**\r\n * Get the coordinate axis of the CRS.\r\n * @return the coordinate axis of the CRS.\r\n */\r\n public getAxes(): AList<Axis> {\r\n return this._axes;\r\n }\r\n\r\n /**\r\n * Set the coordinate axis of the CRS.\r\n * @param axis the coordinate axis of the CRS.\r\n */\r\n public setAxes(axes: AList<Axis>): void {\r\n /* Store the parameters */\r\n this._axes = axes;\r\n /* Update the coordinate system */\r\n this._coordinateSystem = CoordinateSystem.create(this._type, this._csCode, this._axes);\r\n }\r\n\r\n /**\r\n * Get the unit code of the first coordinate axis of the CRS.\r\n * @return the unit code (defaults to METER).\r\n */\r\n public getFirstAxisUnitCode(): int32 {\r\n if (this._type == CRS.COMPOUND) return this._horizontalComponent.getFirstAxisUnitCode();\r\n if (this._axes == null) return Unit.METER;\r\n if (this._axes.size() == 0) return Unit.METER;\r\n return this._axes.get(0).getUnitCode();\r\n }\r\n\r\n /**\r\n * Get the projection (from the base CRS to this CRS).\r\n * @return the projection.\r\n */\r\n public getProjection(): Operation {\r\n return this._projection;\r\n }\r\n\r\n /**\r\n * Set the projection (from the base CRS to this CRS).\r\n * @param projection the projection.\r\n */\r\n public setProjection(projection: Operation): void {\r\n this._projection = projection;\r\n }\r\n\r\n /**\r\n * Get the projection method (from the base CRS to this CRS).\r\n * @return the projection method.\r\n */\r\n public getProjectionMethod(): OperationMethod {\r\n if (this._projection == null) return null;\r\n return this._projection.getMethod();\r\n }\r\n\r\n /**\r\n * Get the horizontal component of a compound CRS.\r\n * @return the horizontal component of a compound CRS.\r\n */\r\n public getHorizontalComponent(): CRS {\r\n /* Check the type */\r\n ASystem.assertNot(this._type != CRS.COMPOUND, \"CRS \" + this._code + \" is not compound\");\r\n /* Return the component */\r\n return this._horizontalComponent;\r\n }\r\n\r\n /**\r\n * Check if there is a vertical component (only for type COMPOUND).\r\n * @return true if there is a vertical component.\r\n */\r\n public hasVerticalComponent(): boolean {\r\n /* Check the type */\r\n if (this._type != CRS.COMPOUND) return false;\r\n /* Check the component */\r\n return (this._verticalComponent != null);\r\n }\r\n\r\n /**\r\n * Get the vertical component of a compound CRS.\r\n * @return the vertical component of a compound CRS.\r\n */\r\n public getVerticalComponent(): CRS {\r\n /* Check the type */\r\n ASystem.assertNot(this._type != CRS.COMPOUND, \"CRS \" + this._code + \" is not compound\");\r\n /* Return the component */\r\n return this._verticalComponent;\r\n }\r\n\r\n /**\r\n * Get the vertical model (only for type VERTICAL).\r\n * @return the vertical model.\r\n */\r\n public getVerticalModel(): VerticalModel {\r\n return this._verticalModel;\r\n }\r\n\r\n /**\r\n * Set the vertical model (only for type VERTICAL).\r\n * @param verticalModel the vertical model.\r\n */\r\n public setVerticalModel(verticalModel: VerticalModel): void {\r\n this._verticalModel = verticalModel;\r\n }\r\n\r\n /**\r\n * Peek at the transformations from the base geographic CRS to the WGS 84 datum (of CRS 4326).\r\n * @return the transformations.\r\n */\r\n public peekTransformationsToWGS(): AList<Operation> {\r\n return this._transformationsToWGS;\r\n }\r\n\r\n /**\r\n * Get the transformations from the base geographic CRS to the WGS 84 datum (of CRS 4326).\r\n * @return the transformations.\r\n */\r\n public getTransformationsToWGS(): AList<Operation> {\r\n if ((this._transformationsToWGS != null) && (this._transformationsToWGS.size() > 0)) return this._transformationsToWGS;\r\n if (this._baseCRS != null) return this._baseCRS.getTransformationsToWGS();\r\n return new AList<Operation>();\r\n }\r\n\r\n /**\r\n * Set the transformations from the base geographic CRS to the WGS 84 datum (of CRS 4326).\r\n * @param transformations the transformations.\r\n */\r\n public setTransformationsToWGS(transformations: AList<Operation>): void {\r\n this._transformationsToWGS = transformations;\r\n }\r\n\r\n /**\r\n * Get the default transformation from the base geographic CRS to the WGS 84 datum (of CRS 4326).\r\n * @return a transformation (null if not available).\r\n */\r\n public getTransformationToWGS(): Operation {\r\n if (this._transformationToWGS != null) return this._transformationToWGS;\r\n if (this._baseCRS != null) return this._baseCRS.getTransformationToWGS();\r\n return null;\r\n }\r\n\r\n /**\r\n * Set the default transformation from the base geographic CRS to the WGS 84 datum (of CRS 4326).\r\n * @param transformation a transformation (null if not available).\r\n */\r\n public setTransformationToWGS(transformation: Operation): void {\r\n this._transformationToWGS = transformation;\r\n }\r\n\r\n /**\r\n * Convert to a geocentric coordinate.\r\n * @param local the coordinate in this CRS.\r\n * @return the geocentric coordinate.\r\n */\r\n public toGeoCentric(local: Coordinate): Coordinate {\r\n /* Projection ? */\r\n if (this._type == CRS.PROJECTED) {\r\n /* We need a geographic base CRS */\r\n ASystem.assertNot(this._baseCRS.isGeoGraphic() == false, \"Projected CRS '\" + this._code + \"' needs a geographic base CRS '\" + this._baseCRS.getCode() + \"', not '\" + this._baseCRS.getTypeLabel() + \"'\");\r\n /* Convert to standard units */\r\n let projected: Coordinate = local.copy();\r\n if (this._coordinateSystem != null) this._coordinateSystem.localToStandard(projected, projected);\r\n /* Inverse the projection to get geographic (lon,lat) coordinates (radians) */\r\n let geographic: Coordinate = new Coordinate(0.0, 0.0, 0.0);\r\n this._projection.reverse(geographic, projected);\r\n /* The geographic coordinates are in degrees */\r\n geographic.setX(geographic.getX() / Math.PI * 180.0);\r\n geographic.setY(geographic.getY() / Math.PI * 180.0);\r\n /* Let the base CRS calculate the geocentric coordinates */\r\n return this._baseCRS.toGeoCentric(geographic);\r\n }\r\n /* Geocentric ? */\r\n if (this._type == CRS.GEOCENTRIC) {\r\n /* Already geocentric */\r\n return local.copy();\r\n }\r\n /* Geographic ? */\r\n if (this._type == CRS.GEOGRAPHIC_2D || this._type == CRS.GEOGRAPHIC_3D) {\r\n /* All geographic coordinates are in degrees */\r\n let geographic: Coordinate = local.copy();\r\n geographic.setX(geographic.getX() / 180.0 * Math.PI);\r\n geographic.setY(geographic.getY() / 180.0 * Math.PI);\r\n /* Convert from geographic (radians) to geocentric */\r\n let geocentric: Coordinate = new Coordinate(0.0, 0.0, 0.0);\r\n this._datum.getEllipsoid().toGeoCentric(geographic, geocentric);\r\n /* Return the geocentric coordinates */\r\n return geocentric;\r\n }\r\n /* We cannot transform */\r\n ASystem.assertNot(true, \"No geocentric transform for \" + this);\r\n return null;\r\n }\r\n\r\n /**\r\n * Convert from a geocentric coordinate.\r\n * @param geocentric the geocentric coordinate.\r\n * @return the coordinate in this CRS.\r\n */\r\n public fromGeoCentric(geocentric: Coordinate): Coordinate {\r\n /* Projection ? */\r\n if (this._type == CRS.PROJECTED) {\r\n /* We need a geographic base CRS */\r\n ASystem.assertNot(this._baseCRS.isGeoGraphic() == false, \"Projected CRS '\" + this._code + \"' needs a geographic base CRS '\" + this._baseCRS.getCode() + \"', not '\" + this._baseCRS.getTypeLabel() + \"'\");\r\n /* Get the geographic coordinate */\r\n let geographic: Coordinate = this._baseCRS.fromGeoCentric(geocentric);\r\n /* The geographic coordinates are in degrees */\r\n geographic.setX(geographic.getX() / 180.0 * Math.PI);\r\n geographic.setY(geographic.getY() / 180.0 * Math.PI);\r\n /* Make the projection */\r\n let projected: Coordinate = new Coordinate(0.0, 0.0, 0.0);\r\n this._projection.forward(geographic, projected);\r\n /* Convert to local units */\r\n if (this._coordinateSystem != null) this._coordinateSystem.standardToLocal(projected, projected);\r\n /* Return the projected coordinate */\r\n return projected;\r\n }\r\n /* Geocentric ? */\r\n if (this._type == CRS.GEOCENTRIC) {\r\n /* Already geocentric */\r\n return geocentric.copy();\r\n }\r\n /* Geographic ? */\r\n if (this._type == CRS.GEOGRAPHIC_2D || this._type == CRS.GEOGRAPHIC_3D) {\r\n /* Convert from geocentric to geographic (radians) */\r\n let geographic: Coordinate = new Coordinate(0.0, 0.0, 0.0);\r\n this._datum.getEllipsoid().toGeoGraphic(geocentric, geographic);\r\n /* All geographic coordinates need to be in degrees */\r\n geographic.setX(geographic.getX() / Math.PI * 180.0);\r\n geographic.setY(geographic.getY() / Math.PI * 180.0);\r\n /* Return the geographic coordinate */\r\n return geographic;\r\n }\r\n /* We cannot transform */\r\n ASystem.assertNot(true, \"No geocentric transform for \" + this);\r\n return null;\r\n }\r\n\r\n /**\r\n * Check if this CRS is a projection of another CRS.\r\n * @param geographic the geographic CRS to check.\r\n * @return true if this is a projection of the geographic CRS.\r\n */\r\n public isProjectionOf(geographic: CRS): boolean {\r\n /* This has to be a projection */\r\n if (this._type != CRS.PROJECTED) return false;\r\n if (this._projection == null) return false;\r\n if (this._baseCRS == null) return false;\r\n /* We need a geographic system */\r\n if (geographic._type != CRS.GEOGRAPHIC_2D && geographic._type != CRS.GEOGRAPHIC_3D) return false;\r\n /* Is this our base CRS? */\r\n return (this._baseCRS.isCompatible(geographic));\r\n }\r\n\r\n /**\r\n * Convert from a geographic coordinate to a projected coordinate.\r\n * @param geographic the source geographic coordinate (in degrees).\r\n * @param projected the target projected coordinate (use null to create a new coordinate).\r\n * @return the projected coordinate.\r\n */\r\n public toProjected(geographic: Coordinate, projected: Coordinate): Coordinate {\r\n /* Create target? */\r\n if (projected == null) projected = new Coordinate(0.0, 0.0, 0.0);\r\n /* The geographic coordinates are kept in degrees */\r\n projected.setX(geographic.getX() / 180.0 * Math.PI);\r\n projected.setY(geographic.getY() / 180.0 * Math.PI);\r\n projected.setZ(geographic.getZ());\r\n /* Make the projection */\r\n this._projection.forward(projected, projected);\r\n /* Convert to local units */\r\n if (this._coordinateSystem != null) this._coordinateSystem.standardToLocal(projected, projected);\r\n /* Return the result */\r\n return projected;\r\n }\r\n\r\n /**\r\n * Convert from a projected coordinate to a geographic coordinate.\r\n * @param projected the source projected coordinate.\r\n * @param geographic the target geographic coordinate (in degrees) (use null to create a new coordinate).\r\n * @return the geographic coordinate.\r\n */\r\n public fromProjected(projected: Coordinate, geographic: Coordinate): Coordinate {\r\n /* Create target? */\r\n if (geographic == null) geographic = new Coordinate(0.0, 0.0, 0.0);\r\n /* Convert to standard units */\r\n let projected2: Coordinate = projected.copy();\r\n if (this._coordinateSystem != null) this._coordinateSystem.localToStandard(projected2, projected2);\r\n /* Inverse the projection to get the geographic (lon,lat) coordinates (radians) */\r\n this._projection.reverse(geographic, projected2);\r\n /* The geographic coordinates are kept in degrees */\r\n geographic.setX(geographic.getX() / Math.PI * 180.0);\r\n geographic.setY(geographic.getY() / Math.PI * 180.0);\r\n /* Return the result */\r\n return geographic;\r\n }\r\n\r\n /**\r\n * Get the WGS 84 2D geocentric reference system.\r\n * @return the WGS 84 2D geocentric reference system.\r\n */\r\n private static getWGS84_GeoCentric(): CRS {\r\n if (CRS._CACHE_WGS84_GEOCENTRIC == null) CRS._CACHE_WGS84_GEOCENTRIC = Registry.getCRS2(CRS.CRS_WGS84_GEOCENTRIC);\r\n return CRS._CACHE_WGS84_GEOCENTRIC;\r\n }\r\n\r\n /**\r\n * Get the WGS 84 2D geographic reference system.\r\n * @return the WGS 84 2D geographic reference system.\r\n */\r\n private static getWGS84_3D(): CRS {\r\n if (CRS._CACHE_WGS84_3D == null) CRS._CACHE_WGS84_3D = Registry.getCRS2(CRS.CRS_WGS84_3D);\r\n return CRS._CACHE_WGS84_3D;\r\n }\r\n\r\n /**\r\n * Get the WGS 84 2D coordinate reference system.\r\n * @return the WGS 84 2D coordinate reference system.\r\n */\r\n private static getWGS84_2D(): CRS {\r\n if (CRS._CACHE_WGS84_2D == null) CRS._CACHE_WGS84_2D = Registry.getCRS2(CRS.CRS_WGS84_2D);\r\n return CRS._CACHE_WGS84_2D;\r\n }\r\n\r\n /**\r\n * Is a conversion to and from the WGS 84 coordinate system possible?\r\n * @return true if possible.\r\n */\r\n public isWGSCompatible(): boolean {\r\n /* Already in WGS ? */\r\n if (this.getDatum().getCode() == CRS.WGS84_DATUM_CODE) return true;\r\n /* Get the transformation from the local datum to the WGS datum */\r\n let localToWGS: Operation = this.getTransformationToWGS();\r\n if (localToWGS == null) return false;\r\n /* Compatible */\r\n return true;\r\n }\r\n\r\n /**\r\n * Convert a coordinate to the WGS 84 (geographic 2D) coordinate system.\r\n * @param source the coordinates in this CRS.\r\n * @param wgsTransformationIndex the index of the WGS transformation to use (negative for the default transformation).\r\n * @return the WGS 84 coordinate, x is longitude(-180..+180), y is latitude(-90..+90) and z is height (the z height is the same as the local height).\r\n */\r\n public toWGSi(source: Coordinate, wgsTransformationIndex: int32): Coordinate {\r\n /* Already in the WGS datum ? */\r\n if (this.getDatum().getCode() == CRS.WGS84_DATUM_CODE) {\r\n /* Geocentric ? */\r\n if (this._type == CRS.GEOCENTRIC) {\r\n /* Convert from geocentric to geographic coordinates */\r\n let ageographic: Coordinate = new Coordinate(0.0, 0.0, 0.0);\r\n this._datum.getEllipsoid().toGeoGraphic(source/*geocentric*/, ageographic);\r\n /* The WGS coordinates need to be in degrees */\r\n ageographic.setX(ageographic.getX() / Math.PI * 180.0);\r\n ageographic.setY(ageographic.getY() / Math.PI * 180.0);\r\n /* Return the WGS coordinates */\r\n return ageographic;\r\n }\r\n /* Projected ? */\r\n if (this._projection != null) {\r\n /* Convert to standard units */\r\n let projected: Coordinate = source.copy();\r\n if (this._coordinateSystem != null) this._coordinateSystem.localToStandard(projected, projected);\r\n /* Inverse the projection to go from projected to geographic (lon,lat) coordinates */\r\n let ageographic: Coordinate = new Coordinate(0.0, 0.0, 0.0);\r\n this._projection.reverse(ageographic, projected);\r\n /* The WGS coordinates need to be in degrees */\r\n ageographic.setX(ageographic.getX() / Math.PI * 180.0);\r\n ageographic.setY(ageographic.getY() / Math.PI * 180.0);\r\n /* Return the WGS coordinates */\r\n return ageographic;\r\n }\r\n /* Geographic */\r\n return new Coordinate(source.getX(), source.getY(), source.getZ());\r\n }\r\n /* Get the transformation from the local datum to the WGS datum */\r\n let localToWGS: Operation = (wgsTransformationIndex < 0) ? this.getTransformationToWGS() : this.getTransformationsToWGS().get(wgsTransformationIndex);\r\n // if (localToWGS==null)\r\n // {\r\n // /* We cannot transform */\r\n // ASystem.assert(false,\"No datum transformation from \"+this+\" to WGS\");\r\n // }\r\n /* Does the transform work on the projected coordinates (like the OSTN02 grid correction)? */\r\n let geocentric: Coordinate;\r\n if ((localToWGS != null) && localToWGS.getSourceCRS().isProjected()) {\r\n /* Start with the projected coordinate */\r\n geocentric = new Coordinate(source.getX(), source.getY(), source.getZ());\r\n }\r\n else {\r\n /* Calculate the geocentric coordinate */\r\n geocentric = this.toGeoCentric(new Coordinate(source.getX(), source.getY(), source.getZ()));\r\n }\r\n /* Apply the transform to the WGS datum */\r\n if (localToWGS != null) localToWGS.forward(geocentric, geocentric);\r\n /* Get the geographic coordinate */\r\n let geographic: Coordinate = CRS.getWGS84_2D().fromGeoCentric(geocentric);\r\n /* Does the transform work on the projected coordinates (like the OSTN02 grid correction)? */\r\n if ((localToWGS != null) && localToWGS.getSourceCRS().isProjected()) {\r\n /* Assume we have the right Z */\r\n }\r\n else {\r\n /* Restore the original Z (is this allowed??) <ISSUE> */\r\n geographic.setZ(source.getZ());\r\n }\r\n /* Return the WGS geographic coordinates */\r\n return geographic;\r\n }\r\n\r\n /**\r\n * Convert a coordinate to the WGS 84 (geographic 2D) coordinate system.\r\n * @param source the coordinates in this CRS.\r\n * @return the WGS 84 coordinate, x is longitude(-180..+180), y is latitude(-90..+90) and z is height (the z height is the same as the local height).\r\n */\r\n public toWGS(source: Coordinate): Coordinate {\r\n return this.toWGSi(source, -1);\r\n }\r\n\r\n /**\r\n * Convert from the WGS 84 (geographic 2D) coordinate system to this coordinate system.\r\n * @param source the coordinates in the WGS 84 coordinate system, where x is longitude(-180..+180), y is latitude(-90..+90) and z is height.\r\n * @param wgsTransformationIndex the index of the WGS transformation to use (negative for the default transformation).\r\n * @return the coordinates in this CRS (the z height is the same as the WGS height).\r\n */\r\n public fromWGSi(source: Coordinate, wgsTransformationIndex: int32): Coordinate {\r\n /* Already in the WGS datum ? */\r\n if (this.getDatum().getCode() == CRS.WGS84_DATUM_CODE) {\r\n /* Geocentric ? */\r\n if (this._type == CRS.GEOCENTRIC) {\r\n /* Convert to radians */\r\n let lon: float64 = source.getX() / 180.0 * Math.PI;\r\n let lat: float64 = source.getY() / 180.0 * Math.PI;\r\n let geographic: Coordinate = new Coordinate(lon, lat, source.getZ());\r\n /* Convert from geographic to geocentric coordinates */\r\n let geocentric: Coordinate = new Coordinate(0.0, 0.0, 0.0);\r\n this._datum.getEllipsoid().toGeoCentric(geographic, geocentric);\r\n /* Return the geocentric coordinates */\r\n return geocentric;\r\n }\r\n /* Projected ? */\r\n if (this._projection != null) {\r\n /* Convert to radians */\r\n let lon: float64 = source.getX() / 180.0 * Math.PI;\r\n let lat: float64 = source.getY() / 180.0 * Math.PI;\r\n let geographic: Coordinate = new Coordinate(lon, lat, source.getZ());\r\n /* Use the projection to go from geographic (lon,lat) coordinates to projected coordinates */\r\n let projected: Coordinate = new Coordinate(0.0, 0.0, 0.0);\r\n this._projection.forward(geographic, projected);\r\n /* Convert to local units */\r\n if (this._coordinateSystem != null) this._coordinateSystem.standardToLocal(projected, projected);\r\n /* Return the projected coordinates */\r\n return projected;\r\n }\r\n /* Geographic */\r\n return new Coordinate(source.getX(), source.getY(), source.getZ());\r\n }\r\n /* Get the transformation from the local datum to the WGS datum */\r\n let localToWGS: Operation = (wgsTransformationIndex < 0) ? this.getTransformationToWGS() : this.getTransformationsToWGS().get(wgsTransformationIndex);\r\n // if (localToWGS==null)\r\n // {\r\n // /* We cannot transform */\r\n // ASystem.assert(false,\"No datum transformation from \"+this+\" to WGS\");\r\n // }\r\n /* Transform from the WGS datum to the local datum */\r\n let localGeocentric: Coordinate = CRS.getWGS84_2D().toGeoCentric(source/*geographic*/);\r\n if (localToWGS != null) localToWGS.reverse(localGeocentric, localGeocentric);\r\n /* Does the transform work on the projected coordinates (like the OSTN02 grid correction)? */\r\n if ((localToWGS != null) && localToWGS.getSourceCRS().isProjected()) {\r\n /* We already have the result */\r\n return localGeocentric;\r\n }\r\n else {\r\n /* Convert from geocentric to local coordinates */\r\n let local: Coordinate = this.fromGeoCentric(localGeocentric);\r\n /* Restore the original Z (is this allowed??) <ISSUE> */\r\n local.setZ(source.getZ());\r\n /* Return the local coordinates */\r\n return local;\r\n }\r\n }\r\n\r\n /**\r\n * Convert from the WGS 84 (geographic 2D) coordinate system to this coordinate system.\r\n * @param source the coordinates in the WGS 84 coordinate system, where x is longitude(-180..+180), y is latitude(-90..+90) and z is height.\r\n * @return the coordinates in this CRS (the z height is the same as the WGS height).\r\n */\r\n public fromWGS(source: Coordinate): Coordinate {\r\n return this.fromWGSi(source, -1);\r\n }\r\n\r\n /**\r\n * Check if another CRS is compatible with this one.\r\n * @param other the other CRS.\r\n * @return true if compatible.\r\n */\r\n public isCompatible(other: CRS): boolean {\r\n /* Check the base parameters */\r\n if (other._code == this._code) return true;\r\n if (other._type != this._type) return false;\r\n if (other._csCode != this._csCode) return false;\r\n /* Geographic? */\r\n if (this.isGeoCentric() || this.isGeoGraphic()) {\r\n /* Same datum? */\r\n if (Datum.areCompatible(other.getDatum(), this.getDatum()) == false) return false;\r\n /* We need the same transformation to WGS (check CRS 2039 for example: wgs compatible datum, but with geocentric translation to wgs) */\r\n if (Operation.isCompatibleOperation(other.getTransformationToWGS(), this.getTransformationToWGS()) == false) return false;\r\n return true;\r\n }\r\n /* Projected? */\r\n else if (this.isProjected()) {\r\n /* Same projection? */\r\n if (Operation.isCompatibleOperation(other._projection, this._projection) == false) return false;\r\n /* Has base CRS? */\r\n if (other._baseCRS == null || this._baseCRS == null) return false;\r\n /* Same base? */\r\n return (other._baseCRS.isCompatible(this._baseCRS));\r\n }\r\n /* Vertical? */\r\n else if (this.isVertical()) {\r\n /* Same datum? */\r\n if (Datum.areCompatible(other.getDatum(), this.getDatum()) == false) return false;\r\n return true;\r\n }\r\n /* Compound? */\r\n else if (this.isCompound()) {\r\n /* Same components? */\r\n if (CRS.areCompatible(other._horizontalComponent, this._horizontalComponent) == false) return false;\r\n if (CRS.areCompatible(other._verticalComponent, this._verticalComponent) == false) return false;\r\n return true;\r\n }\r\n /* Other */\r\n else {\r\n return false;\r\n }\r\n }\r\n\r\n /**\r\n * Check if two CRSs are compatible.\r\n * @param crs1 the first CRS.\r\n * @param crs2 the second CRS.\r\n * @return true if compatible.\r\n */\r\n public static areCompatible(crs1: CRS, crs2: CRS): boolean {\r\n if (crs1 == null) return (crs2 == null);\r\n if (crs2 == null) return false;\r\n return crs1.isCompatible(crs2);\r\n }\r\n\r\n /**\r\n * Get the text form of the CRS.\r\n * @return the text form of the CRS.\r\n */\r\n public getTextForm(): string {\r\n return this._textForm;\r\n }\r\n\r\n /**\r\n * Set the text form of the CRS.\r\n * @param textForm the text form of the CRS.\r\n */\r\n public setTextForm(textForm: string): void {\r\n this._textForm = textForm;\r\n }\r\n\r\n\t/**\r\n\t * Get the access time.\r\n\t * @return the access time.\r\n\t */\r\n public getAccessTime(): float64 {\r\n return this._accessTime;\r\n }\r\n\r\n\t/**\r\n\t * Set the access time.\r\n\t * @param time the access time.\r\n\t */\r\n public setAccessTime(time: float64): void {\r\n this._accessTime = time;\r\n }\r\n\r\n /**\r\n * The standard toString method.\r\n * @see Object#toString\r\n */\r\n public toString(): string {\r\n return \"[CRS:code=\" + this._code + \",name='\" + this._name + \"',area=\" + this._area + \",type='\" + CRS.labelCRSType(this._type) + \"',datum=\" + this._datum + \",baseCRS=\" + this._baseCRS + \",wgs-transform=\" + (this._transformationToWGS != null) + \"]\";\r\n }\r\n\r\n /**\r\n * Get the type of a CRS.\r\n * @param crsKind the type of CRS.\r\n * @return a parsed type.\r\n */\r\n public static parseCRSType(crsKind: string): int32 {\r\n if (Strings.equalsIgnoreCase(crsKind, \"compound\")) return CRS.COMPOUND;\r\n if (Strings.equalsIgnoreCase(crsKind, \"engineering\")) return CRS.ENGINEERING;\r\n if (Strings.equalsIgnoreCase(crsKind, \"geocentric\")) return CRS.GEOCENTRIC;\r\n if (Strings.equalsIgnoreCase(crsKind, \"geographic 2D\")) return CRS.GEOGRAPHIC_2D;\r\n if (Strings.equalsIgnoreCase(crsKind, \"geographic 3D\")) return CRS.GEOGRAPHIC_3D;\r\n if (Strings.equalsIgnoreCase(crsKind, \"projected\")) return CRS.PROJECTED;\r\n if (Strings.equalsIgnoreCase(crsKind, \"vertical\")) return CRS.VERTICAL;\r\n ASystem.assert0(false, \"CRS kind '\" + crsKind + \"' not found\");\r\n return 0;\r\n }\r\n\r\n /**\r\n * Get the label of a type of a CRS.\r\n * @param crsType the type of CRS.\r\n * @return a label.\r\n */\r\n public static labelCRSType(crsType: int32): string {\r\n if (crsType == CRS.COMPOUND) return \"compound\";\r\n if (crsType == CRS.ENGINEERING) return \"engineering\";\r\n if (crsType == CRS.GEOCENTRIC) return \"geocentric\";\r\n if (crsType == CRS.GEOGRAPHIC_2D) return \"geographic 2D\";\r\n if (crsType == CRS.GEOGRAPHIC_3D) return \"geographic 3D\";\r\n if (crsType == CRS.PROJECTED) return \"projected\";\r\n if (crsType == CRS.VERTICAL) return \"vertical\";\r\n ASystem.assert0(false, \"CRS type '\" + crsType + \"' not found\");\r\n return null;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"CRS.js","sourceRoot":"","sources":["../../../../src/spatial/ecrs/CRS.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAUH,yDAAsD;AACtD,0DAAuD;AACvD,0DAAuD;AACvD,mDAAgD;AAEhD,yDAAsD;AACtD,mCAAgC;AAEhC,2CAAwC;AAExC,yCAAsC;AAEtC,iCAA8B;AAG9B;;;;;;;;;;;;;GAaG;AACH,gBAAgB;AAChB,MAAa,GAAG;IAgFZ;;;;;;;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F;AAC5D,wBAAoB,GAAW,MAAM,CAAC;AAC7D,mFAAmF;AAC5D,gBAAY,GAAW,MAAM,CAAC;AACrD,2EAA2E;AACpD,gBAAY,GAAW,MAAM,CAAC;AAErD,4EAA4E;AAC7D,2BAAuB,GAAQ,IAAI,CAAC;AACnD,4EAA4E;AAC7D,mBAAe,GAAQ,IAAI,CAAC;AAC3C,oEAAoE;AACrD,mBAAe,GAAQ,IAAI,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module OrbitGT\r\n */\r\n\r\n//package orbitgt.spatial.ecrs;\r\n\r\ntype int8 = number;\r\ntype int16 = number;\r\ntype int32 = number;\r\ntype float32 = number;\r\ntype float64 = number;\r\n\r\nimport { AList } from \"../../system/collection/AList\";\r\nimport { ASystem } from \"../../system/runtime/ASystem\";\r\nimport { Strings } from \"../../system/runtime/Strings\";\r\nimport { Coordinate } from \"../geom/Coordinate\";\r\nimport { Axis } from \"./Axis\";\r\nimport { CoordinateSystem } from \"./CoordinateSystem\";\r\nimport { Datum } from \"./Datum\";\r\nimport { Ellipsoid } from \"./Ellipsoid\";\r\nimport { Operation } from \"./Operation\";\r\nimport { OperationMethod } from \"./OperationMethod\";\r\nimport { Registry } from \"./Registry\";\r\nimport { Transform } from \"./Transform\";\r\nimport { Unit } from \"./Unit\";\r\nimport { VerticalModel } from \"./VerticalModel\";\r\n\r\n/**\r\n * Class CRS defines the parameters of a coordinate reference system.\r\n * NOTE: geographic (lon-lat) CRSs have their coordinates in degrees (0..360) instead of radians (0..2PI).\r\n * NOTE: geocentric (ECEF) CRSs have their coordinates in meters.\r\n *\r\n * Based on the following document:\r\n *\r\n * Coordinate Conversions and Transformations including Formulas\r\n * Guidance Note Number 7, part 2\r\n * Revised May 2005\r\n * Available at: http://www.epsg.org/\r\n *\r\n * @version 1.0 July 2005\r\n */\r\n/** @internal */\r\nexport class CRS {\r\n /** The type of a compound CRS */\r\n public static readonly COMPOUND: int32 = 1;\r\n /** The type of a engineering CRS */\r\n public static readonly ENGINEERING: int32 = 2;\r\n /** The type of a geocentric CRS */\r\n public static readonly GEOCENTRIC: int32 = 3;\r\n /** The type of a geographic-2D CRS */\r\n public static readonly GEOGRAPHIC_2D: int32 = 4;\r\n /** The type of a geographic-3D CRS */\r\n public static readonly GEOGRAPHIC_3D: int32 = 5;\r\n /** The type of a projected CRS */\r\n public static readonly PROJECTED: int32 = 6;\r\n /** The type of a vertical CRS */\r\n public static readonly VERTICAL: int32 = 7;\r\n\r\n /** The identification code of the WGS 84 geocentric reference system */\r\n public static readonly WGS84_GEOCENTRIC_CRS_CODE: int32 = 4978;\r\n /** The identification code of the WGS 84 3D coordinate reference system */\r\n public static readonly WGS84_3D_CRS_CODE: int32 = 4979;\r\n /** The identification code of the WGS 84 2D coordinate reference system */\r\n public static readonly WGS84_2D_CRS_CODE: int32 = 4326;\r\n /** The identification code of the WGS 84 datum */\r\n private static readonly WGS84_DATUM_CODE: int32 = 6326;\r\n\r\n /** The identification code of the WGS 84 geocentric coordinate reference system */\r\n public static readonly CRS_WGS84_GEOCENTRIC: string = \"4978\";\r\n /** The identification code of the WGS 84 geographic coordinate reference system */\r\n public static readonly CRS_WGS84_3D: string = \"4979\";\r\n /** The identification code of the WGS 84 2D coordinate reference system */\r\n public static readonly CRS_WGS84_2D: string = \"4326\";\r\n\r\n /** The cache of the WGS 84 geocentric coordinate reference system (4978) */\r\n private static _CACHE_WGS84_GEOCENTRIC: CRS = null;\r\n /** The cache of the WGS 84 geographic coordinate reference system (4979) */\r\n private static _CACHE_WGS84_3D: CRS = null;\r\n /** The cache of the WGS 84 2D coordinate reference system (4326) */\r\n private static _CACHE_WGS84_2D: CRS = null;\r\n\r\n /** The code */\r\n private _code: int32;\r\n /** The name */\r\n private _name: string;\r\n /** The area of use */\r\n private _area: int32;\r\n /** The type (PROJECTED,GEOGRAPHIC_2D,GEOGRAPHIC_3D,GEOCENTRIC,VERTICAL,COMPOUND,...) */\r\n private _type: int32;\r\n\r\n /** The coordinate-system code */\r\n private _csCode: int32;\r\n /** The coordinate axes (defined by the csCode) */\r\n private _axes: AList<Axis>;\r\n /** The coordinate system (can be null) */\r\n private _coordinateSystem: CoordinateSystem;\r\n /** The datum */\r\n private _datum: Datum;\r\n\r\n /** The base geographic CRS */\r\n private _baseCRS: CRS;\r\n /** The projection (from the base CRS to this CRS) */\r\n private _projection: Operation;\r\n\r\n /** The transformations from the base geocentric CRS to the geocentric WGS (CRS 4326) */\r\n private _transformationsToWGS: AList<Operation>;\r\n /** The default transformation from the base geocentric CRS to the geocentric WGS (CRS 4326) */\r\n private _transformationToWGS: Operation;\r\n\r\n /** The horizontal CRS (type COMPOUND) */\r\n private _horizontalComponent: CRS;\r\n /** The vertical CRS (type COMPOUND) */\r\n private _verticalComponent: CRS;\r\n /** The vertical model (type VERTICAL) */\r\n private _verticalModel: VerticalModel;\r\n\r\n /** The text information (WKT) of the CRS */\r\n private _textForm: string;\r\n\r\n /** The access time of the CRS (for garbage collecting the dynamic CRS) */\r\n private _accessTime: float64;\r\n\r\n /**\r\n * Create a new CRS.\r\n * @param code the code.\r\n * @param name the name.\r\n * @param area the area of use.\r\n * @param type the type.\r\n * @param csCode the coordinate-system code.\r\n * @param datum the datum.\r\n * @param baseCRS the base geographic CRS.\r\n * @param projection the projection (from the base CRS to this CRS).\r\n * @param transformationsToWGS the transformations from the base geographic CRS to the WGS 84 datum (of CRS 4326).\r\n */\r\n public constructor(code: int32, name: string, area: int32, type: int32, csCode: int32, datum: Datum, baseCRS: CRS, projection: Operation, transformationsToWGS: AList<Operation>) {\r\n /* Store the parameters */\r\n this._code = code;\r\n this._name = name;\r\n this._area = area;\r\n this._type = type;\r\n this._csCode = csCode;\r\n this._axes = null;\r\n this._coordinateSystem = null;\r\n this._datum = datum;\r\n this._baseCRS = baseCRS;\r\n this._projection = projection;\r\n this._transformationsToWGS = transformationsToWGS;\r\n /* Get the default transform */\r\n this._transformationToWGS = Operation.getLatestTransformation(transformationsToWGS);\r\n /* Clear */\r\n this._horizontalComponent = null;\r\n this._verticalComponent = null;\r\n this._verticalModel = null;\r\n this._textForm = null;\r\n this._accessTime = 0.0;\r\n }\r\n\r\n /**\r\n * Create a compound CRS.\r\n * @param code the code.\r\n * @param name the name.\r\n * @param area the area of use.\r\n * @param horizontalCRS the horizontal CRS.\r\n * @param verticalCRS the vertical CRS.\r\n * @return the compound CRS.\r\n */\r\n public static createCompound(code: int32, name: string, area: int32, horizontalCRS: CRS, verticalCRS: CRS): CRS {\r\n /* Check the parameters */\r\n ASystem.assertNot(horizontalCRS == null, \"No horizontal CRS\");\r\n ASystem.assertNot(verticalCRS == null, \"No vertical CRS\");\r\n ASystem.assertNot(horizontalCRS.isVertical(), \"CRS is not horizontal: \" + horizontalCRS);\r\n ASystem.assertNot(verticalCRS.isVertical() == false, \"CRS is not vertical: \" + verticalCRS);\r\n /* Make the CRS */\r\n let crs: CRS = new CRS(code, name, area, CRS.COMPOUND, 0/*csCode*/, null/*datum*/, null/*baseCRS*/, null/*projection*/, null/*transformationsToWGS*/);\r\n crs._horizontalComponent = horizontalCRS;\r\n crs._verticalComponent = verticalCRS;\r\n /* Return the CRS */\r\n return crs;\r\n }\r\n\r\n /**\r\n * Get the code.\r\n * @return the code.\r\n */\r\n public getCode(): int32 {\r\n return this._code;\r\n }\r\n\r\n /**\r\n * Get the string code.\r\n * @return the string code.\r\n */\r\n public getStringCode(): string {\r\n return \"\" + this._code;\r\n }\r\n\r\n /**\r\n * Check if a code matches the CRS code.\r\n * @param code the code.\r\n * @return true if the code matches.\r\n */\r\n public hasStringCode(code: string): boolean {\r\n return Strings.equals(code, this.getStringCode());\r\n }\r\n\r\n /**\r\n * Get the name.\r\n * @return the name.\r\n */\r\n public getName(): string {\r\n return this._name;\r\n }\r\n\r\n /**\r\n * Get the area of use.\r\n * @return the area.\r\n */\r\n public getArea(): int32 {\r\n return this._area;\r\n }\r\n\r\n /**\r\n * Get the type.\r\n * @return the type.\r\n */\r\n public getType(): int32 {\r\n return this._type;\r\n }\r\n\r\n /**\r\n * Get the type label.\r\n * @return the type label.\r\n */\r\n public getTypeLabel(): string {\r\n return CRS.labelCRSType(this._type);\r\n }\r\n\r\n /**\r\n * Is this a geocentric CRS?\r\n * @return true for a geocentric CRS.\r\n */\r\n public isGeoCentric(): boolean {\r\n return (this._type == CRS.GEOCENTRIC);\r\n }\r\n\r\n /**\r\n * Is this a geographic CRS?\r\n * @return true for a projected CRS.\r\n */\r\n public isGeoGraphic(): boolean {\r\n return (this._type == CRS.GEOGRAPHIC_2D || this._type == CRS.GEOGRAPHIC_3D);\r\n }\r\n\r\n /**\r\n * Is this a geographic 2D CRS?\r\n * @return true for a projected 2D CRS.\r\n */\r\n public isGeoGraphic2D(): boolean {\r\n return (this._type == CRS.GEOGRAPHIC_2D);\r\n }\r\n\r\n /**\r\n * Is this a geographic 3D CRS?\r\n * @return true for a projected 3D CRS.\r\n */\r\n public isGeoGraphic3D(): boolean {\r\n return (this._type == CRS.GEOGRAPHIC_3D);\r\n }\r\n\r\n /**\r\n * Is this a projected CRS?\r\n * @return true for a projected CRS.\r\n */\r\n public isProjectedType(): boolean {\r\n return (this._type == CRS.PROJECTED);\r\n }\r\n\r\n /**\r\n * Is this a projected CRS?\r\n * @return true for a projected CRS.\r\n */\r\n public isProjected(): boolean {\r\n if (this._type == CRS.COMPOUND) return this._horizontalComponent.isProjected();\r\n return (this._type == CRS.PROJECTED);\r\n }\r\n\r\n /**\r\n * Is this a vertical CRS?\r\n * @return true for a vertical CRS.\r\n */\r\n public isVertical(): boolean {\r\n return (this._type == CRS.VERTICAL);\r\n }\r\n\r\n /**\r\n * Is this a compound CRS?\r\n * @return true for a compound CRS.\r\n */\r\n public isCompound(): boolean {\r\n return (this._type == CRS.COMPOUND);\r\n }\r\n\r\n /**\r\n * Get the coordinate-system code.\r\n * @return the coordinate-system code.\r\n */\r\n public getCoordinateSystemCode(): int32 {\r\n return this._csCode;\r\n }\r\n\r\n /**\r\n * Get the coordinate system.\r\n * @return the coordinate system (can be null if standard).\r\n */\r\n public getCoordinateSystem(): CoordinateSystem {\r\n return this._coordinateSystem;\r\n }\r\n\r\n /**\r\n * Get the datum.\r\n * @return the datum.\r\n */\r\n public getDatum(): Datum {\r\n if (this._datum != null) return this._datum;\r\n if (this._baseCRS != null) return this._baseCRS.getDatum();\r\n return null;\r\n }\r\n\r\n /**\r\n * Get the code of the datum.\r\n * @return the code of the datum (0 if there is no datum).\r\n */\r\n public getDatumCode(): int32 {\r\n let datum: Datum = this.getDatum();\r\n return (datum == null) ? 0 : datum.getCode();\r\n }\r\n\r\n /**\r\n * Set the datum.\r\n * @param datum the new datum (if null check the base CRS).\r\n */\r\n public setDatum(datum: Datum): void {\r\n this._datum = datum;\r\n }\r\n\r\n /**\r\n * Get the ellipsoid.\r\n * @return the ellipsoid.\r\n */\r\n public getEllipsoid(): Ellipsoid {\r\n return this.getDatum().getEllipsoid();\r\n }\r\n\r\n /**\r\n * Get the base geographic CRS.\r\n * @return the base geographic CRS.\r\n */\r\n public getBaseCRS(): CRS {\r\n return this._baseCRS;\r\n }\r\n\r\n /**\r\n * Set the base geographic CRS.\r\n * @param baseCRS the new base geographic CRS.\r\n */\r\n public setBaseCRS(baseCRS: CRS): void {\r\n this._baseCRS = baseCRS;\r\n }\r\n\r\n /**\r\n * Get the coordinate axis of the CRS.\r\n * @return the coordinate axis of the CRS.\r\n */\r\n public getAxes(): AList<Axis> {\r\n return this._axes;\r\n }\r\n\r\n /**\r\n * Set the coordinate axis of the CRS.\r\n * @param axis the coordinate axis of the CRS.\r\n */\r\n public setAxes(axes: AList<Axis>): void {\r\n /* Store the parameters */\r\n this._axes = axes;\r\n /* Update the coordinate system */\r\n this._coordinateSystem = CoordinateSystem.create(this._type, this._csCode, this._axes);\r\n }\r\n\r\n /**\r\n * Get the unit code of the first coordinate axis of the CRS.\r\n * @return the unit code (defaults to METER).\r\n */\r\n public getFirstAxisUnitCode(): int32 {\r\n if (this._type == CRS.COMPOUND) return this._horizontalComponent.getFirstAxisUnitCode();\r\n if (this._axes == null) return Unit.METER;\r\n if (this._axes.size() == 0) return Unit.METER;\r\n return this._axes.get(0).getUnitCode();\r\n }\r\n\r\n /**\r\n * Get the projection (from the base CRS to this CRS).\r\n * @return the projection.\r\n */\r\n public getProjection(): Operation {\r\n return this._projection;\r\n }\r\n\r\n /**\r\n * Set the projection (from the base CRS to this CRS).\r\n * @param projection the projection.\r\n */\r\n public setProjection(projection: Operation): void {\r\n this._projection = projection;\r\n }\r\n\r\n /**\r\n * Get the projection method (from the base CRS to this CRS).\r\n * @return the projection method.\r\n */\r\n public getProjectionMethod(): OperationMethod {\r\n if (this._projection == null) return null;\r\n return this._projection.getMethod();\r\n }\r\n\r\n /**\r\n * Get the horizontal component of a compound CRS.\r\n * @return the horizontal component of a compound CRS.\r\n */\r\n public getHorizontalComponent(): CRS {\r\n /* Check the type */\r\n ASystem.assertNot(this._type != CRS.COMPOUND, \"CRS \" + this._code + \" is not compound\");\r\n /* Return the component */\r\n return this._horizontalComponent;\r\n }\r\n\r\n /**\r\n * Check if there is a vertical component (only for type COMPOUND).\r\n * @return true if there is a vertical component.\r\n */\r\n public hasVerticalComponent(): boolean {\r\n /* Check the type */\r\n if (this._type != CRS.COMPOUND) return false;\r\n /* Check the component */\r\n return (this._verticalComponent != null);\r\n }\r\n\r\n /**\r\n * Get the vertical component of a compound CRS.\r\n * @return the vertical component of a compound CRS.\r\n */\r\n public getVerticalComponent(): CRS {\r\n /* Check the type */\r\n ASystem.assertNot(this._type != CRS.COMPOUND, \"CRS \" + this._code + \" is not compound\");\r\n /* Return the component */\r\n return this._verticalComponent;\r\n }\r\n\r\n /**\r\n * Get the vertical model (only for type VERTICAL).\r\n * @return the vertical model.\r\n */\r\n public getVerticalModel(): VerticalModel {\r\n return this._verticalModel;\r\n }\r\n\r\n /**\r\n * Set the vertical model (only for type VERTICAL).\r\n * @param verticalModel the vertical model.\r\n */\r\n public setVerticalModel(verticalModel: VerticalModel): void {\r\n this._verticalModel = verticalModel;\r\n }\r\n\r\n /**\r\n * Peek at the transformations from the base geographic CRS to the WGS 84 datum (of CRS 4326).\r\n * @return the transformations.\r\n */\r\n public peekTransformationsToWGS(): AList<Operation> {\r\n return this._transformationsToWGS;\r\n }\r\n\r\n /**\r\n * Get the transformations from the base geographic CRS to the WGS 84 datum (of CRS 4326).\r\n * @return the transformations.\r\n */\r\n public getTransformationsToWGS(): AList<Operation> {\r\n if ((this._transformationsToWGS != null) && (this._transformationsToWGS.size() > 0)) return this._transformationsToWGS;\r\n if (this._baseCRS != null) return this._baseCRS.getTransformationsToWGS();\r\n return new AList<Operation>();\r\n }\r\n\r\n /**\r\n * Set the transformations from the base geographic CRS to the WGS 84 datum (of CRS 4326).\r\n * @param transformations the transformations.\r\n */\r\n public setTransformationsToWGS(transformations: AList<Operation>): void {\r\n this._transformationsToWGS = transformations;\r\n }\r\n\r\n /**\r\n * Get the default transformation from the base geographic CRS to the WGS 84 datum (of CRS 4326).\r\n * @return a transformation (null if not available).\r\n */\r\n public getTransformationToWGS(): Operation {\r\n if (this._transformationToWGS != null) return this._transformationToWGS;\r\n if (this._baseCRS != null) return this._baseCRS.getTransformationToWGS();\r\n return null;\r\n }\r\n\r\n /**\r\n * Set the default transformation from the base geographic CRS to the WGS 84 datum (of CRS 4326).\r\n * @param transformation a transformation (null if not available).\r\n */\r\n public setTransformationToWGS(transformation: Operation): void {\r\n this._transformationToWGS = transformation;\r\n }\r\n\r\n /**\r\n * Convert to a geocentric coordinate.\r\n * @param local the coordinate in this CRS.\r\n * @return the geocentric coordinate.\r\n */\r\n public toGeoCentric(local: Coordinate): Coordinate {\r\n /* Projection ? */\r\n if (this._type == CRS.PROJECTED) {\r\n /* We need a geographic base CRS */\r\n ASystem.assertNot(this._baseCRS.isGeoGraphic() == false, \"Projected CRS '\" + this._code + \"' needs a geographic base CRS '\" + this._baseCRS.getCode() + \"', not '\" + this._baseCRS.getTypeLabel() + \"'\");\r\n /* Convert to standard units */\r\n let projected: Coordinate = local.copy();\r\n if (this._coordinateSystem != null) this._coordinateSystem.localToStandard(projected, projected);\r\n /* Inverse the projection to get geographic (lon,lat) coordinates (radians) */\r\n let geographic: Coordinate = new Coordinate(0.0, 0.0, 0.0);\r\n this._projection.reverse(geographic, projected);\r\n /* The geographic coordinates are in degrees */\r\n geographic.setX(geographic.getX() / Math.PI * 180.0);\r\n geographic.setY(geographic.getY() / Math.PI * 180.0);\r\n /* Let the base CRS calculate the geocentric coordinates */\r\n return this._baseCRS.toGeoCentric(geographic);\r\n }\r\n /* Geocentric ? */\r\n if (this._type == CRS.GEOCENTRIC) {\r\n /* Already geocentric */\r\n return local.copy();\r\n }\r\n /* Geographic ? */\r\n if (this._type == CRS.GEOGRAPHIC_2D || this._type == CRS.GEOGRAPHIC_3D) {\r\n /* All geographic coordinates are in degrees */\r\n let geographic: Coordinate = local.copy();\r\n geographic.setX(geographic.getX() / 180.0 * Math.PI);\r\n geographic.setY(geographic.getY() / 180.0 * Math.PI);\r\n /* Convert from geographic (radians) to geocentric */\r\n let geocentric: Coordinate = new Coordinate(0.0, 0.0, 0.0);\r\n this._datum.getEllipsoid().toGeoCentric(geographic, geocentric);\r\n /* Return the geocentric coordinates */\r\n return geocentric;\r\n }\r\n /* We cannot transform */\r\n ASystem.assertNot(true, \"No geocentric transform for \" + this);\r\n return null;\r\n }\r\n\r\n /**\r\n * Convert from a geocentric coordinate.\r\n * @param geocentric the geocentric coordinate.\r\n * @return the coordinate in this CRS.\r\n */\r\n public fromGeoCentric(geocentric: Coordinate): Coordinate {\r\n /* Projection ? */\r\n if (this._type == CRS.PROJECTED) {\r\n /* We need a geographic base CRS */\r\n ASystem.assertNot(this._baseCRS.isGeoGraphic() == false, \"Projected CRS '\" + this._code + \"' needs a geographic base CRS '\" + this._baseCRS.getCode() + \"', not '\" + this._baseCRS.getTypeLabel() + \"'\");\r\n /* Get the geographic coordinate */\r\n let geographic: Coordinate = this._baseCRS.fromGeoCentric(geocentric);\r\n /* The geographic coordinates are in degrees */\r\n geographic.setX(geographic.getX() / 180.0 * Math.PI);\r\n geographic.setY(geographic.getY() / 180.0 * Math.PI);\r\n /* Make the projection */\r\n let projected: Coordinate = new Coordinate(0.0, 0.0, 0.0);\r\n this._projection.forward(geographic, projected);\r\n /* Convert to local units */\r\n if (this._coordinateSystem != null) this._coordinateSystem.standardToLocal(projected, projected);\r\n /* Return the projected coordinate */\r\n return projected;\r\n }\r\n /* Geocentric ? */\r\n if (this._type == CRS.GEOCENTRIC) {\r\n /* Already geocentric */\r\n return geocentric.copy();\r\n }\r\n /* Geographic ? */\r\n if (this._type == CRS.GEOGRAPHIC_2D || this._type == CRS.GEOGRAPHIC_3D) {\r\n /* Convert from geocentric to geographic (radians) */\r\n let geographic: Coordinate = new Coordinate(0.0, 0.0, 0.0);\r\n this._datum.getEllipsoid().toGeoGraphic(geocentric, geographic);\r\n /* All geographic coordinates need to be in degrees */\r\n geographic.setX(geographic.getX() / Math.PI * 180.0);\r\n geographic.setY(geographic.getY() / Math.PI * 180.0);\r\n /* Return the geographic coordinate */\r\n return geographic;\r\n }\r\n /* We cannot transform */\r\n ASystem.assertNot(true, \"No geocentric transform for \" + this);\r\n return null;\r\n }\r\n\r\n /**\r\n * Check if this CRS is a projection of another CRS.\r\n * @param geographic the geographic CRS to check.\r\n * @return true if this is a projection of the geographic CRS.\r\n */\r\n public isProjectionOf(geographic: CRS): boolean {\r\n /* This has to be a projection */\r\n if (this._type != CRS.PROJECTED) return false;\r\n if (this._projection == null) return false;\r\n if (this._baseCRS == null) return false;\r\n /* We need a geographic system */\r\n if (geographic._type != CRS.GEOGRAPHIC_2D && geographic._type != CRS.GEOGRAPHIC_3D) return false;\r\n /* Is this our base CRS? */\r\n return (this._baseCRS.isCompatible(geographic));\r\n }\r\n\r\n /**\r\n * Convert from a geographic coordinate to a projected coordinate.\r\n * @param geographic the source geographic coordinate (in degrees).\r\n * @param projected the target projected coordinate (use null to create a new coordinate).\r\n * @return the projected coordinate.\r\n */\r\n public toProjected(geographic: Coordinate, projected: Coordinate): Coordinate {\r\n /* Create target? */\r\n if (projected == null) projected = new Coordinate(0.0, 0.0, 0.0);\r\n /* The geographic coordinates are kept in degrees */\r\n projected.setX(geographic.getX() / 180.0 * Math.PI);\r\n projected.setY(geographic.getY() / 180.0 * Math.PI);\r\n projected.setZ(geographic.getZ());\r\n /* Make the projection */\r\n this._projection.forward(projected, projected);\r\n /* Convert to local units */\r\n if (this._coordinateSystem != null) this._coordinateSystem.standardToLocal(projected, projected);\r\n /* Return the result */\r\n return projected;\r\n }\r\n\r\n /**\r\n * Convert from a projected coordinate to a geographic coordinate.\r\n * @param projected the source projected coordinate.\r\n * @param geographic the target geographic coordinate (in degrees) (use null to create a new coordinate).\r\n * @return the geographic coordinate.\r\n */\r\n public fromProjected(projected: Coordinate, geographic: Coordinate): Coordinate {\r\n /* Create target? */\r\n if (geographic == null) geographic = new Coordinate(0.0, 0.0, 0.0);\r\n /* Convert to standard units */\r\n let projected2: Coordinate = projected.copy();\r\n if (this._coordinateSystem != null) this._coordinateSystem.localToStandard(projected2, projected2);\r\n /* Inverse the projection to get the geographic (lon,lat) coordinates (radians) */\r\n this._projection.reverse(geographic, projected2);\r\n /* The geographic coordinates are kept in degrees */\r\n geographic.setX(geographic.getX() / Math.PI * 180.0);\r\n geographic.setY(geographic.getY() / Math.PI * 180.0);\r\n /* Return the result */\r\n return geographic;\r\n }\r\n\r\n /**\r\n * Get the WGS 84 2D geocentric reference system.\r\n * @return the WGS 84 2D geocentric reference system.\r\n */\r\n private static getWGS84_GeoCentric(): CRS {\r\n if (CRS._CACHE_WGS84_GEOCENTRIC == null) CRS._CACHE_WGS84_GEOCENTRIC = Registry.getCRS2(CRS.CRS_WGS84_GEOCENTRIC);\r\n return CRS._CACHE_WGS84_GEOCENTRIC;\r\n }\r\n\r\n /**\r\n * Get the WGS 84 2D geographic reference system.\r\n * @return the WGS 84 2D geographic reference system.\r\n */\r\n private static getWGS84_3D(): CRS {\r\n if (CRS._CACHE_WGS84_3D == null) CRS._CACHE_WGS84_3D = Registry.getCRS2(CRS.CRS_WGS84_3D);\r\n return CRS._CACHE_WGS84_3D;\r\n }\r\n\r\n /**\r\n * Get the WGS 84 2D coordinate reference system.\r\n * @return the WGS 84 2D coordinate reference system.\r\n */\r\n private static getWGS84_2D(): CRS {\r\n if (CRS._CACHE_WGS84_2D == null) CRS._CACHE_WGS84_2D = Registry.getCRS2(CRS.CRS_WGS84_2D);\r\n return CRS._CACHE_WGS84_2D;\r\n }\r\n\r\n /**\r\n * Is a conversion to and from the WGS 84 coordinate system possible?\r\n * @return true if possible.\r\n */\r\n public isWGSCompatible(): boolean {\r\n /* Already in WGS ? */\r\n if (this.getDatum().getCode() == CRS.WGS84_DATUM_CODE) return true;\r\n /* Get the transformation from the local datum to the WGS datum */\r\n let localToWGS: Operation = this.getTransformationToWGS();\r\n if (localToWGS == null) return false;\r\n /* Compatible */\r\n return true;\r\n }\r\n\r\n /**\r\n * Convert a coordinate to the WGS 84 (geographic 2D) coordinate system.\r\n * @param source the coordinates in this CRS.\r\n * @param wgsTransformationIndex the index of the WGS transformation to use (negative for the default transformation).\r\n * @return the WGS 84 coordinate, x is longitude(-180..+180), y is latitude(-90..+90) and z is height (the z height is the same as the local height).\r\n */\r\n public toWGSi(source: Coordinate, wgsTransformationIndex: int32): Coordinate {\r\n /* Already in the WGS datum ? */\r\n if (this.getDatum().getCode() == CRS.WGS84_DATUM_CODE) {\r\n /* Geocentric ? */\r\n if (this._type == CRS.GEOCENTRIC) {\r\n /* Convert from geocentric to geographic coordinates */\r\n let ageographic: Coordinate = new Coordinate(0.0, 0.0, 0.0);\r\n this._datum.getEllipsoid().toGeoGraphic(source/*geocentric*/, ageographic);\r\n /* The WGS coordinates need to be in degrees */\r\n ageographic.setX(ageographic.getX() / Math.PI * 180.0);\r\n ageographic.setY(ageographic.getY() / Math.PI * 180.0);\r\n /* Return the WGS coordinates */\r\n return ageographic;\r\n }\r\n /* Projected ? */\r\n if (this._projection != null) {\r\n /* Convert to standard units */\r\n let projected: Coordinate = source.copy();\r\n if (this._coordinateSystem != null) this._coordinateSystem.localToStandard(projected, projected);\r\n /* Inverse the projection to go from projected to geographic (lon,lat) coordinates */\r\n let ageographic: Coordinate = new Coordinate(0.0, 0.0, 0.0);\r\n this._projection.reverse(ageographic, projected);\r\n /* The WGS coordinates need to be in degrees */\r\n ageographic.setX(ageographic.getX() / Math.PI * 180.0);\r\n ageographic.setY(ageographic.getY() / Math.PI * 180.0);\r\n /* Return the WGS coordinates */\r\n return ageographic;\r\n }\r\n /* Geographic */\r\n return new Coordinate(source.getX(), source.getY(), source.getZ());\r\n }\r\n /* Get the transformation from the local datum to the WGS datum */\r\n let localToWGS: Operation = (wgsTransformationIndex < 0) ? this.getTransformationToWGS() : this.getTransformationsToWGS().get(wgsTransformationIndex);\r\n // if (localToWGS==null)\r\n // {\r\n // /* We cannot transform */\r\n // ASystem.assert(false,\"No datum transformation from \"+this+\" to WGS\");\r\n // }\r\n /* Does the transform work on the projected coordinates (like the OSTN02 grid correction)? */\r\n let geocentric: Coordinate;\r\n if ((localToWGS != null) && localToWGS.getSourceCRS().isProjected()) {\r\n /* Start with the projected coordinate */\r\n geocentric = new Coordinate(source.getX(), source.getY(), source.getZ());\r\n }\r\n else {\r\n /* Calculate the geocentric coordinate */\r\n geocentric = this.toGeoCentric(new Coordinate(source.getX(), source.getY(), source.getZ()));\r\n }\r\n /* Apply the transform to the WGS datum */\r\n if (localToWGS != null) localToWGS.forward(geocentric, geocentric);\r\n /* Get the geographic coordinate */\r\n let geographic: Coordinate = CRS.getWGS84_2D().fromGeoCentric(geocentric);\r\n /* Does the transform work on the projected coordinates (like the OSTN02 grid correction)? */\r\n if ((localToWGS != null) && localToWGS.getSourceCRS().isProjected()) {\r\n /* Assume we have the right Z */\r\n }\r\n else {\r\n /* Restore the original Z (is this allowed??) <ISSUE> */\r\n geographic.setZ(source.getZ());\r\n }\r\n /* Return the WGS geographic coordinates */\r\n return geographic;\r\n }\r\n\r\n /**\r\n * Convert a coordinate to the WGS 84 (geographic 2D) coordinate system.\r\n * @param source the coordinates in this CRS.\r\n * @return the WGS 84 coordinate, x is longitude(-180..+180), y is latitude(-90..+90) and z is height (the z height is the same as the local height).\r\n */\r\n public toWGS(source: Coordinate): Coordinate {\r\n return this.toWGSi(source, -1);\r\n }\r\n\r\n /**\r\n * Convert from the WGS 84 (geographic 2D) coordinate system to this coordinate system.\r\n * @param source the coordinates in the WGS 84 coordinate system, where x is longitude(-180..+180), y is latitude(-90..+90) and z is height.\r\n * @param wgsTransformationIndex the index of the WGS transformation to use (negative for the default transformation).\r\n * @return the coordinates in this CRS (the z height is the same as the WGS height).\r\n */\r\n public fromWGSi(source: Coordinate, wgsTransformationIndex: int32): Coordinate {\r\n /* Already in the WGS datum ? */\r\n if (this.getDatum().getCode() == CRS.WGS84_DATUM_CODE) {\r\n /* Geocentric ? */\r\n if (this._type == CRS.GEOCENTRIC) {\r\n /* Convert to radians */\r\n let lon: float64 = source.getX() / 180.0 * Math.PI;\r\n let lat: float64 = source.getY() / 180.0 * Math.PI;\r\n let geographic: Coordinate = new Coordinate(lon, lat, source.getZ());\r\n /* Convert from geographic to geocentric coordinates */\r\n let geocentric: Coordinate = new Coordinate(0.0, 0.0, 0.0);\r\n this._datum.getEllipsoid().toGeoCentric(geographic, geocentric);\r\n /* Return the geocentric coordinates */\r\n return geocentric;\r\n }\r\n /* Projected ? */\r\n if (this._projection != null) {\r\n /* Convert to radians */\r\n let lon: float64 = source.getX() / 180.0 * Math.PI;\r\n let lat: float64 = source.getY() / 180.0 * Math.PI;\r\n let geographic: Coordinate = new Coordinate(lon, lat, source.getZ());\r\n /* Use the projection to go from geographic (lon,lat) coordinates to projected coordinates */\r\n let projected: Coordinate = new Coordinate(0.0, 0.0, 0.0);\r\n this._projection.forward(geographic, projected);\r\n /* Convert to local units */\r\n if (this._coordinateSystem != null) this._coordinateSystem.standardToLocal(projected, projected);\r\n /* Return the projected coordinates */\r\n return projected;\r\n }\r\n /* Geographic */\r\n return new Coordinate(source.getX(), source.getY(), source.getZ());\r\n }\r\n /* Get the transformation from the local datum to the WGS datum */\r\n let localToWGS: Operation = (wgsTransformationIndex < 0) ? this.getTransformationToWGS() : this.getTransformationsToWGS().get(wgsTransformationIndex);\r\n // if (localToWGS==null)\r\n // {\r\n // /* We cannot transform */\r\n // ASystem.assert(false,\"No datum transformation from \"+this+\" to WGS\");\r\n // }\r\n /* Transform from the WGS datum to the local datum */\r\n let localGeocentric: Coordinate = CRS.getWGS84_2D().toGeoCentric(source/*geographic*/);\r\n if (localToWGS != null) localToWGS.reverse(localGeocentric, localGeocentric);\r\n /* Does the transform work on the projected coordinates (like the OSTN02 grid correction)? */\r\n if ((localToWGS != null) && localToWGS.getSourceCRS().isProjected()) {\r\n /* We already have the result */\r\n return localGeocentric;\r\n }\r\n else {\r\n /* Convert from geocentric to local coordinates */\r\n let local: Coordinate = this.fromGeoCentric(localGeocentric);\r\n /* Restore the original Z (is this allowed??) <ISSUE> */\r\n local.setZ(source.getZ());\r\n /* Return the local coordinates */\r\n return local;\r\n }\r\n }\r\n\r\n /**\r\n * Convert from the WGS 84 (geographic 2D) coordinate system to this coordinate system.\r\n * @param source the coordinates in the WGS 84 coordinate system, where x is longitude(-180..+180), y is latitude(-90..+90) and z is height.\r\n * @return the coordinates in this CRS (the z height is the same as the WGS height).\r\n */\r\n public fromWGS(source: Coordinate): Coordinate {\r\n return this.fromWGSi(source, -1);\r\n }\r\n\r\n /**\r\n * Check if another CRS is compatible with this one.\r\n * @param other the other CRS.\r\n * @return true if compatible.\r\n */\r\n public isCompatible(other: CRS): boolean {\r\n /* Check the base parameters */\r\n if (other._code == this._code) return true;\r\n if (other._type != this._type) return false;\r\n if (other._csCode != this._csCode) return false;\r\n /* Geographic? */\r\n if (this.isGeoCentric() || this.isGeoGraphic()) {\r\n /* Same datum? */\r\n if (Datum.areCompatible(other.getDatum(), this.getDatum()) == false) return false;\r\n /* We need the same transformation to WGS (check CRS 2039 for example: wgs compatible datum, but with geocentric translation to wgs) */\r\n if (Operation.isCompatibleOperation(other.getTransformationToWGS(), this.getTransformationToWGS()) == false) return false;\r\n return true;\r\n }\r\n /* Projected? */\r\n else if (this.isProjected()) {\r\n /* Same projection? */\r\n if (Operation.isCompatibleOperation(other._projection, this._projection) == false) return false;\r\n /* Has base CRS? */\r\n if (other._baseCRS == null || this._baseCRS == null) return false;\r\n /* Same base? */\r\n return (other._baseCRS.isCompatible(this._baseCRS));\r\n }\r\n /* Vertical? */\r\n else if (this.isVertical()) {\r\n /* Same datum? */\r\n if (Datum.areCompatible(other.getDatum(), this.getDatum()) == false) return false;\r\n return true;\r\n }\r\n /* Compound? */\r\n else if (this.isCompound()) {\r\n /* Same components? */\r\n if (CRS.areCompatible(other._horizontalComponent, this._horizontalComponent) == false) return false;\r\n if (CRS.areCompatible(other._verticalComponent, this._verticalComponent) == false) return false;\r\n return true;\r\n }\r\n /* Other */\r\n else {\r\n return false;\r\n }\r\n }\r\n\r\n /**\r\n * Check if two CRSs are compatible.\r\n * @param crs1 the first CRS.\r\n * @param crs2 the second CRS.\r\n * @return true if compatible.\r\n */\r\n public static areCompatible(crs1: CRS, crs2: CRS): boolean {\r\n if (crs1 == null) return (crs2 == null);\r\n if (crs2 == null) return false;\r\n return crs1.isCompatible(crs2);\r\n }\r\n\r\n /**\r\n * Get the text form of the CRS.\r\n * @return the text form of the CRS.\r\n */\r\n public getTextForm(): string {\r\n return this._textForm;\r\n }\r\n\r\n /**\r\n * Set the text form of the CRS.\r\n * @param textForm the text form of the CRS.\r\n */\r\n public setTextForm(textForm: string): void {\r\n this._textForm = textForm;\r\n }\r\n\r\n\t/**\r\n\t * Get the access time.\r\n\t * @return the access time.\r\n\t */\r\n public getAccessTime(): float64 {\r\n return this._accessTime;\r\n }\r\n\r\n\t/**\r\n\t * Set the access time.\r\n\t * @param time the access time.\r\n\t */\r\n public setAccessTime(time: float64): void {\r\n this._accessTime = time;\r\n }\r\n\r\n /**\r\n * The standard toString method.\r\n * @see Object#toString\r\n */\r\n public toString(): string {\r\n return \"[CRS:code=\" + this._code + \",name='\" + this._name + \"',area=\" + this._area + \",type='\" + CRS.labelCRSType(this._type) + \"',datum=\" + this._datum + \",baseCRS=\" + this._baseCRS + \",wgs-transform=\" + (this._transformationToWGS != null) + \"]\";\r\n }\r\n\r\n /**\r\n * Get the type of a CRS.\r\n * @param crsKind the type of CRS.\r\n * @return a parsed type.\r\n */\r\n public static parseCRSType(crsKind: string): int32 {\r\n if (Strings.equalsIgnoreCase(crsKind, \"compound\")) return CRS.COMPOUND;\r\n if (Strings.equalsIgnoreCase(crsKind, \"engineering\")) return CRS.ENGINEERING;\r\n if (Strings.equalsIgnoreCase(crsKind, \"geocentric\")) return CRS.GEOCENTRIC;\r\n if (Strings.equalsIgnoreCase(crsKind, \"geographic 2D\")) return CRS.GEOGRAPHIC_2D;\r\n if (Strings.equalsIgnoreCase(crsKind, \"geographic 3D\")) return CRS.GEOGRAPHIC_3D;\r\n if (Strings.equalsIgnoreCase(crsKind, \"projected\")) return CRS.PROJECTED;\r\n if (Strings.equalsIgnoreCase(crsKind, \"vertical\")) return CRS.VERTICAL;\r\n ASystem.assert0(false, \"CRS kind '\" + crsKind + \"' not found\");\r\n return 0;\r\n }\r\n\r\n /**\r\n * Get the label of a type of a CRS.\r\n * @param crsType the type of CRS.\r\n * @return a label.\r\n */\r\n public static labelCRSType(crsType: int32): string {\r\n if (crsType == CRS.COMPOUND) return \"compound\";\r\n if (crsType == CRS.ENGINEERING) return \"engineering\";\r\n if (crsType == CRS.GEOCENTRIC) return \"geocentric\";\r\n if (crsType == CRS.GEOGRAPHIC_2D) return \"geographic 2D\";\r\n if (crsType == CRS.GEOGRAPHIC_3D) return \"geographic 3D\";\r\n if (crsType == CRS.PROJECTED) return \"projected\";\r\n if (crsType == CRS.VERTICAL) return \"vertical\";\r\n ASystem.assert0(false, \"CRS type '\" + crsType + \"' not found\");\r\n return null;\r\n }\r\n}\r\n"]}
|
|
@@ -321,7 +321,7 @@ class CoordinateSystem {
|
|
|
321
321
|
local.setZ(this.getStandardCoordinate(x, y, z, this._axes.get(2), 3));
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
|
+
exports.CoordinateSystem = CoordinateSystem;
|
|
324
325
|
/** The name of this module */
|
|
325
326
|
CoordinateSystem.MODULE = "CoordinateSystem";
|
|
326
|
-
exports.CoordinateSystem = CoordinateSystem;
|
|
327
327
|
//# sourceMappingURL=CoordinateSystem.js.map
|