<div dir="ltr">Hi, <br>I have to ascii raster that I created using a text editor:<br>the first is called raster1.asc and looks like this:<br><dl class="codebox"><dt><a href="http://forum.qgis.org/viewtopic.php?f=2&amp;t=4552#" onclick="selectCode(this); return false;"></a></dt>
<dd><code>ncols  Â  Â  Â  Â 6<br>nrows  Â  Â  Â  Â 4<br>xllcorner  Â  Â 3366820.0000019<br>yllcorner  Â  Â 5814589.0300007<br>cellsize  Â  Â  10<br>NODATA_value  -9999<br>1 1 1 1 1 1<br>1 1 1 1 1 1<br>1 1 1 1 1 1<br>1 1 1 1 -9999 -9999</code></dd>
</dl><br>The second is called raster2.asc and looks like this:<br><dl class="codebox"><dt><a href="http://forum.qgis.org/viewtopic.php?f=2&amp;t=4552#" onclick="selectCode(this); return false;"></a></dt><dd><code>ncols  Â  Â  Â  Â 6<br>
nrows  Â  Â  Â  Â 4<br>xllcorner  Â  Â 3366820.0000019<br>yllcorner  Â  Â 5814589.0300007<br>cellsize  Â  Â  10<br>NODATA_value  null<br>1 1 1 1 1 1<br>1 1 1 1 1 1<br>1 1 1 1 1 1<br>1 1 1 1 null null</code></dd></dl><br><br>When
I import them into python I find out the lower right corner of the first
raster is not giving the correct value: instead of &#39;null&#39; qgis displays
the value &#39;31081&#39;.<br>The other raster is imported correctly and it showing &#39;null&#39;s  for the two last data cells. <br><br><dl class="codebox"><dd><code>&gt;&gt;&gt; dataset = gdal.Open(&#39;raster2.asc&#39;, GA_ReadOnly)<br>
&gt;&gt;&gt; b = gdal_array.DatasetReadAsArray(dataset)<br>&gt;&gt;&gt; b<br>array([[1, 1, 1, 1, 1, 1],<br>  Â  Â  Â [1, 1, 1, 1, 1, 1],<br>  Â  Â  Â [1, 1, 1, 1, 1, 1],<br>  Â  Â  Â [1, 1, 1, 1, 0, 0]], dtype=int16)<br>&gt;&gt;&gt; dataset = gdal.Open(&#39;raster1.asc&#39;, GA_ReadOnly)<br>
&gt;&gt;&gt; a = gdal_array.DatasetReadAsArray(dataset)<br>&gt;&gt;&gt; a<br>array([[  Â  1,  Â  Â 1,  Â  Â 1,  Â  Â 1,  Â  Â 1,  Â  Â 1],<br>  Â  Â  Â [  Â  1,  Â  Â 1,  Â  Â 1,  Â  Â 1,  Â  Â 1,  Â  Â 1],<br>  Â  Â  Â [  Â  1,  Â  Â 1,  Â  Â 1,  Â  Â 1,  Â  Â 1,  Â  Â 1],<br>
  Â  Â  Â [  Â  1,  Â  Â 1,  Â  Â 1,  Â  Â 1, -9999, 31081]], dtype=int16)<br>&gt;&gt;&gt; <br></code></dd></dl><br><br>So
before I go and open a bug, I just wanted to know - what is wrong ?
Maybe it&#39;s my system setup ? Maybe i don&#39;t write correct ascii rasters
? Also, another thing I would like to bypass is the fact that &#39;null&#39;
values are formed as zeros in gdal-numpy - this could lead to error
when doing some raster manipulations. Is there a way to by pass this
(besides being aware...)?<br><br>I use Debian Lenny the latest relevant packages from.<br><br>Thanks, <br>Oz N, <br>Grad Studend, <br>Universität Tübingen<br><br><br clear="all"><br>-- <br><br>----<br> Â  Â  Â  Â  Â  Â Imagine there&#39;s no countries<br>
 Â  Â  Â  Â  Â  Â It isn&#39;t hard to do<br> Â  Â  Â  Â  Â  Â Nothing to kill or die for<br> Â  Â  Â  Â  Â  Â And no religion too<br> Â  Â  Â  Â  Â  Â Imagine all the people<br> Â  Â  Â  Â  Â  Â Living life in peace <br>----<br> Â  Â  Â  Â  Â  You all must read &#39;The God Delusion&#39; <br>
 Â  Â  Â  Â  Â  <a href="http://en.wikipedia.org/wiki/The_God_Delusion">http://en.wikipedia.org/wiki/The_God_Delusion</a><br>---<br>when one person suffers from a delusion it is called insanity. When many people suffer from a delusion it is called religion.&quot;<br>
Robert Pirsig, Zen and the Art of Motorcycle Maintenance<br><br>
</div>