Display GeoTiff browse images to Cesium Map

Hi there:

Looks like I couldn’t add GeoTiff browse images from my geoserver to Cesium Map, I get errors like:

  1. Use WebMapServiceImageryProvider:

16:21:51.307 “An error occurred in “WebMapServiceImageryProvider”:” Cesium.js:87986
16:21:51.307 “Failed to obtain image tile X: 0 Y: 0 Level: 0.”

or:

  1. Use TileMapServiceImageryProvider:

16:22:48.548 “An error occurred in “TileMapServiceImageryProvider”:” Cesium.js:87986
16:22:48.548 “Failed to obtain image tile X: 1 Y: 0 Level: 1.”

or:

  1. Use SingleTileImageryProvider:

16:24:00.108 “Failed to load image http://localhost:8082/geoserver/wms.”

Do you know what’s wrong and how to make it work ?

Thanks

Cathy

Here’s my code:

layers.addImageryProvider(new Cesium.WebMapServiceImageryProvider({
url : browseUrl,
layers : ‘RS_21390’
}));

Thanks

Cathy

To test if my browse geotiff file has problem, I download the TrueMarble.250m.21600x21600.A1.tif from http://www.unearthedoutdoors.net/global_data/true_marble/download, and loaded it to my Geoserver. I can see the image through the GeoServer’s layer preview. However, when I try to add it to my Cesium Map, I get the same errors. I would like to believe that the TrueMarble GeoTiff file is correct, so it’s Cesium issue?

Please help if you know how to make it work.

Thanks a lot

Cathy

Hello, maybe you've got a CORS limitation to remove from your application server.
See also https://groups.google.com/forum/embed/?place=forum/cesium-dev&showsearch=true&showpopout=true&hideforumtitle=true&parenturl=http%3A%2F%2Fcesiumjs.org%2Fforum.html#!searchin/cesium-dev/cors/cesium-dev/Jvd1pyIHkcA/OZi2sFlHOJkJ

Hi

Ok, the GeoTiff browse images are able to show on the map, But then I have two issues now:

  1. Looks like I can only have one layer on the “layers” parameter, if I have more, then I got the same errors (“Failed to obtain image tile X: 0 Y: 0 Level: 0.”).

  2. The browse image does displayed on the global, but it overlayed to the whole global even though the image itself is very small, it makes all other areas white.

Sorry, last post was send out accidently and I haven’t finish yet. I’ll continue, but please see below as I’ll add more detail info to them:

Hi

Ok, the GeoTiff browse images are able to show on the map, But then I have two more issues now:

  1. Looks like I can only have one layer on the “layers” parameter, if I have more, then I got the same errors (“Failed to obtain image tile X: 0 Y: 0 Level: 0.”).

Is following code for layers paramters correct (separated by comma as described in the API Doc)?

var browseLayer = layers.addImageryProvider(new Cesium.WebMapServiceImageryProvider({
url : browseUrl,
layers : ‘img1, img2, img3’
}));

  1. The browse image does displayed on the global, but it overlayed to the whole global even though the image itself is very small, it makes all other areas white.

From http://cesiumjs.org/2013/01/04/Cesium-Imagery-Layers-Tutorial/, looks like we adjust the layers display: for example:

browseLayer.alpha = 0.5;
browseLayer.brightness = 1.2;

But the results is not good, it makes the baselayer looks urgly and the browse it self not clear too.

Question: why not only display the image itself on the map? do not ovrwrite/overlay other area with white color at all?

Thanks

Cathy

The second issue is solved by asking a png image from Geoserver for the browse geotiff images.

The first is still a problem, looks like you can not add two layers (from your Geoserver) to one WebMapServiceImageryProvider in Cesium?

Thanks

Cathy

Hi Cathy,

It’s definitely possible to add more than one layer at a time (although I haven’t tested it with b26).

Try creating a text variable of layer names first, and then using that as the layer name.

i.e.

var myLayers = “img1, img2, img3”;

var browseLayer = layers.addImageryProvider(new Cesium.WebMapServiceImageryProvider({
url : browseUrl,
layers : myLayers
}));

Using single or double quotes shouldn’t matter - but try both ways.

Cheers,

Toby

Hi Toby:

I upgrated my sample app to Cesium b26, this (with multiple layers) still doesn’t work:

An error occurred in “m”: Failed to obtain image tile X: 1 Y: 0 Level: 0.

If I combine them to a layer group, it will show all of them. This is still an issue, people may want to display a few layer groups as well.

Thanks

Cathy

Hi Cathy,

So I did a bit of digging - and it’s got to do with the spaces in between the layer names.

If you look at the Sandcastle demo here;

in the ‘United States GOES infrared’, layer instantiation, on line 42 if you replace what is there with this;

layers : ‘conus_ir_4km, ir_4km_900913’,

it won’t work but if you do this (no space after the comma)

layers : ‘conus_ir_4km,ir_4km_900913’,

it will.

The first creates a WMS request with a “layers=conus_ir_4km,%20ir_4km_900913” parameter, which doesn’t work.

Not sure this is intentional, but the Cesium devs will know that better than I do.

Hope that works for you.

Toby

Hi Toby:

Right, that’s the space! It works now.

Thanks

Cathy