|
@@ -18,7 +18,7 @@ sys.path.append("/usr/local/grass-7.0.svn/etc/python")
|
|
|
|
|
|
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 @@ else:
|
|
|
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)
|