ADJDEM

Adjust DEM by using surface fit


EnvironmentsPYTHON :: EASI :: MODELER
Quick linksDescription :: Parameters :: Parameter descriptions :: Details :: Example

Back to top

Description


ADJDEM adjusts an extracted digital elevation model (DEM) by using points with elevation information that you provide. Each elevation value is adjusted according to the heights of the reference points. ADJDEM is especially useful for removing systematic errors in a DEM.
Back to top

Parameters


adjdem(file, dbec, dboc, dbseg, dbiw, order, failvalu, backelev, fldnme)

Name Type Caption Length Value range
FILE * str Input file name 1 -    
DBEC * List[int] Input elevation channel or layer 1 - 1  
DBOC List[int] Output DEM Channel 0 - 1  
DBSEG * List[int] Input reference point segment 1 - 1  
DBIW List[int] Input window 0 - 4  
ORDER List[int] Polynomial Order 0 - 1 1 - 2
Default: 1
FAILVALU List[int] Failure value 0 - 1 Default: -100
BACKELEV List[float] Background elevation value 0 - 1  
FLDNME str Field name 0 - 64 ATTRIBUTE, ELEVATION, ZCOORD
Default: ATTRIBUTE

* Required parameter
Back to top

Parameter descriptions

FILE

The name of the PCIDSK file that contains the DEM channel or layer.

DBEC

The input DEM channel or layer to adjust.

DBOC

The output DEM channel in which to store the adjusted results.

DBSEG

The segment containing the reference points. The segment can be either ground control points (GCP) or vector points that contain attribute data.

DBIW

The raster window (Xoffset, Yoffset, Xsize, Ysize) in the image in which to adjust the DEM. If no value is specified for this parameter, the entire image is used by default. Xoffset and Yoffset define the upper-left starting pixel coordinates of the window. Xsize specifies the number of pixels that define the window width. Ysize specifies the number of lines that define the window height.

ORDER

The order to use for the surface fit to the DEM.

Acceptable values are:

FAILVALU

The gray-level value that represents the failure value inside the DEM. This value is usually the one used during DEM extraction.

BACKELEV

The gray-level value that represents the background value inside the DEM. This value is usually the one used during DEM extraction.

FLDNME

The name of the attribute from which the value will be used to adjust the extracted DEM.

When you specify ZCOORD, the z-coordinate of the first vertex of each vector shape is used. The default is ATTRIBUTE.

Values include:
Back to top

Details

ADJDEM adjusts an extracted DEM by using reference elevation values, such as SPOT elevation values. The algorithm first computes the errors between the extracted DEM and the reference DEM. A first-order or second-order two-dimensional polynomial surface is then fitted to the errors. Each elevation value within the input window is then adjusted according to the fitted surface. ADJDEM is especially useful for removing systematic errors in a DEM.

With the FILE parameter, you specify the database file that contains the input DEM channel (DBEC) and, optionally, the output DEM (DBOC). You specify the reference DEM with the the DBSEG parameter. The reference DEM can be either a GCP segment or a vector point segment. If the reference DEM is a GCP segment, ADJDEM uses the geocoded coordinates inside the segment as reference. The pixel and line coordinates inside the GCP segment are therefore unimportant. This is useful when you acquire the reference elevation value from maps in which the location is difficult to identify in the image. If the reference DEM is a vector point segment, the geocoded coordinate and its attribute as reference elevation are used. The number of points must be greater than three for the algorithm to run.

As an option, you can specify the output channel (DBOC) in which to save the adjusted DEM results. If you do not specify an output channel, only an adjusted error report will be produced (report parameter must be ON/filename).

You can choose between a first-order and second-order polynomial surface fit. You must also specify the failure value and the background elevation value in the DEM to ensure that these values are not adjusted.

ADJDEM will produce an RMS-error report before and after adjustment when you specify a value of ON for the Report Mode (REPORT) parameter. The default name of the report is adjdem.rpt; however, you can overwrite the default with a file name you specify.

Back to top

Example

The user has created a geocoded DEM using one of the DEM extraction functions. Several reference elevation points were collected and stored in a GCP segment. Run ADJDEM to adjust the DEM.

from pci.adjdem import adjdem

file = 'irvine.pix'
dbec = [10]             #input the elevation data
dboc = [8]             #to store the adjusted result
dbseg = [27]           #segment number to store reference GCPs
dbiw = []               #process entire window
order=[2]               #use 2nd order
failvalu = []           #defaulted to -100.
backelev  = []          #defaulted to -150.
fldnme = 'ShapeId'      #use ShapeId field

adjdem(file, dbec, dboc, dbseg, dbiw, order, failvalu, backelev, fldnme)

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.