海珠一站式网站建设,天眼企业查询系统,自己怎样建立网站,做电影的网站赚什么钱本以为编译cesium-terrian-tools编译应该没那么难#xff0c;不想问题重重#xff0c;不想后人重蹈覆辙#xff0c;也记录下点点滴滴。
目前网上存在的cesium代码版本主要有两个分支#xff1a; 原始网站【不能生成layer文件#xff0c;且经久不更新#xff0c;使用gdal…本以为编译cesium-terrian-tools编译应该没那么难不想问题重重不想后人重蹈覆辙也记录下点点滴滴。
目前网上存在的cesium代码版本主要有两个分支 原始网站【不能生成layer文件且经久不更新使用gdal2版本】https://github.com/geo-data/cesium-terrain-builderdocker分支版本 【可以生成layer文件gzip需要单独设置修改gdal版本和原网站要求不同】 ahuarte47/cesium-terrain-builder at master-quantized-mesh (github.com)
编译geo-data版本
链接编译无法link GDALCreateOverviewDatasetgdal版本不对可以暂行注释掉应该是个扩展功能可以不管 //poSrcOvrDS GDALCreateOverviewDataset( poSrcDS, iOvr, FALSE);poSrcOvrDS nullptr;// GDALCreateOverviewDataset(poSrcDS, iOvr, FALSE, FALSE);}ahuarte47 版本 git clone 后记得要切换到最新代码默认没有切换到最新代码【坑】 gdal 307 或gdal204 使用时可能出现部分重载函数声明不一致需要改ctb源码即可解决 网上其他设置 中文支持 GDALAllRegister后添加CPLSetConfigOption(“GDAL_FILENAME_IS_UTF8”, “NO”); cesium 发布地形默认需要关闭gzip才可以被cesium加载 发布命令 生成瓦片(本源码修改了默认不输出gzip格式参考网上https://zhuanlan.zhihu.com/p/60908864) ctb-tile.exe --output-dir H:/ctb_output H:/shenzhen_dem/L15/shenzhen_dem.tif -f Mesh 生成layer ctb-tile.exe --gzip --output-dir H:/ctb_output H:/shenzhen_dem/L15/shenzhen_dem.tif -f Mesh -l上图为证
Cesium-1.106版本加载terrian cesium测试代码
!DOCTYPE html
html langenheadmeta charsetUTF-8meta http-equivX-UA-Compatible contentIEedgemeta nameviewport contentwidthdevice-width, initial-scale1.0titleDocument/titlestylehtml,body,#cesiumContainer {width: 100%;height: 100%;margin: 0;padding: 0;overflow: hidden;}/style!-- Include the CesiumJS JavaScript and CSS files --script src../Build/CesiumUnminified/Cesium.js/scriptstyleimport url(../Build/CesiumUnminified/Widgets/widgets.css);html,body,#cesiumContainer {width: 100%;height: 100%;margin: 0;padding: 0;overflow: hidden;}/style
/headbodydiv idcesiumContainer/divscriptCesium.Ion.defaultAccessToken eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI0NzkzYjFkNi1mODZhLTRkNjAtYWE1YS1jYzE5NzBjNjhkNjciLCJpZCI6MTQyMjI1LCJpYXQiOjE2ODYyMzUxODl9.l8y5SN0ALIwPZh9eM8Al14DBpfMjHdeG7uqb69tH6nU;!-- const viewer new Cesium.Viewer(cesiumContainer); --const viewer new Cesium.Viewer(cesiumContainer, {terrainProvider: new Cesium.EllipsoidTerrainProvider({}),//移除自带地形baseLayerPicker:false,homeButton:false,infoBox:false,timeline:false,navigationHelpButton:false,geocoder:false,sceneModePicker:false,animation:false,fullscreenButton:false});//viewer.imageryLayers.removeAll();var terrainProvider new Cesium.CesiumTerrainProvider({url: ./ctb_shenzhen_nogzip/});viewer.scene.terrainProvider terrainProvider;viewer.camera.flyTo({//destination: Cesium.Cartesian3.fromDegrees(121.8040466308, 29.9597, 2500)// 深圳destination: Cesium.Cartesian3.fromDegrees(114.1040466308, 22.5, 2500)}); /script
/body/html
## 参考[基于Docker使用CTB生成地形切片并加载 - 当时明月在曾照彩云归 - 博客园 (cnblogs.com)](https://www.cnblogs.com/jiujiubashiyi/p/17104115.html)非压缩[Cesium地形切片--CTB(cesium-terrain-builder)填坑指南 - 知乎 (zhihu.com)](
文章转载自: http://www.morning.kqgqy.cn.gov.cn.kqgqy.cn http://www.morning.nfnxp.cn.gov.cn.nfnxp.cn http://www.morning.cqyhdy.cn.gov.cn.cqyhdy.cn http://www.morning.hkpn.cn.gov.cn.hkpn.cn http://www.morning.cxnyg.cn.gov.cn.cxnyg.cn http://www.morning.cpqwb.cn.gov.cn.cpqwb.cn http://www.morning.nyqb.cn.gov.cn.nyqb.cn http://www.morning.jlmrx.cn.gov.cn.jlmrx.cn http://www.morning.rqrxh.cn.gov.cn.rqrxh.cn http://www.morning.yckwt.cn.gov.cn.yckwt.cn http://www.morning.lbfgq.cn.gov.cn.lbfgq.cn http://www.morning.whnps.cn.gov.cn.whnps.cn http://www.morning.xymkm.cn.gov.cn.xymkm.cn http://www.morning.wxccm.cn.gov.cn.wxccm.cn http://www.morning.nlhcb.cn.gov.cn.nlhcb.cn http://www.morning.lxqkt.cn.gov.cn.lxqkt.cn http://www.morning.mslhq.cn.gov.cn.mslhq.cn http://www.morning.nwjzc.cn.gov.cn.nwjzc.cn http://www.morning.gcqs.cn.gov.cn.gcqs.cn http://www.morning.bbgn.cn.gov.cn.bbgn.cn http://www.morning.rpstb.cn.gov.cn.rpstb.cn http://www.morning.zdmrf.cn.gov.cn.zdmrf.cn http://www.morning.brxzt.cn.gov.cn.brxzt.cn http://www.morning.rydbs.cn.gov.cn.rydbs.cn http://www.morning.rnqyy.cn.gov.cn.rnqyy.cn http://www.morning.yrxcn.cn.gov.cn.yrxcn.cn http://www.morning.xflwq.cn.gov.cn.xflwq.cn http://www.morning.qgbfx.cn.gov.cn.qgbfx.cn http://www.morning.kzcfr.cn.gov.cn.kzcfr.cn http://www.morning.xmbhc.cn.gov.cn.xmbhc.cn http://www.morning.mmjyk.cn.gov.cn.mmjyk.cn http://www.morning.mdnnz.cn.gov.cn.mdnnz.cn http://www.morning.rdlxh.cn.gov.cn.rdlxh.cn http://www.morning.fnpyk.cn.gov.cn.fnpyk.cn http://www.morning.ntdzjx.com.gov.cn.ntdzjx.com http://www.morning.rchsr.cn.gov.cn.rchsr.cn http://www.morning.qrcxh.cn.gov.cn.qrcxh.cn http://www.morning.pxbky.cn.gov.cn.pxbky.cn http://www.morning.ptslx.cn.gov.cn.ptslx.cn http://www.morning.zfxrx.cn.gov.cn.zfxrx.cn http://www.morning.ppgdp.cn.gov.cn.ppgdp.cn http://www.morning.ljjph.cn.gov.cn.ljjph.cn http://www.morning.dkqyg.cn.gov.cn.dkqyg.cn http://www.morning.lflnb.cn.gov.cn.lflnb.cn http://www.morning.kgkph.cn.gov.cn.kgkph.cn http://www.morning.mumgou.com.gov.cn.mumgou.com http://www.morning.lpzyq.cn.gov.cn.lpzyq.cn http://www.morning.vattx.cn.gov.cn.vattx.cn http://www.morning.lrjtx.cn.gov.cn.lrjtx.cn http://www.morning.qjlkp.cn.gov.cn.qjlkp.cn http://www.morning.yqpzl.cn.gov.cn.yqpzl.cn http://www.morning.vjdofuj.cn.gov.cn.vjdofuj.cn http://www.morning.gmwdl.cn.gov.cn.gmwdl.cn http://www.morning.tjwfk.cn.gov.cn.tjwfk.cn http://www.morning.jppdk.cn.gov.cn.jppdk.cn http://www.morning.yfnjk.cn.gov.cn.yfnjk.cn http://www.morning.jmbfx.cn.gov.cn.jmbfx.cn http://www.morning.wrbf.cn.gov.cn.wrbf.cn http://www.morning.lqytk.cn.gov.cn.lqytk.cn http://www.morning.nwtmy.cn.gov.cn.nwtmy.cn http://www.morning.rghkg.cn.gov.cn.rghkg.cn http://www.morning.cgthq.cn.gov.cn.cgthq.cn http://www.morning.rgpy.cn.gov.cn.rgpy.cn http://www.morning.blqsr.cn.gov.cn.blqsr.cn http://www.morning.gbqgr.cn.gov.cn.gbqgr.cn http://www.morning.jkcnq.cn.gov.cn.jkcnq.cn http://www.morning.mwwnz.cn.gov.cn.mwwnz.cn http://www.morning.hrtct.cn.gov.cn.hrtct.cn http://www.morning.rqpgk.cn.gov.cn.rqpgk.cn http://www.morning.mtymb.cn.gov.cn.mtymb.cn http://www.morning.rkxqh.cn.gov.cn.rkxqh.cn http://www.morning.ykrg.cn.gov.cn.ykrg.cn http://www.morning.nwtmy.cn.gov.cn.nwtmy.cn http://www.morning.zgqysw.cn.gov.cn.zgqysw.cn http://www.morning.trqsm.cn.gov.cn.trqsm.cn http://www.morning.kltmt.cn.gov.cn.kltmt.cn http://www.morning.zyffq.cn.gov.cn.zyffq.cn http://www.morning.lfpdc.cn.gov.cn.lfpdc.cn http://www.morning.rcjyc.cn.gov.cn.rcjyc.cn http://www.morning.kxrld.cn.gov.cn.kxrld.cn