[GRASSLIST:1540] counting pixels

Uttam Kumar uttamkumar123 at hotmail.com
Thu Oct 23 02:07:47 EDT 2003


Dear Grass users,
                  I have a raster map. It contains 720 rows x 960 columns 
=691200 pixels.
There are 32676 categories. I want to generate the category for each pixel; 
somewhat in this manner. For one pixel the lat-long bound comes to be a grid 
of 2 min,15 sec x 2 min, 15 sec. I want the output somewhat like this:
-------------------------------------------------------------------
pixel          North lat  South lat   East long   West long     category
------         --------   ---------   ----------  ----------    --------

1,1           07:02:15N   07:00:00N   68:02:15E    68:00:00E       34
1,2           07:02:15N   07:00:00N   68:04:30E    68:02:15E       21
..            ........    ........     ........    ........        ..
..            ........    ........     ........    ........        ..
720,960       34:50:15     34:48:00    93:02:00    93:00:00        97

I am trying to first take the first row and traversing all the 960 columns, 
then taking the second row and traversing through all the 960 column and 
continuing the process till all the 720 rows and 960 columns are covered. I 
think we can get a similar output by using g.region and ultimately setting 
the region of each pixel by its lat long value (perhaps by a loop). Yet I 
want all the data in the single file unlike generating a separate file for 
each category. Since creating separate file for each pixel would result in 
691200 files....
very difficult to read. Is it possible in GRASS ? Please suggest me some 
solution.

Thanks in advance.

uttam.

_________________________________________________________________
MSN Hotmail now on your Mobile phone. 
http://server1.msn.co.in/sp03/mobilesms/ Click here.




More information about the grass-user mailing list