<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<style>body p { margin-bottom: 0cm; margin-top: 0pt; } </style>
</head>
<body bidimailui-detected-decoding-type="latin-charset"
bgcolor="#FFFFFF" text="#000000">
<p>On 19/08/2011 08:52, H.S.Rai wrote:
<blockquote
cite="mid:CAGEhASzS6nQKomCBJHU-EgfYTvfZaOQz9FeYg_R=NXZCwMFRsA@mail.gmail.com"
type="cite">
<pre wrap="">Is it possible to clip (crop) a rectangular DTM raster with irregular
boundary of city (as vector map), so that I can view only city area
filled with DTM. nothing beyond that.
If this can be done, then which command or option will do this?
Please help me.
</pre>
</blockquote>
Here are two suggestions:</p>
<p>You can use the '-cutline' option to gdalwarp to clip a raster to
a polygon. Have a look at this blogpost for details:
<a class="moz-txt-link-freetext" href="http://linfiniti.com/2009/09/clipping-rasters-with-gdal-using-polygons/">http://linfiniti.com/2009/09/clipping-rasters-with-gdal-using-polygons/</a></p>
<p><br>
</p>
<p>Within GRASS, you can rasterize the clip polygon calling in
"MASK":</p>
<p>v.to.rast in=city out=MASK use-val value=1</p>
<p>THen run:</p>
<p> r.mapcalc clipped_DTM=original_DTM</p>
<p>Since r.mapcalc honors the MASK, the new raster should be clipped
to the city polygon.<br>
</p>
</body>
</html>