I'm trying to build a terrain visualization stack on my local machine using Cesius and GeoServer (using other proprietary servers is not an option). Unfortunately, I didn't have much luck.
1 - Why was WebMapServiceTerrainProvider removed from the master branch? In an older discussion here in cesium-dev there was a patch to make it work on latest Cesium. Is there any other problem with it?
2 - What's the point of using BIL format on GeoServer instead of plain PNG or other format? I seem to understand it has something to do with terrain data resolution, but I'm not quite sure.
I'm sorry for the naive questions, but I would like to understand :)
Alessio
throw new Cesium.DeveloperError('no good size');
at line 366
I'm trying to add a geotiff DEM to the Cesium globe using GeoserverTerrainProvider. The terrain data looks fine in Cesium, but I am having problems with the new terrain being displayed incorrectly at a much lower elevation than the rest of the globe. See here: http://s7.postimg.org/ahyakuhij/geoserver_qld3.jpg
I have tiled the data using GDAL and imported it into geoserver using ImagePyramid and with BIL plugin installed, and the SLD stylesheet mapping -32768 to #000000 and 15000 to #00BA98. The code I'm using is below. I have tried the example specified on the plugin page, however I cannot get the data to show at all without the postProcessArray function below:
var terrainProvider = new Cesium.GeoserverTerrainProvider({
url : "http://localhost:8081/geoserver/cubeglobe/wms",
layerName: "pyramid",
heightmapWidth:65,
styleName:"grayToColor",
formatImage: "image/png",
tagAltitudeProperty:"GRAY_INDEX",
waterMask: false,
formatArray: {
format : "application/bil16",
postProcessArray : function(bufferIn)
{
// bil is 16 bits big endian cell
var viewerIn = new DataView(bufferIn);
var littleEndianBuffer = new ArrayBuffer(bufferIn.byteLength);
if (littleEndianBuffer.byteLength === bufferIn.byteLength)
{
var viewerOut = new DataView(littleEndianBuffer);
//time to switch bytes!!
for (var i = 0; i < bufferIn.byteLength; i += 2)
{
viewerOut.setUInt16(i, viewerIn.getUInt16(i, false), true);
}
return new UInt16Array(viewerOut.buffer);
}
return undefined;
}
}
});
I have been modifying the plugin source around lines 427 to 442 and have gotten various results, and I have tried to determine if the SLD values need to be changed for my data (elevation range is -5625m to 2848m), but I am still not understanding things correctly. I am now resorting to trial and error with no success.
Changing line 427 to:
var valeur = (dataPixels[i + 1] << 8 | dataPixels[2] - 32768);
I get this image.. http://s7.postimg.org/m8c828aaz/geoserver_qld1.jpg
Which looks correct elevation outside the land surface (bathymetry) but still incorrect inside the land surface.
Does anyone have any idea what I am doing wrong here?
Some advice would be greatly appreciated thanks!
Allan
I have confirmed the preview in Geoserver and my bathymetry data looks as expected. See image here, showing almost the entire dataset:
http://s27.postimg.org/w1b80rx03/bathymetry_preview.png
The value of 140.0 displayed is from a point towards the bottom-left corner of the data (which is the land surface of Queensland, lighter green). The top-right side of the image is the bathymetry under the water (all negative values).
As mentioned previously, the terrain surface relief looks correct, except my data is showing far beneath the rest of the global terrain. I have tried various modifications to the source with mixed results, all incorrect. I can get the bathymetry surface only to display at the correct position by changing line 427, as in my previous post, but the land remains underneath the rest of the terrain.
It would be great if you could help me understand the format of the dataPixels array. Or if there is a way I can isolate just the land values only?
thanks again
Allan
Hi Allan,
You may want to give STK World Terrain Server a try. The STK World Terrain Server can convert any raw height data readable by GDAL into the open format quantized-mesh, that can be easily rendered in Cesium via the CesiumTerrainProvider. The STK World Terrain Server is a commercial product and there may be a licensing options available that fits your needs. I can put you in touch with someone at Analytical Graphics if you'd like to find out more.
Alex
You received this message because you are subscribed to a topic in the Google Groups "cesium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cesium-dev/ML7oBEUepuI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cesium-dev+...@googlegroups.com.
Could you send your code please?
--