new Cesium.HeightmapTerrainData(options)

地形数据以高度图表示的单一瓦片的地形数据。 高度图 是由北向南和西向东排列的长方形高程.
Name Type Description
options object 下列属性的对象 :
Name Type Default Description
buffer Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array 包含高度数据的缓冲器.
width number 高度图的宽度(经度方向),在样本中.
height number 高度图的高度(纬度方向),在样本中.
childTileMask number 15 optional 一个小面具,表示这瓷砖的四个孩子中哪一个存在. 如果设定了孩子的位数, 将会要求该瓦片的几何以及当它 需要帮助。 如果比特被清除,则不要求使用孩子的瓦片和几何形状 而不是从父母那里做样本。 位值如下: ============================================================================================================================================================================ -NT############################################################################################################################################################################################################################################################# NT+0+NT+1+1+NT+2+NT+3+2+NT+4+NT+5+5+东南+NT+6+NT+7+ -NT############################################################################################################################################################################################################################################################# ~NT+0+NT+1+3+NT+2+NT+3+8+NT+4+NT+5+5+东北 NT+6+NT+7+
waterMask Uint8Array optional 包括在这个地形数据中的水面具,如果有的话。 水面罩是方块 Uint8 箭头或图像,其中值为 255 表示水,值为 0 表示土地. 0至255之间的数值也能够顺利地混合土地和水.
structure object optional 描述高度数据结构的天体.
Name Type Default Description
heightScale number 1.0 optional 为获得高度样品而乘以高度样品的系数 高度高于高度,以米计。 在结果中添加高度 乘积后高度.
heightOffset number 0.0 optional 乘以增加缩放高度以获得最终 高度以米计。 高度样本乘以 heightScale.
elementsPerHeight number 1 optional The number of elements in the buffer that make up a single height 样本。 这通常是1,表示每个元素都是单独的高度样本. 若为 它大于1, 元素数加在一起构成高度样本,即 根据 NT 0 和 NT 1 属性计算.
stride number 1 optional The number of elements to skip to get from the first element of 一个高度到下一个高度的第一个元素.
elementMultiplier number 256.0 optional The multiplier used to compute the height value when the 踩踏财产大于1. 例如,如果脚步是4,脚步是多步 256,高度计算如下: `height = buffer[index] + buffer[index + 1] * 256 + buffer[index + 2] * 256 * 256 + buffer[index + 3] * 256 * 256 * 256` 这是假设BigEndian的财产是假的。 如果这是真的,命令 元素被反转.
isBigEndian boolean false optional Indicates endianness of the elements in the buffer when the 踩踏财产大于1. 如果此属性是虚假的, 第一个元素是 低序元素 。 如果是真的,第一个元素是高序元素.
lowestEncodedHeight number optional 可存储在高度缓冲器中的最低值. 任何低点 than this value after encoding with the `heightScale` and `heightOffset` are clamped to this value. For example, if the height 缓冲器是 `Uint16Array` , 此值应为 0, 因为 `Uint16Array` 无法存储负数 。 如果此参数是 未指定,没有执行最小值.
highestEncodedHeight number optional 最高值可以存储在高度缓冲中. 任何高点 than this value after encoding with the `heightScale` and `heightOffset` are clamped to this value. For example, if the height 缓冲器是 `Uint16Array` ,此值应为 `256 * 256 - 1` 或65535,因为 `Uint16Array` 不能存储更大的数字 超过65535. 如果未指定此参数,则不强制执行最大值 .
encoding HeightmapEncoding HeightmapEncoding.NONE optional The encoding that is used on the buffer.
createdByUpsampling boolean false optional True if this instance was created by upsampling another instance; otherwise, false.
Example:
const buffer = ...
const heightBuffer = new Uint16Array(buffer, 0, that._heightmapWidth * that._heightmapWidth);
const childTileMask = new Uint8Array(buffer, heightBuffer.byteLength, 1)[0];
const waterMask = new Uint8Array(buffer, heightBuffer.byteLength + 1, buffer.byteLength - heightBuffer.byteLength - 1);
const terrainData = new Cesium.HeightmapTerrainData({
  buffer : heightBuffer,
  width : 65,
  height : 65,
  childTileMask : childTileMask,
  waterMask : waterMask
});
See:

Members

credits : Array.<Credit>

此牌的记分数列 .

waterMask : Uint8Array|HTMLImageElement|HTMLCanvasElement|ImageBitmap|undefined

包括在这个地形数据中的水面具,如果有的话。 水面罩是方块 Uint8 箭头或图像,其中值为 255 表示水,值为 0 表示土地. 0至255之间的数值也能够顺利地混合土地和水.

Methods

interpolateHeight(rectangle, longitude, latitude)number

计算特定经度和纬度的地形高度.
Name Type Description
rectangle Rectangle 此地形数据覆盖的矩形.
longitude number 弧度的经度.
latitude number 弧度的纬度.
Returns:
指定位置的地形高度. 如果职位 在矩形之外,这种方法将推断出高度,这很可能是疯狂的 对矩形以外的位置不正确.

isChildAvailable(thisX, thisY, childX, childY)boolean

确定是否可以根据 HeightmapTerrainData.childTileMask. The given child tile coordinates are assumed 成为这瓷砖的四个孩子之一 如果非孩子的砖块坐标是 如果有的话,则归还东南地区儿童瓷砖.
Name Type Description
thisX number 此( 母) 瓦片的 X 坐标 .
thisY number 此( 母) 瓦的 Y 坐标 .
childX number 儿童瓷砖的瓦片X坐标以检查可用性.
childY number 儿童瓷砖的Y瓦坐标以检查是否有可用.
Returns:
如果有孩子的瓷砖,则属实;否则,为假.

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

上标此地形数据,供后代瓷砖使用. 由此产生的实例将包含一个子集 这种情况下的高度样本,必要时内插.
Name Type Description
tilingScheme TilingScheme 地形数据图案.
thisX number X 协调这个平板图中的砖块.
thisY number T图中的此瓦的Y坐标.
thisLevel number 这种瓦片在平板图中的级别.
descendantX number X在我们正在取样的后裔瓷砖的平底图中进行协调.
descendantY number Y在我们所调查的后代瓷砖的平板图中进行协调.
descendantLevel number 我们所调查的后裔瓦片的平底图中的水平.
Returns:
对高地图数据进行抽样检测的承诺, 如果没有网格,则未定义.

wasCreatedByUpsampling()boolean

获得一个数值,显示此地形数据是否通过对下分辨率进行抽样创建 地形数据。 如果该值不正确,则数据来自其他来源,例如: 如从远程服务器下载。 此方法对于实例应返回真实值 returned from a call to HeightmapTerrainData#upsample.
Returns:
如果这个实例是通过抽样创建的,否则就是虚假的.
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.