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

maven apache:

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?

d.what.rast or r.what can help. or raster query tool from GUI.

Hamish

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

The above is the result I got from the commond r.stats -a input=swione@PERMANENT fs=space nv=* nsteps=255
the swione is composited from the r g b maps by importing the tiff swi.tiff. So the category I think is six.
And when I run the comond: r.category map=swione@PERMANENT fs=tab I got
9321
26425
31744
32736
32767
Where si the category “0”?
Also I found that I can see only five color from the tiff swi.tiff, and yesterday I get five category with the same steps(import and composite then calculate ), they are
"0
9321
26425
31744
32736 ";, but today it change to six!!
And acturlly I want to extract each color and export them to a vector map, I am looking the proper commond.
2009/6/18 Hamish <hamish_b@yahoo.com>

maven apache:

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?

d.what.rast or r.what can help. or raster query tool from GUI.

Hamish

Also I found that I can see only five color from the tiff swi.tiff, and yesterday I get five category with the same steps(import and composite then calculate ), they are
"0
9321 26425 31744 32736 ";, but today it change to six!!

Maybe I remembered it wrongly. (:slight_smile:)

And acturlly I want to extract each color and export them to a vector map, I am looking the proper commond.

It seems that there is no corresponding command to achieve this goal?

On 18/06/09 14:31, maven apache wrote:

        Also I found that I can see only five color from the tiff
        swi.tiff, and yesterday I get five category with the same
        steps(import and composite then calculate ), they are
        "0
        9321 26425 31744 32736 ";, but today it change to six!!

Maybe I remembered it wrongly. (*^__^*)

        And acturlly I want to extract each color and export them to a
        vector map, I am looking the proper commond.

It seems that there is no corresponding command to achieve this goal£¿

Please start by reading:

http://grass.osgeo.org/grass64/manuals/html64_user/rasterintro.html
http://grass.osgeo.org/grass64/manuals/html64_user/vectorintro.html

The command you are looking for is r.to.vect (I see it is not mentioned
in the rasterintro. Should be...).

Moritz

2009/6/18 Moritz Lennert <mlennert@club.worldonline.be>

On 18/06/09 14:31, maven apache wrote:

Also I found that I can see only five color from the tiff
swi.tiff, and yesterday I get five category with the same
steps(import and composite then calculate ), they are
"0
9321 26425 31744 32736 ";, but today it change to six!!

Maybe I remembered it wrongly. (:slight_smile:)

And acturlly I want to extract each color and export them to a
vector map, I am looking the proper commond.

It seems that there is no corresponding command to achieve this goal?

Please start by reading:

http://grass.osgeo.org/grass64/manuals/html64_user/rasterintro.html
http://grass.osgeo.org/grass64/manuals/html64_user/vectorintro.html

The command you are looking for is r.to.vect (I see it is not mentioned
in the rasterintro. Should be…).

It seems that the r.to.vect is to transfer the hole raster map to a vector,but I want to transfer each category to a vector…

Moritz

On 18/06/09 14:59, maven apache wrote:

2009/6/18 Moritz Lennert <mlennert@club.worldonline.be
<mailto:mlennert@club.worldonline.be>>

    On 18/06/09 14:31, maven apache wrote:
     > Also I found that I can see only five color from the tiff
     > swi.tiff, and yesterday I get five category with the same
     > steps(import and composite then calculate ), they are
     > "0
     > 9321 26425 31744 32736 ";, but today it change to six!!
     >
     > Maybe I remembered it wrongly. (*^__^*)
     >
     >
     > And acturlly I want to extract each color and export them
    to a
     > vector map, I am looking the proper commond.
     >
     > It seems that there is no corresponding command to achieve this
    goal£¿

    Please start by reading:

    http://grass.osgeo.org/grass64/manuals/html64_user/rasterintro.html
    http://grass.osgeo.org/grass64/manuals/html64_user/vectorintro.html

    The command you are looking for is r.to.vect (I see it is not mentioned
    in the rasterintro. Should be...).

It seems that the r.to.vect is to transfer the hole raster map to a
vector,but I want to transfer each category to a vector....

The easiest solution is probably a combination of r.to.vect + v.extract.

Moritz

Thanks I have tried it ,and I found each transfered vector map is not compatible with the real color position of the image…

2009/6/18 Moritz Lennert <mlennert@club.worldonline.be>

On 18/06/09 14:59, maven apache wrote:

2009/6/18 Moritz Lennert <mlennert@club.worldonline.be

mailto:[mlennert@club.worldonline.be](mailto:mlennert@club.worldonline.be)>

On 18/06/09 14:31, maven apache wrote:

Also I found that I can see only five color from the tiff
swi.tiff, and yesterday I get five category with the same
steps(import and composite then calculate ), they are
"0
9321 26425 31744 32736 ";, but today it change to six!!

Maybe I remembered it wrongly. (:slight_smile:)

And acturlly I want to extract each color and export them
to a
vector map, I am looking the proper commond.

It seems that there is no corresponding command to achieve this
goal?

Please start by reading:

http://grass.osgeo.org/grass64/manuals/html64_user/rasterintro.html
http://grass.osgeo.org/grass64/manuals/html64_user/vectorintro.html

The command you are looking for is r.to.vect (I see it is not mentioned
in the rasterintro. Should be…).

It seems that the r.to.vect is to transfer the hole raster map to a
vector,but I want to transfer each category to a vector…

The easiest solution is probably a combination of r.to.vect + v.extract.

Moritz

On 18/06/09 15:26, maven apache wrote:

Thanks I have tried it ,and I found each transfered vector map is
not compatible with the real color position of the image......

You will have to give us more info than that if you want any help. What
do you mean by "not compatible" ?
Have you set your working region correctly ? Try g.region
rast=YourRasterMap before r.to.vect (or maybe with res= to set to a
finer resolution).

Moritz

2009/6/18 Moritz Lennert <mlennert@club.worldonline.be>

On 18/06/09 15:26, maven apache wrote:

Thanks I have tried it ,and I found each transfered vector map is
not compatible with the real color position of the image…

You will have to give us more info than that if you want any help. What
do you mean by “not compatible” ?

I imported the swi.tiff to grass,got four raster ,r g b and other ,then I composite them ,
The composited raster have five category:
0
9321
26425
31744
32736
And I use the r.to.vect commond to change it to to a vecor layer.
then extract:
v.extract input=swivec@PERMANENT output=swi_32736 type=point,area layer=1 new=-1 list=32736 --overwrite
then I display the swi_32736 ,its shape is not close to which in the tiff.

Have you set your working region correctly ? Try g.region
rast=YourRasterMap before r.to.vect (or maybe with res= to set to a
finer resolution).

I create new location for the tiff,so I think the region is not a problem

Moritz