[GRASS-user] check pixel by pixel

Hi,
I have several raster maps (aspect, slope, tand_curv etc.). I would like to combine these raster maps to one raster but without losing any information. As a result i would like to have one raster map with several attributes (aspect, slope, tang_curv etc.). And then I would like to check Pixel by Pixel

if slope = steep and aspect = North etc.
then
"Value of the checked pixel" + 10

else

....

Has anybody done this before? Is it possible to combine several raster maps without losing any information?

Greets

Andreas
--
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser

The GIS raster data model states that each cell contains
one and exactly one value.
That's why raster maps are also called "fields" in spatial
statistics. And it is why raster operations are so simple
and efficient.

ESRI ArcGIS 9.2 (not GRASS) has raster maps with multiple
attribute values attached to each cell -- but that's a
perversion of the entire concept in my opinion.

I am sure there must be a way of dividing your problem into smaller
steps such that you will be able to solve it with the standard
raster model.

Hi,
I have several raster maps (aspect, slope, tand_curv etc.). I would like
to combine these raster maps to one raster but without losing any
information. As a result i would like to have one raster map with several
attributes (aspect, slope, tang_curv etc.). And then I would like to check
Pixel by Pixel

if slope = steep and aspect = North etc.
then
"Value of the checked pixel" + 10

else

....

Has anybody done this before? Is it possible to combine several raster
maps without losing any information?

Greets

Andreas
--
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser

_______________________________________________
grassuser mailing list
grassuser@grass.itc.it
http://grass.itc.it/mailman/listinfo/grassuser

Andruit@gmx.de napisał(a):

Hi, I have several raster maps (aspect, slope, tand_curv etc.). I would like to combine these raster maps to one raster but without losing any information. As a result i would like to have one raster map with several attributes (aspect, slope, tang_curv etc.). And then I would like to check Pixel by Pixel

if slope = steep and aspect = North etc.
then
"Value of the checked pixel" + 10

else

....

Has anybody done this before? Is it possible to combine several raster maps without losing any information?

Greets

Andreas
  

Thaw what you described has SpatialGridDataFrame in R. Simply you can import all raster data to one SGDataFrame and you can do there what you need.... It seems, becouse I can't understand for what you need 1 file instead of three or for and use mapcalc for that operation. Simply seems that mapalgebra (r.mapcalc) it is what you realy need

Jarek

Andruit:
> I have several raster maps (aspect, slope, tand_curv etc.).

..

> And then I would like to check Pixel by Pixel
> if slope = steep and aspect = North etc.
> then
> "Value of the checked pixel" + 10
>
> else
>
> ....
>
> Has anybody done this before? Is it possible to combine several
> raster maps without losing any information?

sure, it is a basic thing for GRASS probably for 20 years. Combining the
maps into one first is a totally unnecessary step.

Jarosław Jasiewicz wrote:

Thaw what you described has SpatialGridDataFrame in R. Simply you can
import all raster data to one SGDataFrame and you can do there what you
need.... It seems, becouse I can't understand for what you need 1 file
instead of three or for and use mapcalc for that operation. Simply
seems that mapalgebra (r.mapcalc) it is what you realy need

e.g. r.mapcalc with the spearfish demo dataset:

g.region rast=elevation.dem
# GRASS usually measures aspect in degrees CCW from East
# logic: if(this is true, then do this, otherwise do this)
# "slope", "aspect", and "elevation.dem" are map names.
r.mapcalc "test = if(slope > 10 && (aspect >= 45 && aspect < 135),
                     elevation.dem, null())"
d.rast aspect
d.rast -o test

you can also use create a MASK map if the r.mapcalc logic starts to get
too confusing, to build up your query bit by bit. see the raster intro
page.
  http://grass.ibiblio.org/grass63/manuals/html63_user/rasterintro.html

see also r.mapcalculator for an nice GUI frontend for r.mapcalc.

Hamish

On 10/2/07 4:41 AM, "benjamin.ducke@ufg.uni-kiel.de"
<benjamin.ducke@ufg.uni-kiel.de> wrote:

The GIS raster data model states that each cell contains
one and exactly one value.
That's why raster maps are also called "fields" in spatial
statistics. And it is why raster operations are so simple
and efficient.

ESRI ArcGIS 9.2 (not GRASS) has raster maps with multiple
attribute values attached to each cell -- but that's a
perversion of the entire concept in my opinion.

I am sure there must be a way of dividing your problem into smaller
steps such that you will be able to solve it with the standard
raster model.

Hi,
I have several raster maps (aspect, slope, tand_curv etc.). I would like
to combine these raster maps to one raster but without losing any
information. As a result i would like to have one raster map with several
attributes (aspect, slope, tang_curv etc.). And then I would like to check
Pixel by Pixel

if slope = steep and aspect = North etc.
then
"Value of the checked pixel" + 10

else

I agree with Benjamin.

This is what the map calculator is used for.

r.mapcalc 'newmap = if(slope="steep" && aspect="north",10,[do something
else])'

You can also create very complex statements using eval.

Michael

....

Has anybody done this before? Is it possible to combine several raster
maps without losing any information?

Greets

Andreas
--
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser

_______________________________________________
grassuser mailing list
grassuser@grass.itc.it
http://grass.itc.it/mailman/listinfo/grassuser

__________________________________________
Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton