[GRASS-user] Python/Ctype interface: how to get coordinates for raster layer.

peter.loewe at gmx.de peter.loewe at gmx.de
Thu Mar 29 07:37:28 EDT 2012


hi all,

for a GRASS 6.x script I'm using the ctype interface
to iterate over all lines (and cells) of a raster layer:

... 

for rown in xrange(rows):
     G_get_raster_row(infd, inrast, rown, data_type)
     print rown, inrast[0:cols]
...
[taken from the ctypes raster example (http://fossies.org/dox/grass-6.4.2/example__ctypes_8py_source.html)]


Q:The (geographic) coordinates for each raster cell should be accessible via 
coo_col = G_col_to_easting((thecolumn + 0.5), "REGION")
coo_row = G_row_to_northing((therow + 0.5), "REGION")

=> how is "REGION"-related information 1) derived and 2) referred to on this level ?

Peter
-- 
Dr. Peter Löwe
<peter.loewe at gmx.de>





Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de


More information about the grass-user mailing list