Transforming Between Elevation Models

Contouring a raster DEM

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Contours a DEM with a 5m vertical interval at the finest resolution of the raster.
version(1.0);

# Change the directory below to correspond to your file location.
baseDir = "c:/Program Files/LandSerf/data/landscriptExamples/";

# Open a surface raster and contour it at 50m vertical intervals.
dem = open(baseDir&"dem.srf");

minHeight = round(info(dem,"min")/10)*10;
contours = contour(dem,minHeight,50,1);

# Colour all contours brown and add metadata
colouredit(contours,"rules","0 50 10 0");
edit(contours,"notes","Contours through "&info(dem,"title")&" at 50m vertical interval");

# Save the new contour vector map.
save(contours,baseDir&"contours.vec");

Creating a TIN from a DEM

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Creates a TIN from a DEM with average error of 5% of DEM's standard deviation 
version(1.0); 
 
# Change the directory below to correspond to your file location. 
baseDir = "c:/Program Files/LandSerf/data/landscriptExamples/"; 
 
# Open a surface raster. 
dem = open(baseDir&"dem.srf"); 
 
# Used to define precision of triangulation 
avError = round(info(dem,"stdev")*0.05); 
 
# Perform the triangulation 
tin = triangulate(dem,"null",avError,"null"); 
 
# Save the new TIN as a vector map. 
edit(tin,"notes","TIN derived from "&info(dem,"title")&" with max error of "&avError); 
save(tin,baseDir&"tin.vec");