<div dir="ltr">Hello,<div><br></div><div>May I suggest to remove any reference to RasterNumpy in the documentation ? I just spend some time writing a code with RasterNumpy just to realize the class was not existing.</div><div><br></div><div>Thanks for the workaround.</div><div><br></div><div>Best regards,</div><div>Laurent</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2014-12-15 6:41 GMT-06:00 Pietro <span dir="ltr"><<a href="mailto:peter.zamb@gmail.com" target="_blank">peter.zamb@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear all,<br>
<br>
If you are ok with that, I would like to remove the RasterNumpy class,<br>
as far as I aware, nobody is using it.<br>
So I would like to avoid to introduce a class in grass70 and remove<br>
the class in grass71.<br>
However the RasterNumpy class can be easily replaced by functions like:<br>
<br>
{{{<br>
def raster2numpy(rastname):<br>
"""Return a numpy array from a raster map"""<br>
with RasterRow(rastname, mode='r') as rast:<br>
return np.array(rast)<br>
<br>
<br>
def numpy2raster(array, mtype, rastname):<br>
"""Save a numpy array to a raster map"""<br>
reg = Region()<br>
if (reg.rows, reg.cols) != array.shape:<br>
msg = "Region and array are different: %r != %r"<br>
raise TypeError(msg % ((reg.rows, reg.cols), array.shape))<br>
with RasterRow(rastname, mode='w', mtype=mtype) as new:<br>
newrow = Buffer((array.shape[1],), mtype=mtype)<br>
for row in array:<br>
newrow[:] = row[:]<br>
new.put_row(newrow)<br>
}}}<br>
<br>
Any concern on this?<br>
<br>
Best regards<br>
<span class="HOEnZb"><font color="#888888"><br>
Pietro<br>
_______________________________________________<br>
grass-dev mailing list<br>
<a href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-dev</a><br>
</font></span></blockquote></div><br></div>