Tuesday, October 2, 2007

Real time terrain cross section in WWJ

What does Antarctica looks like if you slice it in two?

Here is a fun visualization tool prototype layer for WWJ. It displays a real time terrain profile in a screen corner. The section plane itself will either follow the view position or the mouse cursor, allowing you to 'scan' entire continents, oceans and mountain ranges at any scale in a single hand gesture.


Download TerrainProfileLayer.java (updated oct. 30) and add it to worldwind.layers.earth, after removing the .txt extension. In BasicDemo, add the layer before or after the compass. Important: this layer implements a PositionListener and needs to have its event source set before it will operate:


new BasicDemo.LayerAction(new TerrainProfileLayer(), true),
new BasicDemo.LayerAction(new CompassLayer(), true)
...
for (BasicDemo.LayerAction action : layers) {
...
if (action.layer instanceof TerrainProfileLayer)
((TerrainProfileLayer)action.layer).setEventSource(this.wwd);
}



You can set the profile graph to maintain the distance/elevation proportion to have exact slopes (not the case in the above screenshot though), but it is a lot less fun for wide range sections.

3 comments:

loic said...

no link to the TerrainProfileLayer.java source code ? ... very impress by you work for the WWJ community.

Jean said...

Salut patmurris,

Bravo, c'est vraiment chouette tes apports à wwj. Est-ce que tu sais quand il sera possible d'importer du MNT plus précis ? Ca serait vraiment top, ça fait partie eds principales limitations de wwj pour l'instant !
A+
Jean

Patrick Murris said...

Merci ;)
L'incorporation de données d'élévation locales est sur la liste des 'choses-a-faire' avec beaucoups d'autres sujets... Je ne connais pas de date, mais la question revient souvent et une solution sera certainement proposée.
Quels formats de donnée seraient les plus utiles ?