geojson not draped in the elevated region

I have a shape (.shp) file of a particular area, which i converted to .geojson and rendered it over my map. This geojson has LineString features.
Next, i change my openlayers3 to ol3cesium globe mode.

Since i have rendered elevations (.terrain) , i can see elevations of that same area.

But i dont see the linestrings draped on the elevated areas (hills), i can see them floating over them as a 2d.

What could be the issue?

Hi,

You need to set the clampToGround altitudeMode in the layer. See how it is done in the vector example:
https://github.com/openlayers/ol-cesium/blob/master/examples/vectors.js#L315

It will then use the corridor hack to render the lines on the terrain.

Not that the lines are only visible when you are close to the terrain.

BR,

Guillaume Beraudo

Hi there,

Here are some examples of ground clamping. Hope that helps! http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Ground%20Clamping.html&label=Showcases

Note that height should not be set in order for ground clamping to work.

Hope that helps,

  • Rachel

Hi,

I tried with a single rectangle, having hard-coded degrees. I could see draping of the polygon over the elevations.

Below is the code:

var rectangleInstance = new Cesium.GeometryInstance({

geometry: new Cesium.RectangleGeometry({

rectangle: Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0)

}),

id: ‘rectangle’,

attributes: {

color: new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5)

}

});

this.scene.primitives.add(new Cesium.GroundPrimitive({

geometryInstances: rectangleInstance

}));

But now my query is how do i link my (polygon features) geojson file lat-lon degrees of many features to the above code?

Hi,
I achieved polygon draping over elevations using altitudeMode = 'clampToGround' alone.

But not achieving the same for LineString geometry of geojson. How to do that?
I added the same code in the Linestring features geojson vector layer. But lines are not draped over elevations.

Dana petak, 23. lipnja 2017. u 08:26:53 UTC+2, korisnik nigamr...@gmail.com napisao je:

But now my query is how do i link my (polygon features) geojson file lat-lon degrees of many features to the above code?

This is working for me:


viewer.dataSources.add(Cesium.GeoJsonDataSource.load(‘…/geojson/NP_poly.geojson’, {
clampToGround : true,
stroke: Cesium.Color.DARKGREEN,
fill: Cesium.Color.GREEN.withAlpha(0.5),
strokeWidth: 3,
})

Hi Davor,

Yes, I have successfully achieved polygon draping but haven’t achieved linestring draping using geojson.

I wrote the same in my last post.

Also, the linestrings are going underground, they are not visible over the map elevations, but can be seen on zooming a lot - below the ground.

Hi there,

This may be related to the fact that we don’t currently support ground clamping for polylines. As a workaround, you can use corridors instead.

Hope that helps,

  • Rachel