麻辣GIS微信平台

更多 GIS 干货

微信关注不错过

Cesium API - TerrainData 中文文档

本文介绍下Cesium中 TerrainData API的详细使用说明。

TerrainData API 调用方法

new Cesium.TerrainData()
单个瓦片的地形数据。 此类型描述一个接口,不打算直接实例化。
参考:

成员变量

credits : Array.<Credit>
这个瓦片的一个credits数组。
waterMask : Uint8Array|Image|Canvas
包含在地形数据中的water mask,如果有的话。 Water mask是一个矩形Uint8Array或图像,其中值为255表示水,值为0表示陆地。 0到255之间的值也可以平滑地(smoothly)混合在陆地和水之间。

内置方法

interpolateHeight(rectangle, longitude, latitude)Number
计算指定经度和纬度处的地形高度。
Name Type Description
rectangle Rectangle The rectangle covered by this terrain data.
longitude Number 经度(以弧度为单位)
latitude Number 纬度(以弧度为单位)
返回值:
指定位置的地形高度。 If the position is outside the rectangle, this method will extrapolate the height, which is likely to be wildly incorrect for positions far outside the rectangle.
isChildAvailable(thisX, thisY, childX, childY)Boolean
Determines if a given child tile is available, based on the TerrainData#childTileMask. The given child tile coordinates are assumed to be one of the four children of this tile. If non-child tile coordinates are given, the availability of the southeast child tile is returned.
Name Type Description
thisX Number The tile X coordinate of this (the parent) tile.
thisY Number The tile Y coordinate of this (the parent) tile.
childX Number The tile X coordinate of the child tile to check for availability.
childY Number The tile Y coordinate of the child tile to check for availability.
返回值:
True if the child tile is available; otherwise, false.
upsample(tilingScheme, thisX, thisY, thisLevel, descendantX, descendantY, descendantLevel)Promise.<TerrainData>|undefined
Upsamples this terrain data for use by a descendant tile.
Name Type Description
tilingScheme TilingScheme The tiling scheme of this terrain data.
thisX Number The X coordinate of this tile in the tiling scheme.
thisY Number The Y coordinate of this tile in the tiling scheme.
thisLevel Number The level of this tile in the tiling scheme.
descendantX Number The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.
descendantY Number The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.
descendantLevel Number The level within the tiling scheme of the descendant tile for which we are upsampling.
返回值:
A promise for upsampled terrain data for the descendant tile, or undefined if too many asynchronous upsample operations are in progress and the request has been deferred.
wasCreatedByUpsampling()Boolean
Gets a value indicating whether or not this terrain data was created by upsampling lower resolution terrain data. If this value is false, the data was obtained from some other source, such as by downloading it from a remote server. This method should return true for instances returned from a call to TerrainData#upsample.
返回值:
True if this instance was created by upsampling; otherwise, false.

其他API

Cesium中文API文档手册(v1.63.1版本)参考:《Cesium中文API文档手册(v1.63.1版本)

相关阅读

麻辣GIS-Sailor

作者:

GIS爱好者,学GIS,更爱玩GIS。

声明

1.本文所分享的所有需要用户下载使用的内容(包括但不限于软件、数据、图片)来自于网络或者麻辣GIS粉丝自行分享,版权归该下载资源的合法拥有者所有,如有侵权请第一时间联系本站删除。

2.下载内容仅限个人学习使用,请切勿用作商用等其他用途,否则后果自负。

手机阅读
公众号关注
知识星球
手机阅读
麻辣GIS微信公众号关注
最新GIS干货
关注麻辣GIS知识星球
私享圈子

留言板(小编看到第一时间回复)