Class: TerrainData

TerrainData

new TerrainData()

Terrain data for a single tile.

See:

Members

creditsArray.<Credit>

The copyright statement for this tile.

waterMaskUint8Array Image Canvas

The water mask data included in the terrain data (if any). The water mask is a rectangular Uint8Array or image, where the value of 255 represents the water area and the value of 0 represents the land. It is also allowed to use values between 0 and 255 to smoothly mix 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 area 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. If the position is not within the rectangular range, this method will calculate the height. For positions far outside the rectangle, the estimated height is likely to vary greatly.

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

Determine whether the given child tile is available based on TerrainData # childTileMask. Assuming the given sub tile coordinates are one of the four sub tiles of this tile. If non sub tile coordinates are given, return the availability of the southeast sub tile.

Name Type Description
thisX Number

The X coordinate of the tile (parent tile).

thisY Number

The Y coordinate of the tile (parent tile).

childX Number

Check the X coordinate of the available sub tiles.

childY Number

Check the Y coordinate of the available sub tiles.

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

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

High sampling of terrain data for use by sub tiles.

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 slicing scheme.

descendantX Number

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

descendantY Number

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

descendantLevel Number

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

Returns:
Type Description
Promise.<TerrainData> | undefined Promise to provide high sampling terrain data for sub tiles, undefined if too many asynchronous loading operations are in progress and requests are delayed.

wasCreatedByUpsampling(){Boolean}

Get a value indicating whether this terrain data was created from high sampling low resolution terrain data. If this value is false, then the data was obtained from another source, such as downloading from a remote server. For the instance returned by calling TerrainData # 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.