geo-data / cesium-terrain-builder Goto Github PK
View Code? Open in Web Editor NEWA C++ library and associated command line tools designed to create terrain tiles for use in the Cesium JavaScript library
License: Other
A C++ library and associated command line tools designed to create terrain tiles for use in the Cesium JavaScript library
License: Other
This may be good for the beginners!
CTB currently writes individual terrain tiles directly to disk. As zoom levels increase, this leads to millions of individual terrain tile files in thousands of folders, which are hard to copy and move around.
The MBTiles file format is a widely used container for image and terrain tiles. It would be great if CTB supported writing tiles directly into a designated MBTiles container file.
We're planning to tackle regenerating our own imagery and terrain datasets within the next few months. It'd be great if someone happened to implement MBTiles capability before then. If not, I may be able to tackle it myself, although it would help if someone who's more familiar with this codebase could offer advice on the best approach for doing so.
What output format supported by cesium itself?
For now I'm using .terrain format but maybe it's possible to use .tif (or something else) ?
怎么才能加载出海底地形呢?例如:offset -1000 meter。
My name is Michael Chin. I am working at the EarthByte Group of Sydney University. Recently, we are building a Cesium application with terrain data. We found your Cesium Terrain Builder on GitHub, which is great. Thank you very much for creating such a useful tool. However, when we put the terrain data into Cesium, we noticed something is not very correct along the boundary of terrain tiles. Please see the screenshot below. It seems the overlap pixels are not very right. We are wondering if you could help us with this. Thank you very much.
On one side, there is a rainbow wall.
On the other side, there is a colourful line above a transparent wall.
If you look down from above, there is a black line along the terrain tile boundary.
I don't understand why when I generate terrain with CTB and then load it in Cesium, tile coordinates doesn't match tile naming.
I mean, I use Cesium inspector on a tile with elevation in order to get it's coordinates (level, x and y) then I go in generated terrain directory in order to find corresponding tile but it doesn't exist. I can find terrain/Z/X/
path but Y.terrain
doesn't exist.
By the way, visually in Cesium there is obviously no problem with elevation georeferencing.
Could someone explain me?
Hey guys, I'm getting this error when processing some DEM files, any idea what it could be?
0...10...20...30...40...50...60...70...80...90...ERROR 1: Integer overflow : nSrcXSize=25536, nSrcYSize=25536
ERROR 1: IReadBlock failed at X offset 0, Y offset 0
ERROR 1: GetBlockRef failed at X block offset 0, Y block offset 0
Error: Could not read heights from raster
ERROR 1: Integer overflow : nSrcXSize=25536, nSrcYSize=25536
ERROR 1: IReadBlock failed at X offset 0, Y offset 0
ERROR 1: GetBlockRef failed at X block offset 0, Y block offset 0
Error: Could not read heights from raster
ERROR 1: Integer overflow : nSrcXSize=25536, nSrcYSize=25536
ERROR 1: IReadBlock failed at X offset 0, Y offset 0
ERROR 1: GetBlockRef failed at X block offset 0, Y block offset 0
Error: Could not read heights from raster
ERROR 1: Integer overflow : nSrcXSize=25536, nSrcYSize=25536
ERROR 1: IReadBlock failed at X offset 0, Y offset 0
ERROR 1: GetBlockRef failed at X block offset 0, Y block offset 0
Error: Could not read heights from raster
ERROR 1: Integer overflow : nSrcXSize=25536, nSrcYSize=25536
ERROR 1: IReadBlock failed at X offset 0, Y offset 0
ERROR 1: GetBlockRef failed at X block offset 0, Y block offset 0
Error: Could not read heights from raster
ERROR 1: Integer overflow : nSrcXSize=25536, nSrcYSize=25536
ERROR 1: IReadBlock failed at X offset 0, Y offset 0
ERROR 1: GetBlockRef failed at X block offset 0, Y block offset 0
Error: Could not read heights from raster
ERROR 1: Integer overflow : nSrcXSize=25536, nSrcYSize=25536
ERROR 1: IReadBlock failed at X offset 0, Y offset 0
ERROR 1: GetBlockRef failed at X block offset 0, Y block offset 0
Error: Could not read heights from raster
ERROR 1: Integer overflow : nSrcXSize=25536, nSrcYSize=25536
ERROR 1: IReadBlock failed at X offset 0, Y offset 0
ERROR 1: GetBlockRef failed at X block offset 0, Y block offset 0
Error: Could not read heights from raster
ERROR 1: Integer overflow : nSrcXSize=25536, nSrcYSize=25536
ERROR 1: IReadBlock failed at X offset 0, Y offset 0
ERROR 1: GetBlockRef failed at X block offset 0, Y block offset 0
Error: Could not read heights from raster
ERROR 1: Integer overflow : nSrcXSize=25536, nSrcYSize=25536
ERROR 1: IReadBlock failed at X offset 0, Y offset 0
ERROR 1: GetBlockRef failed at X block offset 0, Y block offset 0
Error: Could not read heights from raster
ERROR 1: Integer overflow : nSrcXSize=25536, nSrcYSize=25536
ERROR 1: IReadBlock failed at X offset 0, Y offset 0
ERROR 1: GetBlockRef failed at X block offset 0, Y block offset 0
Error: Could not read heights from raster
When I use the GDAL 2.2.1
to compile the source, it reported an error like GDALCreateOverviewDataset() has the wrong number of arguments
, I query the header file, the function of GDAL 2.2.1
has just three arguments instead of four.
And then I download the source code of GDAL 2.1.4
, the CTB has built succefully.
appreciate for your work,could you tell me did it support the water mask now? and do you know the "quantized-mesh-1.0 terrain format" support water mask?
Trying to save all user location on globe. who ever is accessing my link.
Link : http://camsphere.canopussystems.com/Cesium-1.10/Apps/Sandcastle/gallery/Cesium%20Inspector.html
Dear Homme,
Thanks for sharing this useful tool and great work, I'm experiencing an issue when generating terrain tiles using SRTM data from Australia, the first top level tile misses the 0/0/0.terrain file, adding this tile manually as per your instruction at issue#1 fixes the cesium error message which was looking for the missing tile but it dose not render the terrain! Interestingly when I use a SRTM DEM from France, after adding the missing tile, cesium renders the terrain and shows it without any issue! Would you please advise how to fix this?
Are there any alternatives to cesium-terrain-builder
that can tile dem.tif to .tif tiles and then use them directly as tiles for terrain in cesium?
Is it possible to merge 2 tile sets?
Hi,
This post is not for an issue, it's more like a feature request but I understand that you guys don't have time to answer all the requests so if you can just give me some tips it would be great too :)
So here is the problem :
In fact I would like to generate tiles from a geotiff File (eu dem file)
In order to use the generated tiles in a game engine as heightmaps (so not for using it in cesium).
It's working quite well using the command ctb-tile -f GTiff but the problem is that the tiles edge doesn't match because there is not any overlapping if we don't export .terrain files.
Second problem is that I have never worked with c++ so it's a bit hard for me to understand the source code of this very cool tool.
So i would like to know if you can tel me which files/functions I should look at to implement this feature.
Thanks !
I can't load the terrain file to the cesium. Now I will describe how I did it step by step. Hope this will help you find out where I went wrong.
STEPS:
Basically, I am following the tutorial in this post. The terrain.tif can be downloaded in the post link.
Built the Cesium-Terrain-Builder into several executable files.
ctb-tile -o ./data/tilesets/terrain/texel dem.tif
Follow the steps of how to install Cesium-terrain-server. Using go, and generate a cesium-terrain-server.exe in my GOPATH.
Using cmd to setup the terrain tiles service
cesium-terrain-server -web-dir ../data/tilesets/terrain/texel -port 8000
In my visual studio code, I write the code shown below
Hi,
I had built tiles in the format of .terrain. I had included layer.json file and enabled CORS. But I am getting error on using these lines of codes in sandcastle -
var viewer = new Cesium.Viewer('cesiumContainer');
var terrainProvider = new Cesium.CesiumTerrainProvider({
url : 'http://localhost:8080/cesium/Apps/Sandcastle/terrain/tiles' // I had also checked with relative URL
});
viewer.scene.terrainProvider = terrainProvider;
Errors are -
An error occurred in "CesiumTerrainProvider": Failed to obtain terrain tile X: 1 Y: 0 Level: 0.
An error occurred in "CesiumTerrainProvider": Failed to obtain terrain tile X: 0 Y: 0 Level: 0.
Note: I am having 0/0/0.terrain and 0/1/0.terrain
Just wondering: it seems that the tiles have plain heights encoded (TerrainTiler.cpp
?). If so, are there plans for quantized-mesh encoding as in http://cesiumjs.org/data-and-assets/terrain/formats/quantized-mesh-1.0.html? If not I/we may add this, though time is not on my side. We have very detailed (0.5m res) Dutch open height data: http://app.map5.nl/nltopo/#rd/relief_struct/12/196286.4/446444.9.
Hi. I have built CTB by Visual Studio 2015 with GDAL2.0.1, then use CTBtile to tile my DEM data with command -o XXX XXX.tif. The tool worked great while it appears a sharp scenery in CesiumJS which is not that much smooth with it in arcglobe, I am not talking about the sharp boundary but the area with some real data such as a hill will look like a pyramid. The original data is in WGS84 coordinate. I don't know if there are some restraints for input data such as supposed bits or there are something else I have left out?
"Once this tileset is generated it can be turned into a GDAL Virtual Raster dataset for creating the next zoom level down (e.g. level 17). Repeating this process until the lowest zoom level is created means that the resampling is much more efficient (e.g. level 0 would be created from a VRT representation of level 1). Because terrain tiles are not a format supported by VRT datasets you will need to perform this process in order to create tiles in a GDAL DEM format as an intermediate step. VRT representations of these intermediate tilesets can then be used to create the final terrain tile output."
I do not understand what I am supposed to be doing for the intermediate step when processing level by level. After I create the first level of terrain tiles how or what do I point to for the next level?
While tiling large set of DEM .tif tiles ctb-tile
hangs at some point and in htop
I can't see any CPU utilization. This section https://github.com/geo-data/cesium-terrain-builder#limitations-and-todo have some suspicious cases:
Better coordination between threads in ctb-tile to enable graceful exits if there is a fatal error or other interrupt.
The ctb-tile command currently only outputs files to a directory and as such is subjected to filesystem limits (e.g. inode limits): it should be able to output tiles in a format that overcomes these limits and which is still portable and accessible. SQLite would appear to be a strong contender.
So how to debug ctb-tile
? Will build in debug mode help? some other ideas?
Update:
Looks like it's not inode limits.
I have two DEMs which are not adjacent to each other. Saying one is the Texa DEM and the other is Florida DEM. First i create terrain one by one and the result in cesium is good. But after i merge the DEM into a single one. I cannot see any terrain in map. I think maybe my mergeing DEM has some problem, but I cannot figure it out. Can you give me some suggestions? Do I have to deal with nodata cell and set its value to zero(some solution i find on internet) ?
*** Error in `ERROR 3: Read of file /home/aleksandr/custombuild/share/gdal/gdal_datum.csv failed.
ERROR 3: Read of file /home/aleksandr/custombuild/share/gdal/gdal_datum.csv failed.
/home/aleksandr/custombuild/bin/ctb-tile': double free or corruption (out): 0x00007fa3a4053b90 ***
Aborted (core dumped)
I'm trying to build CTB but its being a nightmare.
After geting stuck on
CMake Error at src/CMakeLists.txt:10 (message):
The GDAL version must be one that implements RFC 46 (GDAL/OGR unification)
i.e. >= 2.0.0
and
Could NOT find GDAL (missing: GDAL_LIBRARY GDAL_INCLUDE_DIR)
CMake Error at CMakeLists.txt:67 (message):
The GDAL library cannot be found on the system
and some missing GDALOpenEx problem I'm now on this:
Scanning dependencies of target ctb
[ 5%] Building CXX object src/CMakeFiles/ctb.dir/GDALTile.cpp.o
/.../cesium-terrain-builder-0.4.1/src/GDALTile.cpp:22:24: fatal error: gdalwarper.h: No such file or directory
compilation terminated.
src/CMakeFiles/ctb.dir/build.make:62: recipe for target 'src/CMakeFiles/ctb.dir/GDALTile.cpp.o' failed
make[2]: *** [src/CMakeFiles/ctb.dir/GDALTile.cpp.o] Error 1
CMakeFiles/Makefile2:85: recipe for target 'src/CMakeFiles/ctb.dir/all' failed
make[1]: *** [src/CMakeFiles/ctb.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
Please put the REAL WORKING Instalation guide on your main page to avoid problems. I sugest you to start your guide from a fresh Ubuntu installation and you will see that just say The dependency is GDAL >= 2.x
is not enough. Build the CTB from zero ground SO is a pain!
Seems current master is not compiling with GDAL 2.1.0 and GDAL 2.2.* (btw what version it supports officially?) and I can't find ppa to install GDAL 2.1.4 on Ubuntu 14.04, so I tried to compile it from source.
wget http://download.osgeo.org/gdal/2.1.4/gdal-2.1.4.tar.gz
tar -xvzf gdal-2.1.4.tar.gz
cd gdal-2.1.4/
mkdir deploy
./configure --prefix=/home/user/temp/gdal-2.1.4/deploy
make
It fails with
make[2]: Entering directory `/home/user/temp/gdal-2.1.4/frmts/postgisraster'
/bin/bash /home/user/temp/gdal-2.1.4/libtool --mode=compile --tag=CXX g++ -I/home/user/temp/gdal-2.1.4/port -I/home/user/temp/gdal-2.1.4/gcore -I/home/user/temp/gdal-2.1.4/alg -I/home/user/temp/gdal-2.1.4/ogr -I/home/user/temp/gdal-2.1.4/ogr/ogrsf_frmts -I/home/user/temp/gdal-2.1.4/gnm -I/home/user/temp/gdal-2.1.4/apps -g -O2 -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security -Wno-format-nonliteral -Wlogical-op -Wshadow -Werror=vla -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual -fno-operator-names -I ../mem -I ../vrt -I/home/user/anaconda3/include -I/home/user/anaconda3/include/server -DPG_HAS_PQESCAPESTRINGCONN -DOGR_ENABLED -I/home/user/temp/gdal-2.1.4/port -I/usr/include/libqhull -I/usr/include/qhull -DGDAL_COMPILATION -c -o ../o/postgisrasterdriver.lo postgisrasterdriver.cpp
libtool: compile: g++ -I/home/user/temp/gdal-2.1.4/port -I/home/user/temp/gdal-2.1.4/gcore -I/home/user/temp/gdal-2.1.4/alg -I/home/user/temp/gdal-2.1.4/ogr -I/home/user/temp/gdal-2.1.4/ogr/ogrsf_frmts -I/home/user/temp/gdal-2.1.4/gnm -I/home/user/temp/gdal-2.1.4/apps -g -O2 -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security -Wno-format-nonliteral -Wlogical-op -Wshadow -Werror=vla -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual -fno-operator-names -I ../mem -I ../vrt -I/home/user/anaconda3/include -I/home/user/anaconda3/include/server -DPG_HAS_PQESCAPESTRINGCONN -DOGR_ENABLED -I/home/user/temp/gdal-2.1.4/port -I/usr/include/libqhull -I/usr/include/qhull -DGDAL_COMPILATION -c postgisrasterdriver.cpp -fPIC -DPIC -o ../o/.libs/postgisrasterdriver.o
In file included from postgisrasterdriver.cpp:31:0:
postgisraster.h:41:22: fatal error: libpq-fe.h: No such file or directory
#include "libpq-fe.h"
So I have installed sudo apt-get install libpq-dev
and added export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/usr/include/postgresql/
but get another error:
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kealib::KEAImageIO::isKEAImage(std::string)'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kmldom::Parse(std::string const&, std::string*)'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kealib::KEAImageIO::setImageMetaData(std::string, std::string)'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `MakeMapObject'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `png_get_asm_flags'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `libiconv_open'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `png_set_asm_flags'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kealib::KEAImageIO::openKeaH5RDOnly(std::string, int, unsigned long long, unsigned long long, double, unsigned long long, unsigned long long)'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kmlengine::KmzFile::ReadFile(char const*, std::string*) const'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kealib::KEAImageIO::createKEAImage(std::string, kealib::KEADataType, unsigned int, unsigned int, unsigned int, std::vector<std::string, std::allocator<std::string> >*, kealib::KEAImageSpatialInfo*, unsigned int, unsigned int, int, unsigned long long, unsigned long long, double, unsigned long long, unsigned long long, unsigned int)'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kealib::KEAImageIO::openKeaH5RW(std::string, int, unsigned long long, unsigned long long, double, unsigned long long, unsigned long long)'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kealib::KEAImageIO::setGCPs(std::vector<kealib::KEAImageGCP*, std::allocator<kealib::KEAImageGCP*> >*, std::string)'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kmlengine::KmzFile::ReadKmlAndGetPath(std::string*, std::string*) const'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kealib::KEAImageIO::getImageMetaData()'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kealib::KEAImageIO::getGCPProjection()'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `libiconv_close'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kmldom::SerializePretty(boost::intrusive_ptr<kmldom::Element> const&)'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `png_get_asm_flagmask'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kmlengine::Href::Parse(std::string const&)'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kealib::KEAImageIO::setImageBandMetaData(unsigned int, std::string, std::string)'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kealib::KEAImageIO::getImageBandDescription(unsigned int)'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kealib::KEAImageIO::setImageBandDescription(unsigned int, std::string)'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `FreeMapObject'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kmlengine::KmzFile::OpenFromString(std::string const&)'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `PrintGifError'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `kealib::KEAImageIO::getImageBandMetaData(unsigned int)'
/home/user/temp/gdal-2.1.4/.libs/libgdal.so: undefined reference to `libiconv'
collect2: error: ld returned 1 exit status
make[1]: *** [gdalinfo] Error 1
make[1]: Leaving directory `/home/user/temp/gdal-2.1.4/apps'
make: *** [apps-target] Error 2
We are getting approx 150 tiles per second processed on a layer 16 run with ctb-tile if we specify 1 thread, rising only to 400 tiles per second at 8 threads (on an 8-core machine).
We have tried this on a 36-core machine and the performance with 36 threads (the default setting being 1 per core) is no improvement whatsoever over 8 threads.
These are both EC2 servers. We have tried using a RAM drive for storage to eliminate the possibly of a disk bottleneck. We tend to see a load average of around the number of threads, and CPU utilization per core of around 70%.
If we ran another job at the same time, we can get utilization to 100%, but overall throughput is actually less.
The most peculiar thing is that on an Intel Core i5 destop machine, we get about 2000 tiles per second - dramatically better performance than the 36-core AWS box. We are not sure why.
Any tips? Here's the command we're running:
ctb-tile --output-dir tiles3 -s 16 -e 16 -m 8000000000 -c n dem_wgs84.vrt
Where n above is of course the various thread counts we have tried. Using more threads than cores also does not help, though I wouldn't expect it to.
Please let me know if any additional information would be helpful.
the par is :
cmake_configuration_types: Debug;Release;MinSizeRel;RelWithDebInfo
cmake_install_prefix: C:/Program Files (x86)/Cesium Terrain Builder
the out information is :
The C compiler identification is MSVC 18.0.21005.1
The CXX compiler identification is MSVC 18.0.21005.1
Check for working C compiler using: Visual Studio 12
Check for working C compiler using: Visual Studio 12 -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler using: Visual Studio 12
Check for working CXX compiler using: Visual Studio 12 -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Performing Test COMPILER_SUPPORTS_CXX11
Performing Test COMPILER_SUPPORTS_CXX11 - Failed
Performing Test COMPILER_SUPPORTS_CXX0X
Performing Test COMPILER_SUPPORTS_CXX0X - Failed
CMake Error at CMakeLists.txt:20 (message):
The compiler D:/Program Files (x86)/Microsoft Visual Studio
12.0/VC/bin/cl.exe has no C++11 support. Please use a different C++,
compiler.
can tou tell me ,Which compiler I have to choose? gcc or something else ,my os is windows
best wishes!
I've created a tileset and added the missing top tile:
#1
Unfortunately, I'm still getting an error:
An error occurred in "CesiumTerrainProvider": Failed to obtain terrain tile X: 1 Y: 0 Level: 0.
This tile is generated by the terrain builder, and the URL is correct, but it seems to fail in the createHeightmapTerrainData method of CesiumTerrainProvider. An error occurs in this line:
var heightBuffer = new Uint16Array(buffer, 0, provider._heightmapWidth * provider._heightmapWidth);
I wonder if there is something wrong in the buffer obtained from the file. buffer.byteLength is 48, while provider._heightmapWidth * provider._heightmapWidth is 4225. Isn't the buffer too short?
This is the tile:
http://thematicmapping.org/data/tiles/terrain/jotunheimen/0/1/0.terrain
I use visual studio2015 to build CTB tools and then create tiles using ctl-tile.exe,but when I load this tiles in cesium, there is nothing to show.
command:
ctb-tile --output-dir ./tiles ASTGTM2_N27E103_dem.tif --start-zoom 8 --end-zoom 0
this is CTB tools:
this is tiles, the right of image is right result, and the left is my test result which failed to load rightfully in cesium.
Hi, I have pulled GDAL from SVN (https://svn.osgeo.org/gdal/trunk/gdal) and installed it by ./configure, make, make install (I did not choose any extra configure parameters). The installed version is:
GDAL 2.0.0dev, released 2014/04/16
But the cmake of CTB still throws an error:
The GDAL version must be one that implements RFC 46 (GDAL/OGR unification)
i.e. >= 2.0.0
Which GDAL version should I install?
make[2]: *** No rule to make target /Users/mamay/custombuilds/lib/libgdal.so', needed by
src/libctb.dylib'. Stop.
make[1]: *** [src/CMakeFiles/ctb.dir/all] Error 2
make: *** [all] Error 2
Great work!
I've tested the terrain builder and created a tileset for an area in Norway. I also had to create a layer.json file. I'm then adding the terrain with these lines:
var terrainProvider = new Cesium.CesiumTerrainProvider({
url: '/terrain/jotunheimen'
});
viewer.scene.terrainProvider = terrainProvider;
I'm getting this error:
Failed to obtain terrain tile X: 0 Y: 0 Level: 0
This tile don't exist as it's not where my data is. I'm getting the same error if I first move to my location:
viewer.scene.camera.flyTo({
destination: Cesium.Cartesian3.fromDegrees(8.4, 61.5, 10000.0),
duration: 3,
complete: switchTerrain
});
Do you now how to load terrain tiles for a local area?
I create .terrain files using ctb-tile, but each .terrain file has same value 5000 of height in any zoom level.
>ctb-info -e 0.terrain Heights: 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000 5000
The original file is csv file it contains xyz scatter data of 20 million rows.
68562.610,53987.280,3.910
68587.400,53987.460,3.400
68545.530,53955.270,4.350
GeoTiff file view is here.
The follows are my codes.
>gdal_grid -a invdistnn -zfield field_3 -a_srs EPSG:2444 -of GTiff -txe 66500 68745 -tye 54000 51500 -outsize 4000 4000 -ot Float32 kunisaki.vrt kunisaki-grid2.tif --config GDAL_NUM_THREADS ALL_CPUS
>gdalwarp -t_srs EPSG:4326 kunisaki-grid2.tif kunisaki-grid2-wgs84.tiff
>ctb-tile --output-dir data/tilesets/terrain-tiles/ kunisaki-grid2-wgs84.tiff
How can I get .terrain files from scatter data for ctb?
I need to combine ctb-tile outputs of geotiffs, because lots of geotiffs take a long time to merge
How do I manage this ?
Thanks.
Hello,
I am having some problems in building the project under windows, did anyone was successful please?
After long struggle building gdal and zlib, I am getting:
"C:\Program Files (x86)\JetBrains\CLion 2016.1.3\bin\cmake\bin\cmake.exe" --build C:\Users\elfai5.CLion2016.1\system\cmake\generated\ceisum-terrian-builder-d62868b7\d62868b7\Release --target all -- -j 4
[ 11%] Built target commander
Scanning dependencies of target ctb
[ 17%] Building CXX object src/CMakeFiles/ctb.dir/GDALTiler.cpp.obj
[ 29%] Building CXX object src/CMakeFiles/ctb.dir/GlobalMercator.cpp.obj
[ 29%] Building CXX object src/CMakeFiles/ctb.dir/GlobalGeodetic.cpp.obj
D:\workspace\ceisum-terrian-builder\src\GDALTiler.cpp: In function 'void* getOverviewDataset(GDALDatasetH, GDALTransformerFunc, void_)':
D:\workspace\ceisum-terrian-builder\src\GDALTiler.cpp:244:87: error: 'GDALCreateOverviewDataset' was not declared in this scope
poSrcOvrDS = GDALCreateOverviewDataset( poSrcDS, iOvr, FALSE, FALSE );
^
D:\workspace\ceisum-terrian-builder\src\GDALTiler.cpp: In member function 'void ctb::GDALTiler::closeDataset()':
D:\workspace\ceisum-terrian-builder\src\GDALTiler.cpp:397:20: error: 'class GDALDataset' has no member named 'GetRefCount'
if (poDataset->GetRefCount() < 1) {
^
mingw32-make.exe[2]: *_* [src/CMakeFiles/ctb.dir/GDALTiler.cpp.obj] Error 1
src\CMakeFiles\ctb.dir\build.make:87: recipe for target 'src/CMakeFiles/ctb.dir/GDALTiler.cpp.obj' failed
CMakeFiles\Makefile2:84: recipe for target 'src/CMakeFiles/ctb.dir/all' failed
makefile:126: recipe for target 'all' failed
mingw32-make.exe[1]: *** [src/CMakeFiles/ctb.dir/all] Error 2
mingw32-make.exe: *** [all] Error 2
Many errors when trying to build on mavericks:
I'm using the NED 1/3 arc second data set to generate tiles to zoom level 15 for Cape Canaveral in Florida, and finding that the terrain looks accurate in shape, but the elevation is too high by about 30m. The Cesium AGI STK World Terrain set uses NED data as well, and I can see the exact same artifacts and characteristics in the terrain I'm generating as that in the AGI data, except for the elevation difference. Is there a parameter I'm missing when generating terrain tiles?
edit: actually it seems to be exactly 30m.
I want to build .png tileset from .tif orthophoto can I use cesium-terrain-builder directly instead of gdal2tiles.py?
But seems cesium-terrain-builder produce different results compared to gdal2tiles.py I have checked it using diff -rq ortho_tiles_orig ortho_tiles_ctb
Is there currently a way to see what zoom level ctb-tile will create by default? For example, I have a raster which receives tiles for zoom levels 0-16, and another which gets 0-14, when I don't specify the start and end zoom. I was hoping to find a command that would let me get the "16" and "14" without actually running the tiler and inspecting the files.
This would be useful to allow for automatic overview creation using gdaladdo in order to prevent issues #28 and #37
At the moment, the best solution I know of is to inspect the layers.json produced in @ahuarte47's pull request, but I was wondering if there's anything better.
Hi,
I am trying to visualise some bathy data using your awesome tool. However, it looks like that all elevation data is inverted (I am using a tiff with negative elevation values to generate the terrain files).
Is this by design?
Cheers
I am tiling the dem using ctb while the out come shows that there is a big rift on the surface (figure 1). I debuged the data and find the height data at level 9 is strange, the bound is biger than the real region of the data (figure2). I have noticed that the latest merge of the ctb master is to lock the thread for bound shift while what I have tested is using only one thread. I am wondering if the error is caused by GDAL when building VRT files.
Following #6 issue, I am trying to generate and use terrain in Cesium.
When I try to generate terrain for N24E032.hgt
SRTM 3 file:
ctb-tile --output-dir test N24E032.hgt
0...10...20...30...40...50...60...70...80...90...100 - done.
I can find in generated directory tree th
e terrain tile test\0\2\1.terrain
which must be test\0\1\0.terrain
accordingly to heightmap-1.0 terrain format.
After some investigation it seems that there is a mistake in Grid.hpp
file:
inline TilePoint
pixelsToTile(const PixelPoint &pixel) const {
i_tile tx = (i_tile) ceil(pixel.x / mTileSize),
ty = (i_tile) ceil(pixel.y / mTileSize);
return TilePoint(tx, ty);
}
should be:
inline TilePoint
pixelsToTile(const PixelPoint &pixel) const {
i_tile tx = (i_tile) pixel.x / mTileSize,
ty = (i_tile) pixel.y / mTileSize;
return TilePoint(tx, ty);
}
It seems to solve my issue.
Following #6 and #9 issues, I am trying to generate and use terrain in Cesium.
When I try to generate terrain for N24E032.hgt
SRTM 3 file:
ctb-tile --output-dir test N24E032.hgt
0...10...20...30...40...50...60...70...80...90...100 - done.
And then load the TMS layer in Cesium, I have error 404 loading issues:
GET http://localhost/test/2/4/3.terrain 404 (Not Found) Cesium.js:18650
An error occurred in "CesiumTerrainProvider": Failed to obtain terrain tile X: 4 Y: 0 Level: 2. Cesium.js:19770
GET http://localhost/test/4/18/11.terrain 404 (Not Found) Cesium.js:18650
An error occurred in "CesiumTerrainProvider": Failed to obtain terrain tile X: 18 Y: 4 Level: 4.
As you can notice, Cesium cannot find 2/4/3.terrain
file but error report that it failed to obtain terrain tile X: 4 Y: 0 Level: 2
... Hum?!
Other upper tiles seems to load flawlessly, but Cesium behavior prevent child tile loading from these two tiles.
Here is the layer.json
file I use for Cesium terrain loading:
{
"tilejson": "2.1.0",
"format": "heightmap-1.0",
"version": "1.0.0",
"scheme": "tms",
"tiles": ["{z}/{x}/{y}.terrain"]
}
Indeed, 2/4/3.terrain
and 4/18/11.terrain
were not generated. If this is the expected behavior, parent tiles must have wrong child tags, if not there is some issue in the generation process.
Other possibility, I use wrong command line for my terrain generation, maybe I missed some default parameter...
Hello,
I am getting this error -
Error: The GDAL driver must be write enabled, specifically supporting 'CreateCopy'
When I try to tile using ENVI as the output format. Here is my command:
ctb-tile --output-dir ./tiles --profile mercator --tile-size 256 -f 'ENVI' --resampling-method bilinear input.bin
The input.bin is a 32bit float BSQ interleaved file if that makes a difference. I was able to create this with gdal 2.1.1.
Any help much appreciated. Thanks
What proper apt-get install
command for gdal library?
List of my installed packages:
apt list --installed | grep gdal
gdal-bin/trusty,now 1.10.1+dfsg-5ubuntu1 amd64 [installed,automatic]
libgdal-dev/trusty,now 1.10.1+dfsg-5ubuntu1 amd64 [installed]
libgdal1h/trusty,now 1.10.1+dfsg-5ubuntu1 amd64 [installed,automatic]
python-gdal/trusty,now 1.10.1+dfsg-5ubuntu1 amd64 [installed]
Howewer:
cmake ..
CMake Error at src/CMakeLists.txt:10 (message):
The GDAL version must be one that implements RFC 46 (GDAL/OGR unification)
i.e. >= 2.0.0
Do we need to build gdal
from source?
Hi Guys
Every now and then I come across this problem. Running this command
ctb-tile --output-dir "/data/output" "/data/source/input.tif"
99% of the time everything is fine and all files and folders get created in the output folder just fine. But sometimes something strange happens, it creates millions of .terrain files directly under the root of the output directory.
Has anyone else seen this or know why it could be happening?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.