Quantcast

TerrainProfile of a Region?

classic Classic list List threaded Threaded
5 messages Options
Anthony Anthony
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

TerrainProfile of a Region?

Hi,

I'm trying to get the min/max elevation of an osgEarth MapNode for a given region, by specifying the NE, SE, NW, SW corners.

Looking at osgEarthUtil::TerrainProfileCalculator I can see that it's using the ElevationSlice class, which uses a PlaneIntersector to get all of the terrain points along a plane.

I figured I could do a similar thing with a PolytopeIntersector to get all terrain points within the Polytope. This class isn't really documented comprehensively though.

Does anyone have any advice on how I can achieve this? My end goal is to just define a region and get the min/max elevation in the region.

Thank you!
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TerrainProfile of a Region?

Anthony,
There is a bit of code GeoExtent::createPolytope that creates a polytope that bounds a geographic extent. You could use this to create a polytope for your intersector.

https://github.com/gwaldron/osgearth/blob/master/src/osgEarth/GeoData.cpp#L1284

Hope this helps.
Glenn Waldron / Pelican Mapping / @glennwaldron
Anthony Anthony
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TerrainProfile of a Region?

Thanks Glenn

Is there an example anywhere that you know of that shows how use use the results from the Polytope intersector?

I found the createPolytope function, however there only seems to be one result from the intersector. Note that I'm not using a Viewer anywhere, I'm just using osgEarth as a terrain database (using .earth files is a specific use case for the software).

I know that the ElevationSlice class does pretty much the same thing but with a PlaneIntersector.

gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TerrainProfile of a Region?

Not that I know of, sorry!

If you are not running a viewer, there is a chance that only the first LOD of the terrain is getting built. The terrain only subdivides during the Cull traversal during the normal course of a frame loop.
Glenn Waldron / Pelican Mapping / @glennwaldron
Anthony Anthony
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TerrainProfile of a Region?

OK, is there a way to force this without having to do a cull traversal?

Ideally it's be a way to get the terrain engine to page in the highest level of detail for the region of interest.
Loading...