[GRASS-SVN] r39472 - grass/trunk/swig/python/examples
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Oct 10 12:16:50 EDT 2009
Author: neteler
Date: 2009-10-10 12:16:50 -0400 (Sat, 10 Oct 2009)
New Revision: 39472
Modified:
grass/trunk/swig/python/examples/rasteraccess.py
Log:
updated to 7 but still failing
Modified: grass/trunk/swig/python/examples/rasteraccess.py
===================================================================
--- grass/trunk/swig/python/examples/rasteraccess.py 2009-10-10 16:11:09 UTC (rev 39471)
+++ grass/trunk/swig/python/examples/rasteraccess.py 2009-10-10 16:16:50 UTC (rev 39472)
@@ -18,7 +18,7 @@
import os, sys
from grass.lib import grass
-from grass.raster import grassrast
+from grass.lib import raster as grassrast
if not os.environ.has_key("GISBASE"):
print "You must be in GRASS GIS to run this program."
@@ -33,20 +33,20 @@
grass.G_gisinit('')
# find map in search path
-mapset = grass.G_find_cell2(input, '')
+mapset = grass.G_find_raster2(input, '')
# determine the inputmap type (CELL/FCELL/DCELL) */
data_type = grassrast.Rast_map_type(input, mapset)
-infd = grassrast.Rast_open_cell_old(input, mapset)
-inrast = grassrast.Rast_allocate_raster_buf(data_type)
+infd = grassrast.Rast_open_old(input, mapset)
+inrast = grassrast.Rast_allocate_buf(data_type)
rown = 0
while True:
- myrow = grassrast.Rast_get_raster_row(infd, inrast, rown, data_type)
+ myrow = grassrast.Rast_get_row(infd, inrast, rown, data_type)
print rown, myrow[0:10]
rown += 1
if rown == 476:
break
-grassrast.Rast_close_cell(inrast)
+grassrast.Rast_close(inrast)
More information about the grass-commit
mailing list