<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&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&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 'null' qgis displays
the value '31081'.<br>The other raster is imported correctly and it showing 'null's for the two last data cells. <br><br><dl class="codebox"><dd><code>>>> dataset = gdal.Open('raster2.asc', GA_ReadOnly)<br>
>>> b = gdal_array.DatasetReadAsArray(dataset)<br>>>> 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>>>> dataset = gdal.Open('raster1.asc', GA_ReadOnly)<br>
>>> a = gdal_array.DatasetReadAsArray(dataset)<br>>>> 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>>>> <br></code></dd></dl><br><br>So
before I go and open a bug, I just wanted to know - what is wrong ?
Maybe it's my system setup ? Maybe i don't write correct ascii rasters
? Also, another thing I would like to bypass is the fact that 'null'
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's no countries<br>
It isn'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 'The God Delusion' <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."<br>
Robert Pirsig, Zen and the Art of Motorcycle Maintenance<br><br>
</div>