Comments (13)
Yes, height values are scaled to fit into an unsigned short int (https://github.com/geo-data/cesium-terrain-builder/blob/master/src/TerrainTiler.cpp#L48) as per the terrain tile specification. However, by itself this shouldn't produce the effect you are showing. It looks like your data may be oversampled: did you manually specify a maximum zoom level (using --start-zoom
) or did you let ctb-tile
decide? If the former and you specified a zoom level significantly greater than the native DEM resolution then the oversampling may generate the terracing artifacts.
from cesium-terrain-builder.
I let ctb-tile decide. See this blog post:
http://blog.thematicmapping.org/2014/10/3d-terrains-with-cesium.html
I got the same effect in three.js when I rounded the height valuses to the nearest meter.
I see from the heightmap-1.0 specification that "Each height is the number of 1/5 meter units above -1000 meters." Rounding to the nearest 20 cm should be sufficient at this scale.
So you don't see any blocks or terraces on your maps?
from cesium-terrain-builder.
A very interesting blog post, thanks!
I don't see any blocks or terraces in my maps, but I have been mapping around Langstone Harbour, UK, which doesn't quite compare to Norway's rather impressive relief! For comparison I have been using 10cm aerial photography draped over 1m LIDAR data.
I agree that rounding to 20cm should be fine and doesn't account for the terracing that you are seeing. It would be interesting to get the terrain data into a GIS and do some comparisons between various processing steps to see where any error is introduced (if indeed it is, as it could still be a browser side Cesium issue). I would recommend loading the same problem area from three sources for comparison:
- The source DEM at its native resolution
- The
ctb-tile
generated terrain tiles from the maximum zoom level. These can be converted to GeoTIFF using thectb-export
utility. - Try creating GeoTIFF (or GDAL VRT) files directly from your source DEM. This will check whether the GDAL resampling is introducing any errors. This can be done using a command along the lines of
ctb-tile --output-format VRT source-dem.tiff
.
Comparing the different data in the GIS will hopefully help narrow down the problem.
from cesium-terrain-builder.
@turban Did you make any further progress narrowing down this problem? If not it may be worth trying the latest docker image which includes some bug fixes which might affect your issue. Otherwise I'd be able to look into the problem further if you can provide a minimal dataset which replicates your problem.
from cesium-terrain-builder.
I tested the latest docker image, and the problem still appear:
Top image is with terrain tiles from Cesium Terrain Builder (10 m resolution). Bottom image is using the quantized mesh tiles from AGI (30 meters resolution).
I'll try to narrow down the problem.
from cesium-terrain-builder.
Sorry to hear it's still a problem. I'm not sure of the scale of the screenshots, but it looks like the terracing might be occurring at the native DEM resolution of 10m? It might be worth trying oversampling and interpolating a test area to a higher resolution (say 0.5m) and running that through ctb-tile
to see if that makes a difference.
I'll try running some tests on data covering mountainous terrain and see if I can replicate the problem.
from cesium-terrain-builder.
Hi homme, I have the same problem. I built terrain using the latest docker image and using 1" DEM of Swiss Alps (http://www.viewfinderpanoramas.org/dem3.html#alps), letting cbt-tile
decide on the maximum zoom level.
Is there any way I could help debugging the issue?
from cesium-terrain-builder.
I tested upsampling the underlying dataset as follows
gdalwarp -tr 0.0001 0.0001 combined.vrt combined2.vrt -of VRT -overwrite -r cubic
(this should give a precision around 0.4 arc second) and generated the tiles from this new dataset limiting the maxzoom to 14. So far the results look promising and it should be a decent workaround.
@homme would it be possible to add a native support for (cubic) interpolation when building the tiles?
from cesium-terrain-builder.
@ppershing many thanks for taking the time to test this. Your workaround sounds good. I'm adding a command line option to ctb-tile
to enable the resampling algorithm to be specified, which will hopefully mean that we won't need your workaround. At the moment the resampling algorithm is 'nearest neighbour'. It was suggested by the GDAL maintainer (Even Rouault) that we use 'average' as he thinks this should work better when resampling to lower resolutions: this will be the new default. If one of the other methods, such as 'cubic', proves to produce better results then I can always change the default.
from cesium-terrain-builder.
The resampling options are available in the homme/cesium-terrain-builder:latest
docker image.
from cesium-terrain-builder.
I can confirm that the 'average' resampling option has produced good results with no more blocky terrain artefacts.
from cesium-terrain-builder.
Great! I can also confirm that my terrain is no longer blocky. Sometimes average is best :-)
from cesium-terrain-builder.
@turban Definitely! And I will be paying much more attention to resampling algorithms in the future :)
from cesium-terrain-builder.
Related Issues (20)
- Error tiling with output format set to Leveller
- Can't change terrain tile size from 65x65 to 256x256
- GDALOpenEx - not found Windows build HOT 1
- ctb.dll not found Windows HOT 2
- Trouble building with CMAKE: GDAL not found
- ERROR 1: PROJ: webmerc: Invalid latitude HOT 1
- Resume is not a valid parameter anymore
- quantized-mesh tiles has no “metadata” extension HOT 5
- empty tiles
- undefined reference to `GDALCreateOverviewDataset(GDALDataset*, int, int)' HOT 10
- why cesium can not display the terrain? HOT 5
- Terrain pyramid getting created outside of dataset bounds HOT 1
- The command line ran successfully, but was not generated file "layer.json"? HOT 1
- Error while running make install HOT 4
- Cesium Terrain generated using DSM is way higher than the base map
- Cesium is not rendered after reaching level 4 terrain HOT 1
- Can not add the terrain data in cesium HOT 17
- Possibility to merge several regions with different resolutions? HOT 1
- Tile coordinates are not consistent with Google or TMS standard
- @alienatorZ , @aberenyi
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cesium-terrain-builder.