Cesium加载.shp三维城市建筑模型,并根据3DTiles建筑物高度修改颜色

27 篇文章 16 订阅
25 篇文章 2 订阅

1、Cesium官网例子(纽约)

https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/?src=3D%20Tiles%20Feature%20Styling.html

2、加载.shp格式建筑模型

首先将.shp文件转换成Cesium可以加载的文件格式

方法1:参考我的博客转换为3dtiles         推荐一款专为Cesium开源数字地球平台打造的免费数据处理工具集

方法2:转换为Json https://blog.csdn.net/baidu_34304646/article/details/78076900

cesium中加载3dtiles方式如下:

var tj =viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
		name: "qxmodel",
		url: '../../data/tj/tileset.json',
	
		maximumScreenSpaceError: isMobile.any() ? 8 : 1, // Temporary workaround for low memory mobile devices - Increase maximum error to 8.
		maximumNumberOfLoadedTiles: isMobile.any() ? 10 : 1000 // Temporary workaround for low memory mobile devices - Decrease (disable) tile cache.
	}));

tj.style = new Cesium.Cesium3DTileStyle({
			color: {
				conditions: [
					['${floor} >= 300', 'rgba(45, 0, 75, 0.5)'],
					['${floor} >= 200', 'rgb(102, 71, 151)'],
					['${floor} >= 100', 'rgb(170, 162, 204)'],
					['${floor} >= 50', 'rgb(224, 226, 238)'],
					['${floor} >= 25', 'rgb(252, 230, 200)'],
					['${floor} >= 10', 'rgb(248, 176, 87)'],
					['${floor} >= 5', 'rgb(198, 106, 11)'],
					['true', 'rgb(127, 59, 8)']
				]
			}
		});

  • 1
    点赞
  • 36
    收藏
    觉得还不错? 一键收藏
  • 11
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 11
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值