[GRASS-user] DEM with bathymetric contour lines

Markus Neteler neteler at osgeo.org
Tue Jun 2 06:40:55 PDT 2015

Hi again,

On Tue, Jun 2, 2015 at 11:58 AM, Markus Neteler <neteler at osgeo.org> wrote:
>> I am just trying again with this dataset:
>> https://dl.dropboxusercontent.com/u/24062833/ES2003_1m_mb_contour.zip

Ok, I went through this example. Indeed, it only takes minutes even on my
small laptop when reducing the area of computation to where the data
actually are (there is no point in interpolation from contours where no
contour lines are - this will also be MUCH faster). This is done by setting
a raster MASK.
On order to do so, I modified the example posted earlier:

# Generate new location, for the lazy via command line:
grass70 -c ES2003_1m_mb_contour.shp ~/grassdata/ES2003

# verify projection
g.proj -w

# import
v.in.ogr ES2003_1m_mb_contour.shp output=ES2003_1m_mb_contour

# set computational region and get extent of vector map
g.region vector=ES2003_1m_mb_contour -e
north-south extent: 5405.637436
east-west extent:   3945.019961

# generate points (point distance at e.g. circa 1% of extent)
v.to.points input=ES2003_1m_mb_contour output=ES2003_1m_mb_contour_points

# get alpha shape extension, see
g.extension v.concave.hull
v.concave.hull input=ES2003_1m_mb_contour_points output=riverbed threshold=5
# note: we do not need to be perfect here since we buffer the area later on

d.vect ES2003_1m_mb_contour_points
d.vect riverbed color=red type=boundary

# generate buffer in order to get a slightly larger bathymetry
v.buffer input=riverbed output=riverbed_50m distance=50

# reset computational region to area of interest
g.region vector=riverbed_50m res=1 -ap
projection: 1 (UTM)
zone:       10
datum:      wgs84
ellipsoid:  wgs84
north:      4079844
south:      4074337
west:       608294
east:       612340
nsres:      1
ewres:      1
rows:       5507
cols:       4046
cells:      22281322

# restrict computation to where the data are
r.mask vector=riverbed_50m

# rasterize points
v.to.rast input=ES2003_1m_mb_contour use=attr output=contours_rast

# interpolate DEM from contour lines (rather fast)
r.surf.contour input=contours_rast output=dmt_rast

# remove MASK
r.mask -r

# check the result
r.colors dmt_rast color=byr
d.rast dmt_rast
d.grid 1000

Screenshot of the result attached.

Hope this helps,

http://courses.neteler.org/blog <http://courses.neteler.org/blog>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20150602/ffce525c/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: r_surf_contour_output.png
Type: image/png
Size: 96228 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20150602/ffce525c/attachment-0001.png>

More information about the grass-user mailing list