GeoServer and Cesium for Terrain Rendering

i just download the geoserver and execute the startup.bat to run it. of course the Java is installed beforehand....btw, i changed the port from 8080 to 8090

the srtm data is preprocessed before and loaded into geoserver.

and in the same machine i use node.js to rin the web server. the port is 8080.

that is all....

Sorry I can't help you, I don't know how to manage CORS issue with geoserver in standalone application.

bobac...@gmail.com於 2015年1月8日星期四 UTC+8下午10時37分21秒寫道:

ccye...@gmail.com於 2015年1月9日星期五 UTC+8下午3時00分06秒寫道:

bobac...@gmail.com於 2015年1月8日星期四 UTC+8下午10時37分21秒寫道:
> > i just download the geoserver and execute the startup.bat to run it. of course the Java is installed beforehand....btw, i changed the port from 8080 to 8090
> >
> > the srtm data is preprocessed before and loaded into geoserver.
> >
> > and in the same machine i use node.js to rin the web server. the port is 8080.
> >
> > that is all....
>
> Sorry I can't help you, I don't know how to manage CORS issue with geoserver in standalone application.

I see, so geoserver can be run in another form (not under JAVA), I got it!
May I ask you how you run your geoserver and how you treat your CORS issue under that.
Hope it doesn't bother you too much..^^

I guess I already found the mistake....
because I run geoserver in different port (8090) and I run the Cesium web service in 8080 so the resource can't be shared ....

could you please tell me how to run these two service into one web server? (the same port )

I don't think that is the good approach. The easiest way is to install geoserver in a java application server (tomcat, jboss, jetty..) and after you configure the server to allow the resource share.
On the same machine you can't have two applications listening the same port (8080 or 8090)

Hello farouk,

Trying to add terrain using geoserver using

Cesium.GeoserverTerrainProvider says it is not a function.

Please help.

regards
Jai

Sorry,
could you explain what you did?

Previous error is gone now.

I included GeoServerTerrainProvider.js

but now facing a new challenge .

It says Uncaught typeerror : can not read property ‘getContext’ of undefined on var scene= new Cesium.Scene(canvas); line

I am using latest cesium version. Please, help.

Could you send your code please?

<html>
<script src="Cesium-1.26/Build/Cesium/Cesium.js" type="text/javascript"></script>
<script src="Cesium-GeoserverTerrainProvider-master/GeoserverTerrainProvider.js" type="text/javascript"></script>
  <style>
      @import url(./Cesium-1.26/Build/Cesium/Widgets/widgets.css);
      html, body, #cesiumContainer {
          width: 100%; height: 100%; margin: 0; padding: 0; overflow: hidden;
      }
  </style>
<body>
<canvas id="cesiumContainer"></canvas>
<script>
    var canvas = document.getElementById('cesiumContainer');
    var scene = new Cesium.Scene(canvas);
    var primitives = scene.primitives;
    var globe = new Cesium.Globe(Cesium.Ellipsoid.WGS84);
    scene.globe=globe;s

    var terrainProvider = new Cesium.GeoserverTerrainProvider({
        url : "http://localhost:8080/geoserver/wcs/wms",
        layerName: "wcs:clip11(reproject)",
        waterMask:true
    });
    globe.terrainProvider = terrainProvider;
    var hand = new Cesium.ScreenSpaceEventHandler(canvas);
    // return altitude with double click in console.log!!
hand.setInputAction(
            function (movement) {
                if(movement.position != null) {
                    var cartesian = scene.camera.pickEllipsoid(movement.position, ellipsoid);
                    if (cartesian) {
                        var cartographic = ellipsoid.cartesianToCartographic(cartesian);
                        cartographic.height=globe.getHeight(cartographic);
                        console.log("lat= "+(cartographic.latitude*180/Math.PI)+"°; long="+(cartographic.longitude*180/Math.PI)+"°; altitude="+cartographic.height+" meters")
                    }
                }
            }, Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
</script>

</body>
</html>

this is my code. I get the same error as mentioned above

Uncaught typeerror : can not read property 'getContext' of undefined on var scene= new Cesium.Scene(canvas)

Hello and sorry, I can’t reproduce your issue.
For information you should use http://localhost:8080/geoserver/ows instead of http://localhost:8080/geoserver/wcs/wms

I need to get a demo working with Cesium and Geoserver. Is there a link with the latest info about having the two technologies working together? Is the GeoserverTerrainProvider the best bet? This post is a couple of year old at this point, so I was wondering if there was any new information.

Scott

Hello, I try to maintain GeoserverTerrainProvider in compliance with Cesium version. But I can’t say if it’s the best plugin for your use case.

Hi @abdou, does your plugin work for latest cesium js version (1.89)? As I tried it but I am getting many issues. I’ll share my issues, but before that I want to make sure if your plugin is suitable for the latest cesium version. Please write back to me as soon as possible. I am trying to create terrain from dem data using geoserver for cesium js.
Thank you

Hello, I just update the repository to be compliant with cesium 1.95

@abdou ,Thank you for the update