GeoserverTerrainProvider plugin displays completely black tiles at terrain data area

         I followed all the instructions given for [GeoserverTerrainProvider](https://github.com/kaktus40/Cesium-GeoserverTerrainProvider) plugin. I am using SRTM 90m data for all of India to produce terrain. So as per instructions for SRTM data,

– I used gdal_retile in Osgeo shell to produce tiles
used the following commands in Osgeo shell:
mkdir indiapyramid1
gdal_retile.py -v -r bilinear -levels 4 -ps 2048 2048 -co “TILED=YES” -targetDir indiapyramid1 india.tif

``

– Then I created coverage store with “Imagepyramid” plugin in geoserver and added raster source as the tileset created by gdal_retile and published the layer. Thus generating pyramid using this link.

– My pseudo code for terrain provider is as follows:

var viewer = new Cesium.CesiumWidget(‘cesiumContainer’);
var terrainProvider = new Cesium.GeoserverTerrainProvider({
proxy : new Cesium.DefaultProxy(‘proxy.php’),
//service : “WMS”,
url : “http://localhost:10000/geoserver/elevation/wms”,

    layerName: "indiapyramid1",
    //hasStyledImage: false,
    //styleName:"grayToColor"
    //waterMask:true
});


viewer.terrainProvider = terrainProvider;

``

– I am getting this output.(screenshot).
The tiles keep on appearing but changing location within the same bounding box of the DEM data.
But when I zoom into the globe I am not getting 3D terrain view. As you can see in this screenshot.
– Using styled geotiff and converted geotiff also results into same output.
I am not understanding where I am wrong. Help needed !

Hello maybe you have a CORS issue

you should see https://cesiumjs.org/2013/01/04/Cesium-Imagery-Layers-Tutorial/

Actually “bobac”, I am not trying to layer imagery. I am trying to load terrain data from my own source i.e. from geoserver on to the cesium globe. I am having trouble following these instructions. I went through the link that you mentioned, but did not find it useful in this regard. If you could help me fix the problem I showed…

Sorry there was a lack of precision. An imageLayer and geoserverTerrainProvider retrieve image data from a server in the same way. If your provider (here geoserver or your java application server) doesn't "trust" your cesium application, the CORS mechanism restricted the access to the resource. You should see http://enable-cors.org/

But it is possible to get other imagery from my geoserver on the cesium globe. You can see the screenshot here. So, I don’t think it is a CORS problem.

Could you send me your server capabilities document?

I don’t know what you mean by server capabilities document, but following is the link to the user manual of Geoserver 2.6.2 that I am using for my purpose --> http://docs.geoserver.org/2.6.2/user/

You can check it out.

I don't know what you mean by server capabilities document, but following is the link to the user manual of Geoserver 2.6.2 that I am using for my purpose --> http://docs.geoserver.org/2.6.2/user/
You can check it out.

    Le mercredi 30 septembre 2015 13:55:37 UTC+2, Parthesh Bulbule a
    écrit :
    > But it is possible to get other imagery from my geoserver on the
    cesium globe. You can see the screenshot here. So, I don't think
    it is a CORS problem.
    >
    > Le mercredi 30 septembre 2015 06:06:29 UTC+2, Parthesh Bulbule a
    écrit :
    >
    > > Actually "bobac", I am not trying to layer imagery. I am
    trying to load terrain data from my own source i.e. from geoserver
    on to the cesium globe. I am having trouble following these
    instructions. I went through the link that you mentioned, but did
    not find it useful in this regard. If you could help me fix the
    problem I showed…
    >
    > >
    >
    > > On Wednesday, September 30, 2015 at 2:45:01 AM UTC+5:30,
    bobac...@gmail.com <mailto:bobac...@gmail.com> wrote:Le mardi 29
    septembre 2015 23:13:20 UTC+2, bobac...@gmail.com
    <mailto:bobac...@gmail.com> a écrit :
    >
    > >
    >
    > >
    >
    > > > > I followed all the instructions given for
    GeoserverTerrainProvider plugin. I am using SRTM 90m data for all
    of India to produce terrain. So as per instructions for SRTM data,
    >
    > >
    >
    > > > > – I used gdal_retile in Osgeo shell to produce tiles
    >
    > >
    >
    > > > > used the following commands in Osgeo shell:
    >
    > >
    >
    > > > >
    >
    > >
    >
    > > > >
    >
    > >
    >
    > > > > mkdir indiapyramid1
    >
    > >
    >
    > > > > gdal_retile.py -v -r bilinear -levels 4 -ps 2048 2048 -co
    "TILED=YES" -targetDir indiapyramid1 india.tif
    >
    > >
    >
    > > > >
    >
    > >
    >
    > > > > – Then I created coverage store with "Imagepyramid"
    plugin in geoserver and added raster source as the tileset created
    by gdal_retile and published the layer. Thus generating pyramid
    using this link.
    >
    > >
    >
    > > > >
    >
    > >
    >
    > > > >
    >
    > >
    >
    > > > > – My pseudo code for terrain provider is as follows:
    >
    > >
    >
    > > > >
    >
    > >
    >
    > > > >
    >
    > >
    >
    > > > >
    >
    > >
    >
    > > > > var viewer = new Cesium.CesiumWidget('cesiumContainer');
    >
    > >
    >
    > > > > var terrainProvider = new Cesium.GeoserverTerrainProvider({
    >
    > >
    >
    > > > > proxy : new Cesium.DefaultProxy('proxy.php'),
    >
    > >
    >
    > > > > //service : "WMS",
    >
    > >
    >
    > > > > url :
    "http://localhost:10000/geoserver/elevation/wms",
    >
    > >
    >
    > > > >
    >
    > >
    >
    > > > > layerName: "indiapyramid1",
    >
    > >
    >
    > > > > //hasStyledImage: false,
    >
    > >
    >
    > > > > //styleName:"grayToColor"
    >
    > >
    >
    > > > > //waterMask:true
    >
    > >
    >
    > > > > });
    >
    > >
    >
    > > > >
    >
    > >
    >
    > > > >
    >
    > >
    >
    > > > > viewer.terrainProvider = terrainProvider;
    >
    > >
    >
    > > > >
    >
    > >
    >
    > > > >
    >
    > >
    >
    > > > > – I am getting this output.(screenshot).
    >
    > >
    >
    > > > > The tiles keep on appearing but changing location
    within the same bounding box of the DEM data.
    >
    > >
    >
    > > > > But when I zoom into the globe I am not getting 3D
    terrain view. As you can see in this screenshot.
    >
    > >
    >
    > > > >
    >
    > >
    >
    > > > > – Using styled geotiff and converted geotiff also results
    into same output.
    >
    > >
    >
    > > > > I am not understanding where I am wrong. Help needed !
    >
    > >
    >
    > > >
    >
    > >
    >
    > > > Hello maybe you have a CORS issue
    >
    > >
    >
    > >
    >
    > >
    >
    > > you should see
    https://cesiumjs.org/2013/01/04/Cesium-Imagery-Layers-Tutorial/
    >
    > Sorry there was a lack of precision. An imageLayer and
    geoserverTerrainProvider retrieve image data from a server in the
    same way. If your provider (here geoserver or your java
    application server) doesn't "trust" your cesium application, the
    CORS mechanism restricted the access to the resource. You should
    see http://enable-cors.org/
    >
    > –
    >
    > 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/DYrbRcljse8/unsubscribe.
    >
    > To unsubscribe from this group and all its topics, send an email
    to cesium-dev+...@googlegroups.com
    <mailto:cesium-dev%2B…@googlegroups.com>.
    >
    > For more options, visit https://groups.google.com/d/optout.

    Could you send me your server capabilities document?

    --
    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/DYrbRcljse8/unsubscribe.
    To unsubscribe from this group and all its topics, send an email
    to cesium-dev+unsubscribe@googlegroups.com
    <mailto:cesium-dev%2Bunsubscribe@googlegroups.com>.
    For more options, visit https://groups.google.com/d/optout.

--
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/DYrbRcljse8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cesium-dev+unsubscribe@googlegroups.com <mailto:cesium-dev+unsubscribe@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.

Attached.

getcapabilities_1.1.1.xml (198 KB)

getcapabilities_1.3.0.xml (193 KB)

For me, the capabilities document it’s OK. Could you oversee your
javascript console and show me the result?

Sorry for the delay, was caught up into something…

I have attached some details you might be interested in along with the js console… Have a look.

– The dem layer preview on geoserver

– Tileset and image formed after gdal retile and publishing layer in geoserver using imagepyramid plugin

– The js console

Hello,
I saw you use defaultProxy. I’d like to see your javascript log (see
ceiusmJs.png) and your network log (see elevation.png)

Hi there,

I think that there is some problem in my proxy.php file since I am not able to get the bil images on cesium globe which you can see from the screenshot of network log. Have a look at the attachments. I am also attaching the proxy.php file that I am using. Please tell me if some changes will be required.

proxy.php (1.46 KB)

I don’t understand what is wrong… If I directly add the image layer from the geoserver of the image pyramid created, I can see it on the globe (PS: indiapyramid.png ) .

Following is my code:

var viewer = new Cesium.CesiumWidget('cesiumContainer');

        // LOAD LAYER
var url='[http://localhost:10000/geoserver/wms](http://localhost:10000/geoserver/wms)'; //Geoserver URL
var layers = viewer.scene.globe.imageryLayers;
layers.removeAll();
layers.addImageryProvider(new Cesium.WebMapServiceImageryProvider({
    proxy : new Cesium.DefaultProxy('proxy.php'),
    url : url,       
    layers: 'indiapyramid1'  // Layer name from geoserver
}));

Hello,
from your attachments, I saw some strange things:

  • Why your data type is xml instead of bil?!?

  • The sizes of your data is very low (0.53 KB instead of 8 KB
    for example)
    Your proxy seems to work for xml files becaus the plugin can
    retrieve the capabilities file from geoserver
    (terrain_ready_true.png).

    Did you install bil/DDS plugin in geoserver?

There is a new development. I was able to get the terrain.
– I created a layer of TrueMarble global image in geoserver
– Removed the reference proxy.php by commenting it

– Removed all image layers using:

var layers = viewer.scene.globe.imageryLayers;

layers.removeAll();

– Inserted the TrueMarble image:

layers.addImageryProvider(new Cesium.WebMapServiceImageryProvider({

url : “http://localhost:10000/geoserver/elevation/wms”,

layers: ‘TrueMarble’

}));

– Then used:

var terrainProvider = new Cesium.GeoserverTerrainProvider({

url : “http://localhost:10000/geoserver/elevation/wms”,

layerName: “indiapyramid1”,

});

viewer.terrainProvider = terrainProvider;

And there it was… Have attached the image… The resolution of the image is very less. Although you can see the terrain

But now the problem is I am not able to get any resources from the internet… I would really like the proxy issue to be resolved.

Or it will be great if you could tell me any other alternative.

If I understand your use case, you’ll need to use a proxy to access
geoserver via internet?

Yes, and not only geoserver, any other online resource like imagery or tile services etc.

OK, it seems the proxy function is in cause (from the plugin or from
your proxy?). Did you try to analyse the URL created by the plugin?