[GRASS-user] conditional buffering with DEM

hello,

Which function can we use to generate a map that has conditional buffering according to DEM from a line ?

regards

···

Ahmet Temiz
Jeoloji Müh.
Afet ve Acil Durum Yönetimi Başkanlığı
Bilgi İşlem Dairesi Başkanlığı-CBS Grubu


Ahmet Temiz
Geological Eng.
Information Systems - GIS Group
Disaster and Emergency Management
of Presidency

* Ahmet Temiz <ahmettemiz88@gmail.com> [2015-04-23 12:16:49 +0300]:

hello,

Which function can we use to generate a map that has conditional buffering
according to DEM from a line ?

Hello Ahmet,

I don't understand the "from a line" part of your question. Yet, I guess
you mean to keep a specific range of DEM values.

You can directly use r.mapcalc for such tasks.

1) Remember to set the extent and the resolution of the active
computational region, it'll be also the one of the new map produced by
r.mapcalc

2) r.mapcalc 'NewMap = if( DEM > 100 && DEM < 200, DEM, null())'

This example will write only DEM values between '100 < DEM < 200' in the
"NewMap" and will set to NULL all other pixels that don't satisfy the
above expression. For more, please look at r.mapcalc's manual.

Of course, all this is valid and achievable via the GUI.

Regards, Nikos

thank you Nikos

I meant that creating buffers from a line, which also querying DEM values.

DEM is in subquery position of buffer map

regards

···

On Thu, Apr 23, 2015 at 1:28 PM, Nikos Alexandris <nik@nikosalexandris.net> wrote:

hello,

Which function can we use to generate a map that has conditional buffering
according to DEM from a line ?

Hello Ahmet,

I don’t understand the “from a line” part of your question. Yet, I guess
you mean to keep a specific range of DEM values.

You can directly use r.mapcalc for such tasks.

  1. Remember to set the extent and the resolution of the active
    computational region, it’ll be also the one of the new map produced by
    r.mapcalc

  2. r.mapcalc ‘NewMap = if( DEM > 100 && DEM < 200, DEM, null())’

This example will write only DEM values between ‘100 < DEM < 200’ in the
“NewMap” and will set to NULL all other pixels that don’t satisfy the
above expression. For more, please look at r.mapcalc’s manual.

Of course, all this is valid and achievable via the GUI.

Regards, Nikos

Ahmet Temiz
Jeoloji Müh.
Afet ve Acil Durum Yönetimi Başkanlığı
Bilgi İşlem Dairesi Başkanlığı-CBS Grubu


Ahmet Temiz
Geological Eng.
Information Systems - GIS Group
Disaster and Emergency Management
of Presidency

On 23/04/15 16:44, Ahmet Temiz wrote:

thank you Nikos

I meant that creating buffers from a line, which also querying DEM values.

DEM is in subquery position of buffer map

You cannot do that directly, AFAIK, but using r.mapcalc you can combine the two variables. Different paths are possible. Here's one (supposing a buffer of 500m):

- Create a raster map with distance to the line using r.grow.distance
- Use r.mapcalc in order to check for both distance and DEM value, e.g.

NewMap = if(DEM > 100 && DEM < 200 && distance < 500, 1, null())

This will give you a map with non-null (value 1) in those pixels that are within the buffer distance and that correspond to the DEM-related condition.

Is this what you are looking for ?

Another path would be combining r.buffer output with the DEM in r.mapcalc.

Moritz

regards

On Thu, Apr 23, 2015 at 1:28 PM, Nikos Alexandris
<nik@nikosalexandris.net <mailto:nik@nikosalexandris.net>> wrote:

    * Ahmet Temiz <ahmettemiz88@gmail.com
    <mailto:ahmettemiz88@gmail.com>> [2015-04-23 12:16:49 +0300]:

    > hello,
    >
    > Which function can we use to generate a map that has conditional buffering
    > according to DEM from a line ?

    Hello Ahmet,

    I don't understand the "from a line" part of your question. Yet, I guess
    you mean to keep a specific range of DEM values.

    You can directly use r.mapcalc for such tasks.

    1) Remember to set the extent and the resolution of the active
    computational region, it'll be also the one of the new map produced by
    r.mapcalc

    2) r.mapcalc 'NewMap = if( DEM > 100 && DEM < 200, DEM, null())'

    This example will write only DEM values between '100 < DEM < 200' in the
    "NewMap" and will set to NULL all other pixels that don't satisfy the
    above expression. For more, please look at r.mapcalc's manual.

    Of course, all this is valid and achievable via the GUI.

    Regards, Nikos

--
Ahmet Temiz
Jeoloji Müh.
Afet ve Acil Durum Yönetimi Başkanlığı
Bilgi İşlem Dairesi Başkanlığı-CBS Grubu

________________________

Ahmet Temiz
Geological Eng.
Information Systems - GIS Group
Disaster and Emergency Management
of Presidency

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

* Moritz Lennert <mlennert@club.worldonline.be> [2015-04-23 20:58:10 +0200]:

On 23/04/15 16:44, Ahmet Temiz wrote:
> thank you Nikos
>
> I meant that creating buffers from a line, which also querying DEM values.
>
> DEM is in subquery position of buffer map

You cannot do that directly, AFAIK, but using r.mapcalc you can combine
the two variables. Different paths are possible. Here's one (supposing a
buffer of 500m):

- Create a raster map with distance to the line using r.grow.distance
- Use r.mapcalc in order to check for both distance and DEM value, e.g.

NewMap = if(DEM > 100 && DEM < 200 && distance < 500, 1, null())

This will give you a map with non-null (value 1) in those pixels that
are within the buffer distance and that correspond to the DEM-related
condition.

Is this what you are looking for ?

Another path would be combining r.buffer output with the DEM in r.mapcalc.

Moritz

[..]

Dear Ahmet,

did Moritz' suggested approach match your needs?

Thank you, Nikos

thank you all,

Actually, I coudn’t find time to test it.

perhaps creating bufferr from the line then querying these buffeds on DEM

The process is for estimating effect of Flood.
Do you suggest a way?

regards

On Friday, May 1, 2015, Nikos Alexandris nik@nikosalexandris.net wrote:

On 23/04/15 16:44, Ahmet Temiz wrote:

thank you Nikos

I meant that creating buffers from a line, which also querying DEM values.

DEM is in subquery position of buffer map

You cannot do that directly, AFAIK, but using r.mapcalc you can combine
the two variables. Different paths are possible. Here’s one (supposing a
buffer of 500m):

  • Create a raster map with distance to the line using r.grow.distance
  • Use r.mapcalc in order to check for both distance and DEM value, e.g.

NewMap = if(DEM > 100 && DEM < 200 && distance < 500, 1, null())

This will give you a map with non-null (value 1) in those pixels that
are within the buffer distance and that correspond to the DEM-related
condition.

Is this what you are looking for ?

Another path would be combining r.buffer output with the DEM in r.mapcalc.

Moritz

[…]

Dear Ahmet,

did Moritz’ suggested approach match your needs?

Thank you, Nikos

Ahmet Temiz
Jeoloji Müh.
Afet ve Acil Durum Yönetimi Başkanlığı
Bilgi İşlem Dairesi Başkanlığı-CBS Grubu


Ahmet Temiz
Geological Eng.
Information Systems - GIS Group
Disaster and Emergency Management
of Presidency