<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html style="direction: ltr;">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bidimailui-charset-is-forced="true"
bidimailui-detected-decoding-type="preferred-charset" text="#000000"
bgcolor="#ffffff">
<p style="margin-bottom: 0cm; margin-top: 0pt;">On 03/25/2011 04:57
PM, Luisa Peña wrote:<br>
</p>
<blockquote
cite="mid:AANLkTi=OkjY=DL6J0qoDiaRkNbg8AZfMOApj2pAL_uG=@mail.gmail.com"
type="cite">Greetings
<div><br>
</div>
<div>I have a raster map with a size like 25000 x 30000 with valid
values on all its extent. With another raster, I defined a
sub-extent of this raster, much smaller where only a small area
is valid and the rest it NULL() like this:</div>
<div>r.mapcalc output =
if(regional_area@PERMANENT>0,2004@Reg,null())</div>
<div>In this case, regional_area is a smaller area and I want to
select only a portion of 2004@Reg that falls inside
regional_area.</div>
<div>So I obtained output as a raster map with only some values
(4000x3000)</div>
<div>If I define g.region rast=output I still obtain a 25000
x30000 region which does not make sense since I only have a
small valid area.</div>
<div>How can I define a region, using g.region for only output
valid pixels?</div>
<div><br>
</div>
</blockquote>
<br>
NULL values are just as valid as numeric values. Setting cells to
NULL doesn't in any way change the region settings (as you found out
;-) )<br>
What is the extent of the 'regional_area' raster ? Check with:<br>
> r.info regional_area.<br>
If it's really only 4000X3000, then set the region using that raster
by running:<br>
> g.region -p rast=regional_area.<br>
Now<br>
> r.mapcalc output=2004 <br>
should give you a clipped raster.<br>
<br>
<blockquote
cite="mid:AANLkTi=OkjY=DL6J0qoDiaRkNbg8AZfMOApj2pAL_uG=@mail.gmail.com"
type="cite">
<div>Thanks</div>
<div>Luisa</div>
<br>
This mail was received via Mail-SeCure System.<br>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
grass-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/grass-user">http://lists.osgeo.org/mailman/listinfo/grass-user</a>
This mail was received via Mail-SeCure System.
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Micha Silver
Arava Development Co. +972-52-3665918
<a class="moz-txt-link-freetext" href="http://www.surfaces.co.il">http://www.surfaces.co.il</a>
</pre>
</body>
</html>