CutFillVolume 填挖方分析
简介
填挖方分析用于计算在地形改造中某区域内需要挖除或填充的土方体积(基于基准面下凹部分填充,上凸部分挖除)。在 Cesium 中,可通过选定区域并设定设计高程,快速分析地形起伏带来的方量变化,常用于道路修建、场地平整、工程造价估算等场景,辅助工程设计与施工决策。
演练场
引入
ts
import { CutFillVolume } from "@m-tech/gis-core";
new CutFillVolume(viewer, options);参数
| 参数名 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
viewer | Viewer | 是 | - | 容器 |
options | Object | 是 | {} | 填挖方分析配置 |
options.positions | Position[] | 是 | [] | 填挖方范围 |
options.baseHeight | number | 是 | 0 | 基准面高度 |
options.terrainProvider | TerrainProvider | 否 | viewer.terrainProvider | 地形提供者 |
options.accuracy | number | 否 | 1000 | 精度 |
属性
| 属性名 | 类型 | 读/写 | 描述 |
|---|---|---|---|
cutVolume | number | 读 | 挖方量(m³) |
fillVolume | number | 读 | 填方量(m³) |
baseHeight | number | 读写 | 基准面高度 |
accuracy | number | 读写 | 精度 |
方法
clear()
清除填挖方分析。
示例
ts
import { CutFillVolume } from "@m-tech/gis-core";
// 创建填挖方分析
const cutFillVolume = new CutFillVolume(viewer, {
positions: [
new Position(114.31, 30.57),
new Position(114.32, 30.58),
new Position(114.33, 30.59),
],
baseHeight: 100,
accuracy: 1000,
});
// 调整基准面高度
cutFillVolume.baseHeight = 80;
// 调整精度
cutFillVolume.accuracy = 500;
// 获取挖方量
console.log(cutFillVolume.cutVolume);
// 获取填方量
console.log(cutFillVolume.fillVolume);
// 清除填挖方分析
cutFillVolume.clear();