Class: QuantizedMeshTerrainData

QuantizedMeshTerrainData

new QuantizedMeshTerrainData()

The terrain data of a single tile is represented in a quantified grid format. The quantization grid contains three vertex attributes: longitude, latitude, and altitude, all of which are represented by 16 integer values ranging from 0 to 32767. Longitude and latitude are 0 at the southwest corner and 32767 at the northeast corner of the tile; The height inside the tile is 0 at the lowest point and 32767 at the highest point.

Name Type Default Description
options.quantizedVertices Uint16Array

A buffer containing quantized grids.

options.indices Uint16Array | Uint32Array

Specify how the quantified vertices are linked to the index of the triangle. Every three indices specify a triangle.

options.minimumHeight Number

The minimum terrain height within a tile, measured in meters above an ellipsoid.

options.maximumHeight Number

The maximum terrain height inside the tile, measured in meters above the ellipsoid.

options.boundingSphere BoundingSphere

The sphere that surrounds all vertices in the mesh.

options.orientedBoundingBox OrientedBoundingBox optional

An orientedBoundingBox surrounds all vertices in the mesh.

options.horizonOcclusionPoint Cartesian3

Horizontal occlusion points of the grid. If the point is below the horizon, it is assumed that the entire tile is also below the horizon. This point is represented by ellipsoidal coordinates.

options.westIndices Array.<Number>

Index of the vertices on the west edge of the tile.

options.southIndices Array.<Number>

Index of the vertices on the south edge of the tile.

options.eastIndices Array.<Number>

Index of the vertices on the east edge of the tile.

options.northIndices Array.<Number>

Index of the vertices on the north edge of the tile.

options.westSkirtHeight Number

Add to the skirt height on the west side of the tile.

options.southSkirtHeight Number

Add to the skirt height on the south side of the tile.

options.eastSkirtHeight Number

Add to the skirt height on the east side of the tile.

options.northSkirtHeight Number

Add to the skirt height on the north side of the tile.

options.childTileMask Number 15 optional

A bit mask indicating which of the four sub items of this tile exists. If a sub level is set, geometric shapes will also be requested for the block when needed. If this bit is cleared, the child tile is not requested, but the geometry is sampled from the parent tile. The bit values are as follows:

Position of positionBit valueSub level tiles
01西南
12东南
24西北
38东北

options.createdByUpsampling Boolean false optional

If this instance was created by upsampling another instance, it is true; Otherwise, it is false. otherwise, false.

options.encodedNormals Uint8Array optional

A buffer containing normals for each vertex, encoded using 'oct' encoding.

options.waterMask Uint8Array optional

A buffer zone containing a water mask.

options.credits Array.<Credit> optional

The copyright statement for this tile.

See:
Example
var data = new SuperMap3D.QuantizedMeshTerrainData({
    minimumHeight : -100,
    maximumHeight : 2101,
    quantizedVertices : new Uint16Array([// order is SW NW SE NE
                                         // longitude
                                         0, 0, 32767, 32767,
                                         // latitude
                                         0, 32767, 0, 32767,
                                         // heights
                                         16384, 0, 32767, 16384]),
    indices : new Uint16Array([0, 3, 1,
                               0, 2, 3]),
    boundingSphere : new SuperMap3D.BoundingSphere(new SuperMap3D.Cartesian3(1.0, 2.0, 3.0), 10000),
    orientedBoundingBox : new SuperMap3D.OrientedBoundingBox(new SuperMap3D.Cartesian3(1.0, 2.0, 3.0), SuperMap3D.Matrix3.fromRotationX(SuperMap3D.Math.PI, new SuperMap3D.Matrix3())),
    horizonOcclusionPoint : new SuperMap3D.Cartesian3(3.0, 2.0, 1.0),
    westIndices : [0, 1],
    southIndices : [0, 1],
    eastIndices : [2, 3],
    northIndices : [1, 3],
    westSkirtHeight : 1.0,
    southSkirtHeight : 1.0,
    eastSkirtHeight : 1.0,
    northSkirtHeight : 1.0
});

Members

creditsArray.<Credit>

The copyright statement for this tile.

waterMaskUint8Array Image Canvas

The water surface mask data included in this terrain data. The water surface mask data is a rectangular Uint8Array or image, where 255 represents water and 0 represents land. Values between 0 and 255 also allow for smooth mixing between land and water

Methods

interpolateHeight(rectangle, longitude, latitude){Number}

Calculate the terrain height at the specified latitude and longitude.

Name Type Description
rectangle Rectangle

The rectangular range covered by the terrain data.

longitude Number

Longitude, measured in radians.

latitude Number

Latitude, measured in radians.

Returns:
Type Description
Number The terrain height at the specified location. The position is sandwiched within the rectangle, so if the position is far outside the rectangle, the result may be incorrect.

isChildAvailable(thisX, thisY, childX, childY){Boolean}

Determine whether the given sub terrain map is available based on HeightmapTerrainData.childTileMask. The given sub topographic map coordinates are assumed to be one of the four sub topographic maps of the topographic map. If non sub topographic map coordinates are given, return the availability of sub topographic maps in the southeast direction.

Name Type Description
thisX Number

The X coordinate of this tile (parent tile).

thisY Number

The Y coordinate of this tile (parent tile).

childX Number

Check if the X coordinate of the sub tile to be checked is available.

childY Number

Check if the Y coordinate of the sub tile to be checked is available.

Returns:
Type Description
Boolean If sub tiles are available, return true; Otherwise, return false.

upsample(tilingScheme, thisX, thisY, thisLevel, descendantX, descendantY, descendantLevel){Promise.<QuantizedMeshTerrainData>|undefined}

High sampling of terrain data for use by sub level tiles. The generated instance will contain a subset of the vertices in this instance, and interpolation will be performed if necessary.

Name Type Description
tilingScheme TilingScheme

The slicing scheme for the terrain data.

thisX Number

The X-coordinate of the tile in the slicing scheme.

thisY Number

The Y coordinate of the tile in the slicing scheme.

thisLevel Number

The level of the tile in the tile slicing scheme.

descendantX Number

We need to perform high sampling on the X-coordinate of the sub level tiles in the slicing scheme.

descendantY Number

We need to perform high sampling on the Y coordinate of the sub level tiles in the slicing scheme.

descendantLevel Number

We need to perform high sampling on the sub level tiles in the slicing scheme.

Returns:
Type Description
Promise.<QuantizedMeshTerrainData> | undefined Promise for high sampling height map terrain data of sub level tiles; If there are too many asynchronous high sampling operations in progress and the request is delayed, it is undefined.

wasCreatedByUpsampling(){Boolean}

Get a value indicating whether the terrain data was created from high sampling low resolution terrain data. If the value is false, it indicates that the data was obtained from another source, such as downloading from a remote server. For instances returned by calling HeightmapTerrainData # upsample, this method should return true.

Returns:
Type Description
Boolean If the instance was created through high sampling, it is true; Otherwise, it is false.