skip to main content
Programmer's documentation > Programming with JViews Maps for Defense > Map Defense GUI interactors > Valleys and Elevated Areas interactor
 
Valleys and Elevated Areas interactor
Describes the Valleys and Elevated Areas interactor.
*Overview
*Explains the use of the IlvMakeValleyInteractor class to display color-coded valley and elevated areas within a selected rectangle.
*Creating and installing the Valleys and Elevated Areas interactor
*Provides code for creating the Valleys and Elevated Areas interactor.
*Using Valleys and Elevated Areas interactor
*Describes the functioning of the Valleys and Elevated Areas interactor and the style parameters that can be used.
Overview
The IlvMakeValleyInteractor allows the users to display color coded valley and elevated areas within a rectangle selected in a manager view. This interactor displays the peaks and valleys of the terrain, that is, the highest and lowest points.
To use this interactor, the user selects the area for which valleys and elevated areas are to be computed and defines the initial style and parameters to use for the computation in a dialog box. A new area, colored according to the status (valley, elevated area or undetermined) of each terrain point, is added to the map.
The following figure shows an example of a valley computation.
Valley computation
The source code for the Map Builder demonstration, which contains all of the code described in this section, can be found at <installdir> /jviews-maps/samples/mapbuilder/index.html
Creating and installing the Valleys and Elevated Areas interactor
To create this interactor, use the following line of code:
 
IlvMakeValleyInteractor interactor=new IlvMakeValleyInteractor();
You can then install this interactor as is described in the Using the GUI beans section in Programming with JViews Maps.
Using Valleys and Elevated Areas interactor
When the interactor is used, it creates an IlvTiledRasterDataSource. This data source is based on an IlvComputedRasterReader that computes a single image from the altitude data. The computation of status values is made through the implementation of IlvImageComputation by the interactor.
At the same time, the interactor creates an IlvMapLayer to display this new graphic object and adds it to the map layer tree under a Terrain Analysis group. the user can use the style of that layer, an IlvValleyRasterStyle, to customize the appearance of that particular valley or elevated area zone in the map layer tree. This is done by changing the following parameters:
*The Boundsattribute. Describes the area of interest for which the status computation is made.
*The Color Modelattribute. Describes the color of different status values within the area bounds.
*The Altitude Toleranceattribute. Describes the maximum altitude difference used to detect whether a point is outside a valley or elevated area.
*The Precision attribute. An algorithm samples the map altitude data, taking according to the value of the precision attribute, for example, every 100 meters. It then constructs the areas from this table of altitudes.

Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.