Derives contour lines (isolines) from grid models and stores them as a vector dataset.
Contour lines are a convenient method to get a cartographic 2D representation of the 3D structure of a DTM. Typically an interval will be specified to get contour lines with equally spaced height intervals. The zRange may be specified optionally to reduce this height range. Individual levels may be specified alone or together with interval.
The contour lines can be additionally controlled by the following parameters: Small closed contours can be suppressed with parameter closeMin. Closed contours smaller than the given minimum area will not be written to the output file.
To derive the contour lines densification points will be calculated to get more pleasant results at the expense of calculation time. The calculation of these intermediate points may be suppressed by setting the option densification to false
.
There is another option thinOut to reduce the number of points in the output file. The number of points is reduced by using the Douglas-Peucker algorithm. This is done by default using a very low perpendicular tolerance of 0.01 (1 cm) not to change the contour lines in an unexpected manner. Be careful using this parameter with higher values, because the local shape of contours may change unexpectedly.
The data used in the subsequent examples are located in the $OPALS_ROOT/demo/ directory and the following preprocessing steps (data import and surface grid calculation) are required:
The first example shows a typical run of opalsIsolines specifying the mandatory parameter inFile together with parameter interval.
It produces contour lines from the DTM fullwave2_dtm.tif
with a contour interval of 5 meters.
In the second example only the mandatory parameter inFile is specified. Thus, the command is very short and simple:
It produces contour lines from the DTM flyover_dtm.tif
with an equidistant interval estimated from the z-range of the DTM. The interval is estimated and rounded to a commonly used interval out of 10, 20, 25, 50 times a power of 10. In this case opalsIsolines estimates an interval of 1 m, which is fairly suitable. But typically one will specify an interval customized to the project (like in the first example).
In example 2 we can see that in rough terrain we will get a lot of small closed contours. This type of fragmented contours are often not wanted in contour maps. We can suppress the output of such small closed contour lines specifying the additional option closeMin with a reasonable value for the minimum area of a closed contour line to be selected for output.
In this case all closed contours with an area smalles than 10 square meters will be suppressed.
Another option (zRange) allows us to limit the height range to a lower and upper limit. Only contour lines beetween these limis will be produced.
It is also possible to generate contour lines of individual levels by using the option levels and explicitly specifying the wanted levels.