CONTOUR -- Contour Generation from Raster Image

Creates a vector segment containing contour lines from a raster image, such as an elevation (DEM) image, given a specified contour interval. The contour value for each line is saved in either the Z-coordinate of all vertices or in a separate attribute field.

Progress of this program can be monitored. See MONITOR section.

See Also: NNINT, RBFINT, IDINT, RTV, GRDVEC, GRDINT

PARAMETERS

CONTOUR is controlled by the following global parameters:

Name     Prompt                                  Count     Type
FILE     Database File Name                      1-64      Char
DBEC     Database Elevation Channel              1         Int
DBIW     Database Input Window                   0-4       Int
DBSN     Database Segment Name                   1-8       Char
DBSD     Database Segment Descriptor             0-64      Char
CONTINT  Contour Interval and Offset             1-2       Real
BACKVAL  Background Grey-level Value             0-1       Real
FLDNME   Attribute Field Name                    0-64      Char

The following parameter receives output:

LASC     Last Segment Created                    1         Int

FILE

Specifies the name of the PCIDSK file from which the elevation image is read and to which the contour vector data is written.

 EASI>FILE="filespec"

DBEC

Specifies the image channel containing raster or elevation (DEM) data. The input image channel can be any type. DEM data is usually 16-bit signed integer.

 EASI>DBEC=i

DBIW

Specifies the input image window in which to create contour vectors.

 EASI>DBIW=xoffset,yoffset,xsize,ysize
 EASI>DBIW=                             | use entire image

DBSN

Specifies an 8-character quick identifier for the new vector segment.

 EASI>DBSN="name"

DBSD

Optionally specifies a 64-character descriptor for the new vector segment.

 EASI>DBSD="descriptor"

CONTINT

Specifies the contour interval between contour lines and (optional) offset added to each contour value.

 EASI>CONTINT=interval          | Contour interval with zero offset
 EASI>CONTINT=interval,offset   | Contour interval with offset

LASC

This parameter is assigned the segment number of the new vector segment created by this program.

FLDNME

  Valid Values:   ATTRIBUTE, ZCOORD, ELEVATION
  Default:        ATTRIBUTE
Specifies the name of the double-precision field in which to store the contour value. The field name is not case sensitive.

 fieldname =              | Field name defaults to ATTRIBUTE
 fieldname = ZCOORD       | Use Z-coordinate of vertices
 fieldname = ELEVATION    | Use the specified field name

BACKVAL

  Valid Values:   0.0 >= x,  x >= 0.0
  Default:        <none>
Specifies a background grey level value for the input raster or elevation (DEM) image.

MONITOR

Program progress can be monitored by printing the percentage of completed processing in odometer fashion. A system parameter, MONITOR, controls this activity:

 EASI>MONITOR="ON"          | turn monitor ON  (default)
 EASI>MONITOR="OFF"         | turn monitor OFF (recommended if
                              running in batch/background mode)

DETAILS

CONTOUR is used to create a set of elevation contours based on a raster or DEM image. The CONTOUR program should be used instead of the RTV program for this purpose.

CONTOUR creates a new vector segment containing contour lines, given a rectangular window (DBIW) of a raster or elevation (DEM) image (DBEC) on a PCIDSK file (FILE). The contour value of each line is assigned either to Z-coordinates for vertices (FLDNME="zcoord") or to a double-precision field specified by FLDNME.

The contour interval (CONTINT(1)) specifies the interval between the contour values for each line. An optional offset (CONTINT(2)) is added to each contour value. The offset defaults to zero.

For example, assume that DBEC is a 32-bit real image containing values from -0.4 to +0.7, and CONTINT is set as follows:

 EASI>CONTINT=0.2,0.1
This would generate contours at -0.3, -0.1, 0.1, 0.3, 0.5 and 0.7. The new vector segment is given a segment name (DBSN) and descriptor (DBSD). The vector segment contains only lines (no interior points).

Input pixels set to the background value are assumed to have an unknown elevation, and are not used for contour generation. If the background grey level value is not specified, then all input pixels are assumed to have valid elevation values. The background grey level value is normally set to zero, where the raster image is not rectangular and zeros are used around the border of the image.

The locations of the vertices for the contour lines are interpolated from the input image data.

The georeferencing segment on the PCIDSK file defines the units used for the vertices.

The vector segment created by CONTOUR can be used by interpolation programs (such as NNINT, RBFINT, IDINT and others) to create an interpolated raster image, which should look similar (though not identical) to the original input image.

The vectors produced by CONTOUR differ from RTV vectors as follows:

EXAMPLE

Create elevation contours from the 16-bit signed integer DEM stored on image channel 10 of irvine.pix. The DEM pixel values measure elevation above sea level, and range between 40 and 883 metres. The entire channel contains valid DEM data (no background value). The contour value is saved in the field called "Elevation". A new vector segment is created on irvine.pix, to contain the elevation contours. Either ImageWorks or the IVV program can be used to transfer the contours to the display.

The contour interval is 100 metres with no offset. Therefore, contours are created at 100, 200, 300, 400, 500, 600, 700, and 800 metres.

 EASI>FILE="irvine.pix"
 EASI>DBEC=10
 EASI>DBIW=
 EASI>DBSN="CONTOURS"
 EASI>DBSD="100 metre contour interval"
 EASI>CONTINT=100
 EASI>BACKVAL=
 EASI>FLDNME="Elevation"
 EASI>RUN CONTOUR
If the contour interval were 250 with an offset of 125, then contours would be created at 125, 375, 625 and 875.

 EASI>DBSD="250 metre contours with 125 offset"
 EASI>CONTINT=250,125
 EASI>RUN CONTOUR

About PCI Help Gateway