Encode and decode

This module provides high level utility functions to encode and decode a terrain tile.

Reference

quantized_mesh_tile.__init__.decode(filePath, bounds, hasLighting=False, hasWatermask=False, gzipped=False)[source]

Function to convert a quantized-mesh terrain tile file into a quantized_mesh_tile.terrain.TerrainTile instance.

Arguments:

filePath

An absolute or relative path to write the terrain tile. (Required)

bounds

The bounds of the terrain tile. (west, south, east, north) (Required).

hasLighting (Experimental)

Indicate whether the tile has the lighting extension.

Default is False.

hasWatermask

Indicate whether the tile has the water-mask extension.

Default is False.

quantized_mesh_tile.__init__.encode(geometries, bounds=[], autocorrectGeometries=False, hasLighting=False, watermask=[])[source]

Function to convert geometries into a quantized_mesh_tile.terrain.TerrainTile instance.

Arguments:

geometries

A list of shapely polygon geometries representing 3 dimensional triangles. or A list of WKT or WKB Polygons representing 3 dimensional triangles. or A list of triplet of vertices using the following structure: (((lon0/lat0/height0),(...),(lon2,lat2,height2)),(...))

bounds

The bounds of the terrain tile. (west, south, east, north) If not defined, the bounds will be computed from the provided geometries.

Default is [].

autocorrectGeometries

When set to True, it will attempt to fix geometries that are not triangles. This often happens when geometries are clipped from an existing mesh.

Default is False.

hasLighting (Experimental)

Indicate whether unit vectors should be computed for the lighting extension.

Default is False.

watermask

A water mask list (Optional). Adds rendering water effect. The water mask list is either one byte, [0] for land and [255] for water, either a list of 256*256 values ranging from 0 to 255. Values in the mask are defined from north-to-south and west-to-east. Per default no watermask is applied. Note that the water mask effect depends on the texture of the raster layer drapped over your terrain.

Default is [].