[GRASS-user] can the grass calculate the area of different color for a image(tiff or other?)

can the grass calculate the area of different color for a image?
I have a tiff, and I have seen five color in it,I wonder I can calculate the area for each color with grass?

maven apache wrote:

can the grass calculate the area of different color for a image?
I have a tiff, and I have seen five color in it,I wonder I can calculate the area for each color with grass?

Did you check out r.stats -a ?

This mail was received via Mail-SeCure System.
------------------------------------------------------------------------

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

This mail was received via Mail-SeCure System.

Yes
My tiff have 5 color, red blue green and pink and yellow. I want get the area for each color…
First I import the tiff .however I got a.green a.red a.blue and a.alpha four raster.

2009/6/17 Micha Silver <micha@arava.co.il>

maven apache wrote:

can the grass calculate the area of different color for a image?
I have a tiff, and I have seen five color in it,I wonder I can calculate the area for each color with grass?

Did you check out r.stats -a ?

This mail was received via Mail-SeCure System.


grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

This mail was received via Mail-SeCure System.

maven apache wrote:

Yes
My tiff have 5 color, red blue green and pink and yellow. I want get the area for each color…
First I import the tiff .however I got a.green a.red a.blue and a.alpha four raster.

Multi-band tiffs are imported as separate bands. You can combine them with r.composite.

I got a.green a.red a.blue and a.alpha four raster,then follow the advise from this list I composite the three map g b r to a new raster:outss
then I run the commond r.stats -a input=outss@PERMANENT fs=space nv=* nsteps=255
got the following output

0 429847.542397
9321 212745757.083273
26425 4430667.032198
31744 5444337463.194785
32736 35683640.857434
32767 92624.052023

I wonder what do the first number in each line respent? And the second number in each respent the area?
2009/6/17 Micha Silver <micha@arava.co.il>

maven apache wrote:

Yes
My tiff have 5 color, red blue green and pink and yellow. I want get the area for each color…
First I import the tiff .however I got a.green a.red a.blue and a.alpha four raster.

Multi-band tiffs are imported as separate bands. You can combine them with r.composite.

2009/6/17 Micha Silver <micha@arava.co.il>

maven apache wrote:

can the grass calculate the area of different color for a image?
I have a tiff, and I have seen five color in it,I wonder I can calculate the area for each color with grass?

Did you check out r.stats -a ?

This mail was received via Mail-SeCure System.


grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

This mail was received via Mail-SeCure System.

This mail was received via Mail-SeCure System.


---

_______________________________________________
grass-user mailing list
[grass-user@lists.osgeo.org](mailto:grass-user@lists.osgeo.org)
[http://lists.osgeo.org/mailman/listinfo/grass-user](http://lists.osgeo.org/mailman/listinfo/grass-user)

This mail was received via Mail-SeCure System.

  

On 17/06/09 14:06, maven apache wrote:

I got a.green a.red a.blue and a.alpha four raster,then follow the advise from this list I composite the three map g b r to a new raster:outss
then I run the commond r.stats -a input=outss@PERMANENT <mailto:input=outss@PERMANENT> fs=space nv=* nsteps=255
got the following output
0 429847.542397
9321 212745757.083273
26425 4430667.032198
31744 5444337463.194785
32736 35683640.857434
32767 92624.052023
I wonder what do the first number in each line respent? And the second number in each respent the area?

RTFM :wink:

The first number is the category number, i.e. the different categories (in your case colors) present in your map.
The second number gives the area statistics which are given in units of square meters.

Moritz

Moritz Lennert wrote:

On 17/06/09 14:06, maven apache wrote:

I got a.green a.red a.blue and a.alpha four raster,then follow the advise from this list I composite the three map g b r to a new raster:outss
then I run the commond r.stats -a input=outss@PERMANENT <mailto:input=outss@PERMANENT> fs=space nv=* nsteps=255
got the following output
0 429847.542397
9321 212745757.083273
26425 4430667.032198
31744 5444337463.194785
32736 35683640.857434
32767 92624.052023
I wonder what do the first number in each line respent? And the second number in each respent the area?

RTFM :wink:

The first number is the category number, i.e. the different categories (in your case colors) present in your map.
The second number gives the area statistics which are given in units of square meters.

Moritz
________

And if you want to improve the output, then two steps:
First use r.category to give a label to each category like so:
(assuming the first is black)
echo "0:Black" | r.category outss rules=-
(note the '-' which means "read from stdin")
Next use r.report like so:
r.report outss unit=k
(gives a table with the cat value, the label and area in sqkm)

_______________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

This mail was received via Mail-SeCure System.

And if you want to improve the output, then two steps:
First use r.category to give a label to each category like so:
(assuming the first is black)

This is what I am not sure, I only get the number respent the category,but I am not sure what it stand for,for example the number in first line:9321,does it stand for red? or blue?

echo “0:Black” | r.category outss rules=-
(note the ‘-’ which means “read from stdin”)
Next use r.report like so:
r.report outss unit=k
(gives a table with the cat value, the label and area in sqkm)


grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

This mail was received via Mail-SeCure System.

To be sure what number corresponds to what color, just plot your map
and use the mouse query tool (r.what). Then you can click on a color
and see the category number pop up on screen...

On Wed, Jun 17, 2009 at 10:04 AM, maven apache<apachemaven0@gmail.com> wrote:

And if you want to improve the output, then two steps:
First use r.category to give a label to each category like so:
(assuming the first is black)

This is what I am not sure, I only get the number respent the category,but I
am not sure what it stand for,for example the number in first line:9321,does
it stand for red? or blue?

echo "0:Black" | r.category outss rules=-
(note the '-' which means "read from stdin")
Next use r.report like so:
r.report outss unit=k
(gives a table with the cat value, the label and area in sqkm)

_______________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

This mail was received via Mail-SeCure System.

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user