Contour lines to DEM: Difference between revisions

From GRASS-Wiki
Jump to navigation Jump to search
Line 1: Line 1:
== About ==
== About ==


[[Image:Elev_lid792_cont1m.png|right|thumb|The base elev_lid792_cont1m contour lines]]
[[Image:Elev_lid792_cont1m.png|right|250px|thumb|The base elev_lid792_cont1m contour lines]]


This page will demonstrate and compare a number of different methods of converting vector contour lines into raster DEM surfaces.
This page will demonstrate and compare a number of different methods of converting vector contour lines into raster DEM surfaces.
Line 14: Line 14:
We can display it on a Xmonitor to be sure:
We can display it on a Xmonitor to be sure:
  d.mon x0
  d.mon x0
  d.vect elev_lid792_cont1m -z zcolor=elevation
  d.vect elev_lid792_cont1m -z zcolor=haxby


A number of the r.surf.* modules want the input data to be in raster form already, so we rasterize the contour lines, using the ''level'' column for the height values. Also some of the older r.surf.* modules only like to work on integers, so to preserve sub-meter fidelity we do a little trick where we multiply by a large number, do the process, then divide by that number again.
A number of the r.surf.* modules want the input data to be in raster form already, so we rasterize the contour lines, using the ''level'' column for the height values. Also some of the older r.surf.* modules only like to work on integers, so to preserve sub-meter fidelity we do a little trick where we multiply by a large number, do the process, then divide by that number again.

Revision as of 15:24, 27 February 2010

About

The base elev_lid792_cont1m contour lines

This page will demonstrate and compare a number of different methods of converting vector contour lines into raster DEM surfaces.

It uses the North Carolina sample dataset's elev_lid792_cont1m 1m contour line map as the starting point.

First we set the computational region to match the contour lines vector map, and then we force the resolution to align with a 1m grid:

g.region vect=elev_lid792_cont1m
g.region res=1 -ap

We can display it on a Xmonitor to be sure:

d.mon x0
d.vect elev_lid792_cont1m -z zcolor=haxby

A number of the r.surf.* modules want the input data to be in raster form already, so we rasterize the contour lines, using the level column for the height values. Also some of the older r.surf.* modules only like to work on integers, so to preserve sub-meter fidelity we do a little trick where we multiply by a large number, do the process, then divide by that number again.

v.to.rast in=elev_lid792_cont1m out=elev.1mcont \
  type=line column=level
r.mapcalc "elev.1mcont.100k = elev.1mcont * 100000"

r.surf.idw

(and r.surf.idw2)

r.surf.nnbathy

v.surf.rst

r.surf.contour

Reference images