淹没分析是指根据指定的最大、最小高程值及淹没速度,动态模拟某区域水位由最小高程涨到最大高程的淹没过程,是GIS分析中常用的功能,常用于模拟洪涝灾害过程。在SuperMap的三维产品中淹没分析是通过分层设色的方式实现,以空间高度为强度值,在不同的高度设置不同的颜色,动态修改覆盖颜色的高度,实现淹没过程动态模拟。
下面来看实现过程。
一、设置颜色表
var colorTable = new Cesium.ColorTable();
function setColorTable(colorTable, key) {
switch (key) {
case "1":
colorTable.insert(71, new Cesium.Color(0, 39/255, 148/255));
colorTable.insert(0, new Cesium.Color(149/255, 232/255, 249/255));
break;
case "2":
colorTable.insert(71, new Cesium.Color(162/255, 251/255, 194/255));
colorTable.insert(0, new Cesium.Color(1, 103/255, 103/255));
break;
case "3":
colorTable.insert(71, new Cesium.Color(230/255, 198/255, 1));
colorTable.insert(0, new Cesium.Color(157/255, 0, 1));
break;
case "4&