#Example
var terrainProvider = new Cesium.GeoserverTerrainProvider({
service: "TMS",
url : "http://localhost:8080/geoserver/elevation/wms",
layerName: "SRTM90",
xml: xmlGetCapabilities,
proxy: proxy,
heightMapWidth: 64,
heightMapHeight: 64,
offset: 0,
highest: 12000,
lowest: -500,
styleName: "grayToColor",
hasStyledImage: true,
waterMask: true,
maxLevel: 11
});
#Details For the example the workspace in geoserver is "elevation", the layer name is "SRTM90", the url of geoserver is "geoURL" and the name of style is "grayToColor".
parameter | mandatory | type | default value | geoWebCache example | comments |
---|---|---|---|---|---|
service | YES | String | "WMS" | "TMS" | indicates type of service |
layerName | YES | String | undefined | "elevation:SRTM90" | name of the layer to use |
url | NO (see comments) | String | undefined | "geoURL/gwc/service/tms/1.0.0" | URL to acces to getCapabilities document (and ressources of the layer!!). Either xml (see below) and url must be defined |
xml | NO (see comments) | XMLDocument | undefined | XMLDocument of geoURL/gwc/service/tms/1.0.0 | xml that defines the metadata of the layer. Either url (see above) and xml must be defined |
proxy | NO | Cesium.DefaultProxy | undefined | new Cesium.DefaultProxy(urlProxy) | a proxy to get data from geoserver |
heightMapWidth | NO | Integer | 65 | 128 | defines width of tile. It seems that Cesium can't work with tile bigger than a certain size (between 129 and 256). |
heightMapHeight | NO | Integer | 65 | 128 | defines height tile. It seems that Cesium can't work with tile bigger than a certain size (between 129 and 256). |
offset | NO | Number | 0 | 400 | offset of the data in meters. It's positive to decrease the altitude of data received and it's negative to increase the altitude of data received |
highest | NO | Number | 12000 | 9000 | define highest altitude of the layer. If an elevation data is higher, it will be balanced with data of the same sample. |
lowest | NO | Number | -500 | -800 | define lowest altitude of the layer. If an elevation data is lower, it will be balanced with data of the same sample. |
styleName | NO | String | undefined | "mySLD" | Name of style to use for GeoserverTerrainProvider when it works with BILL/DDS or styled images (required in both case). In case of converted images, this parameter must be undefined or parameter hasStyledImage must be false (see below) |
hasStyledImage | NO | Boolean | true if styleName is defined, otherwise it's false | true | indicates if image type is styled or converted. see comments of styleName parameter above |
waterMask | NO | Boolean | false | true | Experimental. Indicates if GeoserverTerrainProvider should generate a water mask |
maxLevel | NO | Integer | 11 | 14 | Level maximum to request for the layer. For indication, with a 90 meters (or 3 seconds arc) precision data, level 11 is enough; with a 30 meters (or 1 second arc) precision data, level 13 should be enough. |