Class: QgsCesiumUtils

Contains utilities for working with Cesium data.

Added in version 3.34.

List of all members, including inherited members

Classes

B3DMContents

Encapsulates the contents of a B3DM file.

TileContents

Encapsulates the contents of a 3D tile.

Static Methods

extractGltfFromB3dm

Extracts GLTF binary data and other contents from the legacy b3dm (Batched 3D Model) tile format.

extractGltfFromTileContent

Parses tile content.

extractTileContent

Parses tile content and returns a list of TileContents.

parseBox

Parses a box object from a Cesium JSON document to an oriented bounding box.

parseRegion

Parses a region object from a Cesium JSON document to a 3D box.

parseSphere

Parses a sphere object from a Cesium JSON document.

transformSphere

Applies a transform to a sphere.

class qgis.core.QgsCesiumUtils[source]

Bases: object

class B3DMContents

Bases: object

Encapsulates the contents of a B3DM file.

gltf: QByteArray
rtcCenter: QgsVector3D
class TileContents

Bases: object

Encapsulates the contents of a 3D tile.

gltf: QByteArray
rtcCenter: QgsVector3D
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:

QgsCesiumUtils.B3DMContents

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:

QgsCesiumUtils.TileContents

static extractTileContent(tileContent: QByteArray | bytes | bytearray | memoryview) 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:

tileContent (Union[QByteArray, bytes, bytearray, memoryview])

Return type:

list[QgsCesiumUtils.TileContents]

static parseBox(box: Iterable[Any]) QgsOrientedBox3D[source]

Parses a box object from a Cesium JSON document to an oriented bounding box.

Parameters:

box (Iterable[Any])

Return type:

QgsOrientedBox3D

static parseRegion(region: Iterable[Any]) QgsBox3D[source]

Parses a region object from a Cesium JSON document to a 3D box.

Parameters:

region (Iterable[Any])

Return type:

QgsBox3D

static parseSphere(sphere: Iterable[Any]) QgsSphere[source]

Parses a sphere object from a Cesium JSON document.

Parameters:

sphere (Iterable[Any])

Return type:

QgsSphere

static transformSphere(sphere: QgsSphere, transform: QgsMatrix4x4) QgsSphere[source]

Applies a transform to a sphere.

Parameters:
Return type:

QgsSphere