Tag Archive for: Geomatica

Color Shaded Relief Models

A color shaded relief (CSR) utilizes chromo stereoscopic techniques to help emphasize the depth of the Z dimension from traditional shaded relief models that already portray the presence of an elevation difference. Using carefully edited …

Digital Terrain Modeling

Digital Terrain Modeling is the process of simulating or representing the relief and patterns of a surface with numerical and digital methods. It has always been an integral component to geology related fields such as geomorphology, hydrology, tectonics and oceanography but over the past decade has also become a major component to non geophysical applications such as GIS modeling, surveying and land use planning.

Terrain Models are derived from data represented by digital elevation models (DEMs) and can include shaded relief models, slope and aspect models, perspective scene generation, and drainage basin analysis (and other models).

Script to generate a PIX file large enough to contain all input DEM files

Below is a simple EASI script used with the MODEL command in PCI will generate an output PIX file with extents large enough to contain all of the input files PIX files and then mosaic each of the input files into the output pix file. It was designed to mosaic several DEM files into one large DEM file.

This was originally created for PCI Geomatica v9.1 but was last tested and working with no problems in PCI Geomatica v10.0 – Just copy the code below into a blank text file and edit as needed.

!—————————————————————————-

! Multiple DEM Mosaic Script
! [mul_DEM_mosaic.eas]

! Ted MacKinnon – tmackinnon.com
!
! This script will generate an output PIX file with extents large enough
! to contain all of the input files and then mosaic each of the input
! files into the new output pix file.
!
! This script was designed to mosaic several DEM files into one large
! DEM file. Each input DEM file must have the same projection,
! resolution and at each DEM should have at least 150m overlap.
!
! The user is expected that the user will enter (or verify) the parameters
! of ‘CIMPRO’ at the bottom of this script prior to running the script.
! Parmaters such as BXPXSZ and DBIC have been hard coded.

!—————————————————————————-
!—————————
! Define variables
!—————————

!for input & output pix files and pixel size

local string inputFile, outputFile
local string pixel

!to obtain list of input files
local mstring inputList
local integer inputIndex

!for extracting georeferencing information

local GeoInfo geoInfo
local integer geoFile

!to contain bounding rectangle of all input files

local double boundULX, boundULY, boundLRX, boundLRY

!—————————————————————————-
! Clear the EASI window and then show the header information
!—————————————————————————-

PRINT @(1 ,1,CLREOS)

print “———————————————————————–

print @reverse,” ‘Mosaic multiple DEM files’ EASI Script “,@alloff
print “”
print “”
print “”
print “———————————————————————–“
print “”
print ” This script will generate an new output PIX file with extents large “
print ” enough to contain all of the PIX files in this directory and then “
print ” mosaic each of the PIX files into the new output file.”
print “”
print ” The output file will contain the following projection: “
print “”

! The projection will be printed to the screen as a general reminder

print ” UTM 11 S E000″

print “”
print “———————————————————————–“
print “”

!—————————————————————————-
! Collect input from user
!—————————————————————————-

print “”
print “Enter the Output file name:”
input “>” outputFile
print “”

print “Enter the pixel size for: “,outputfile

input “>” pixel

print “”
print “”

PRINT @(1 ,1,CLREOS)

!—————————————————————————-
! Create list of input files
!—————————————————————————-

sys “dir *.pix /b > pixlist.txt”

inputList = Text$Import(“pixlist.txt”)

!—————————————————————————
! Read georeferencing of each input file
!—————————————————————————-

for inputIndex = 1 to F$LEN(inputList)

print inputList(inputIndex)

geoFile = DBOpen(inputList(inputIndex), “r”)
call DBReadGeoInfo(geoFile, geoInfo)
call DBClose(geoFile)

print “Georeferencing: “, geoInfo.Units
print “Image extents: “,geoInfo.ULX, “, “, geoInfo.ULY, ” “, geoInfo.LRX, “, “, geoInfo.LRY

PRINT @(1 ,1,CLREOS)

!————————————————————————-
! initialize bounds using first file
!————————————————————————-

if inputIndex = 1 then

boundULX = geoInfo.ULX
boundULY = geoInfo.ULY
boundLRX = geoInfo.LRX
boundLRY = geoInfo.LRY

else

!———————————————————————–
! assumes UTM projection (ULY > LRY)
!———————————————————————–

if geoInfo.ULX < boundULX then
boundULX = geoInfo.ULX

endif

if geoInfo.ULY > boundULY then

boundULY = geoInfo.ULY

endif

if geoInfo.LRX > boundLRX then

boundLRX = geoInfo.LRX

endif

if geoInfo.LRY < boundLRY then
boundLRY = geoInfo.LRY

endif

endif

print “”

endfor

print outputFile, ” file extents: “, boundULX, ” “, boundULY, ” “, boundLRX, ” “, boundLRY

!—————————————————————————-
! create the output PIX file containing bounds
!—————————————————————————-

FILE = outputFile
TEX1 =

!Specify the # of channels here

DBNC = 1,0,0,0
DBLAYOUT = “PIXEL”

!Specify the projection info here

PROJECT = “UTM”
ZONE = 11
ROW = “S”
ELLIPS = “0”
LLBOUND = “N”

ULX = F$STRING(boundULX)
ULY = F$STRING(boundULY)
LRX = F$STRING(boundLRX)
LRY = F$STRING(boundLRY)
BXPXSZ = pixel
BYPXSZ = pixel
REPORT = “TERM”

run CIMPRO

!—————————————————————————-
! Mosaic each PIX file from the listing into the outputfile
!—————————————————————————-

inputList = Text$Import(“pixlist.txt”)

for inputIndex = 1 to F$LEN(inputList)

inputFile = inputList(inputIndex)

!————————————————————————–
! Clear the EASI window and show progress
!————————————————————————–

PRINT @(1 ,1,CLREOS)

print “”
print “Mosaicking “, inputFile, ” into “, outputFile
print “”

FILI = inputFile
DBIC = 1
DBVS =
DBLUT =
FILO = outputFile
DBOC = 1
BLEND =
BACKVAL = 0

run MOSAIC

endfor
!—————————————————————————-
!—————————————————————————-

Color Shaded Relief Model – Irvine, California

3D CSR Irvine California

The screen grab above was captured during the process of creating a color shaded relief model of Irvine, California. It was created in one of many demos I gave to clients while working for PCI Geomatics and was also used in the following tutorial that I created for the PCI geomatics website.

PCI Geomatics is a world leading developer of image centric geomatics software solutions. The PCI Geomatics flagship software, Geomatica, meets the growing demands of the remote sensing, GIS, cartography, and photogrammetry worlds. PCI Geomatics has long been recognized for offering high-value geomatics software solutions, advanced algorithms, excellent customer assistance, and product support for the widest range of spatial data formats in the industry.