Query elevation without displaying elevation layer

classic Classic list List threaded Threaded
3 messages Options
Josiah425 Josiah425
Reply | Threaded
Open this post in threaded view
|

Query elevation without displaying elevation layer

I have an elevation layer that is created from a vrt file containing DTED elevation data.  I add this layer to my Map, but I don't want the map to actually display the bulging out terrain.  Therefore, I set the layer's visibility to false.  I don't want it displayed, but I do want my elevation queries to still work properly.  Is there a way to achieve this using anything convenient in osgEarth?

Essentially, I am only loading 9 tiles of DTED at any given time out of hundreds (each 1 lat long in size).  As I pan around, I add and remove tiles that are around my current viewpoint.  If I add and remove the elevation layers, I get a blinking effect (probably because of the refresh function being called whenever an elevation layer is added to the map or removed from the map).  I want to be able to prevent this, so I simply removed the elevation layer but kept my hillshade and color tifs loaded in.

So, is there a way to stop the blinking effect when adding elevation layers or is there a way to grab elevation data without ever adding elevation layers / hiding elevation layers?

Edit: I am using osgEarth 2.10, and I tried both elevation query and elevation envelopes from the elevation pool attached to the map
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Query elevation without displaying elevation layer

Josiah,
I assume your actual objective is to query elevation data (without rendering it).

Create a Map object, add your layer, and use the Map's ElevationPool to sample it.

If you don't want to render the data then don't add the Map to a MapNode in the scene graph.
Glenn Waldron / Pelican Mapping
Josiah425 Josiah425
Reply | Threaded
Open this post in threaded view
|

Re: Query elevation without displaying elevation layer

This is exactly what I wanted, thanks.  It's working properly now.