问题描述
数据量大,cesiumlab 导入时间久,容易报错,内存不够等问题
1、数据处理
数据是shp 文件,根据高度属性进行拉伸
postgres for shape 进行数据导入
sql
---2d 转3d 数据
CREATE TABLE sc_3d AS
SELECT
gid,
ST_Force3D(geom, height) as geom,
quality,
height,
age
FROM sc2
WHERE geom IS NOT NULL;
--- 根据属性拉伸建筑物
UPDATE sc_3d2
SET geom = ST_Multi ( ST_CollectionExtract ( ST_Extrude ( geom, -- 3D轮廓
0, 0, height -- 沿Z轴拉伸总高度
),3 ) )
WHERE
geom IS NOT NULL;
-- 拉伸插件引入
CREATE EXTENSION postgis_sfcgal;
SELECT postgis_sfcgal_version();
2、pg2b3dm 生成数据3dtiles
下载转换工具
https://github.com/Geodan/pg2b3dm/releases
执行代码
pg2b3dm -h localhost -U postgres -c geom -d postgres -t test_3d2 -o data2
3、结果
