Display GeoTiff browse images to Cesium Map

2,832 views
Skip to first unread message

Cathy Hu

unread,
Mar 3, 2014, 7:28:39 PM3/3/14
to cesiu...@googlegroups.com
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:
2. 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:
3. 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

Cathy Hu

unread,
Mar 3, 2014, 8:39:38 PM3/3/14
to cesiu...@googlegroups.com
Here's my code:
 
 layers.addImageryProvider(new Cesium.WebMapServiceImageryProvider({
  url : browseUrl,
  layers : 'RS_21390'       
 }));
 
Thanks
 
Cathy

Cathy Hu

unread,
Mar 4, 2014, 9:12:52 PM3/4/14
to cesiu...@googlegroups.com
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

bobac...@gmail.com

unread,
Mar 5, 2014, 12:53:25 AM3/5/14
to cesiu...@googlegroups.com

Cathy Hu

unread,
Mar 5, 2014, 2:44:57 PM3/5/14
to cesiu...@googlegroups.com, bobac...@gmail.com
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.
Message has been deleted

Cathy Hu

unread,
Mar 5, 2014, 2:58:02 PM3/5/14
to cesiu...@googlegroups.com, bobac...@gmail.com
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:

On Wednesday, March 5, 2014 11:44:57 AM UTC-8, Cathy Hu wrote:
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'  
         }));
       
 
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.
    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

Cathy Hu

unread,
Mar 5, 2014, 6:32:22 PM3/5/14
to cesiu...@googlegroups.com, bobac...@gmail.com
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

Toby R

unread,
Mar 10, 2014, 9:17:00 AM3/10/14
to cesiu...@googlegroups.com, bobac...@gmail.com
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

On Wednesday, 5 March 2014 23:32:22 UTC, Cathy Hu wrote:
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
 

On Wednesday, March 5, 2014 11:58:02 AM UTC-8, Cathy Hu wrote:
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:
On Wednesday, March 5, 2014 11:44:57 AM UTC-8, Cathy Hu wrote:
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'  
         }));
       
 
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.
    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

Cathy Hu

unread,
Mar 10, 2014, 6:14:52 PM3/10/14
to cesiu...@googlegroups.com, bobac...@gmail.com
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.

Toby R

unread,
Mar 11, 2014, 5:47:49 AM3/11/14
to cesiu...@googlegroups.com, bobac...@gmail.com
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

Cathy Hu

unread,
Mar 11, 2014, 1:28:46 PM3/11/14
to cesiu...@googlegroups.com, bobac...@gmail.com
Hi Toby:
 
Right, that's the space! It works now.
 
Thanks
 
 
Cathy
Reply all
Reply to author
Forward
0 new messages