Class: QgsCesiumUtils¶
Contains utilities for working with Cesium data.
Added in version 3.34.
List of all members, including inherited members
Classes
Encapsulates the contents of a B3DM file. |
|
Encapsulates the contents of a 3D tile. |
Static Methods
Copies any query items from the base URL to the content URI - to replicate undocumented Cesium JS behavior that is used at least by Google Tiles. |
|
Calculates oriented bounding box in EPSG:4978 from "region" defined with min/max lat/lon coordinates in EPSG:4978. |
|
Extracts GLTF binary data and other contents from the legacy b3dm (Batched 3D Model) tile format. |
|
Parses tile content. |
|
Parses tile content and returns a list of TileContents. |
|
Parses a box object from a Cesium JSON document to an oriented bounding box. |
|
Parses a region object from a Cesium JSON document to a 3D box. |
|
Parses a sphere object from a Cesium JSON document. |
|
Applies a transform to a sphere. |
- class qgis.core.QgsCesiumUtils[source]¶
Bases:
object- class B3DMContents¶
Bases:
objectEncapsulates the contents of a B3DM file.
- gltf: QByteArray¶
- rtcCenter: QgsVector3D¶
- class TileContents¶
Bases:
objectEncapsulates the contents of a 3D tile.
- gltf: QByteArray¶
- rtcCenter: QgsVector3D¶
- static appendQueryFromBaseUrl(contentUri: str | None, baseUrl: QUrl) str[source]¶
Copies any query items from the base URL to the content URI - to replicate undocumented Cesium JS behavior that is used at least by Google Tiles.
Note
added in QGIS 4.2
- Parameters:
contentUri (Optional[str])
baseUrl (QUrl)
- Return type:
str
- static boundingVolumeFromRegion(region: QgsBox3D, transformContext: QgsCoordinateTransformContext) QgsTiledSceneBoundingVolume[source]¶
Calculates oriented bounding box in EPSG:4978 from “region” defined with min/max lat/lon coordinates in EPSG:4978.
Note
added in QGIS 4.2
- Parameters:
region (QgsBox3D)
transformContext (QgsCoordinateTransformContext)
- Return type:
- static extractGltfFromB3dm(tileContent: QByteArray | bytes | bytearray | memoryview) QgsCesiumUtils.B3DMContents[source]¶
Extracts GLTF binary data and other contents from the legacy b3dm (Batched 3D Model) tile format. Returns empty byte array on error.
- Parameters:
tileContent (Union[QByteArray, bytes, bytearray, memoryview])
- Return type:
- static extractGltfFromTileContent(tileContent: QByteArray | bytes | bytearray | memoryview) QgsCesiumUtils.TileContents[source]¶
Parses tile content. Returns empty byte array on error.
Note
cmpt, pnts, i3dm tile types are currently not supported
Deprecated since version 4.2: : use
extractTileContent()which can handle composite tiles as well.- Parameters:
tileContent (Union[QByteArray, bytes, bytearray, memoryview])
- Return type:
- static extractTileContent(tileContent: QByteArray | bytes | bytearray | memoryview, baseUri: str | None = '') list[QgsCesiumUtils.TileContents]¶
Parses tile content and returns a list of TileContents.
For b3dm and glTF tiles, the returned list will contain a single entry. For cmpt (composite) tiles, the returned list will contain one entry per inner tile that could be successfully parsed. Returns an empty list on error or for unsupported tile types (pnts, i3dm).
Added in version 4.2.
- Parameters:
- Return type:
- static parseBox(box: Iterable[Any]) QgsOrientedBox3D[source]¶
Parses a
boxobject from a Cesium JSON document to an oriented bounding box.- Parameters:
box (Iterable[Any])
- Return type:
- static parseRegion(region: Iterable[Any]) QgsBox3D[source]¶
Parses a
regionobject from a Cesium JSON document to a 3D box.
- static parseSphere(sphere: Iterable[Any]) QgsSphere[source]¶
Parses a
sphereobject from a Cesium JSON document.
- static transformSphere(sphere: QgsSphere, transform: QgsMatrix4x4) QgsSphere[source]¶
Applies a
transformto a sphere.- Parameters:
sphere (QgsSphere)
transform (QgsMatrix4x4)
- Return type: