[GRASS-user] raster reclassification or map calculator to simulate past sea-level change

Hi everyone,

I've done some google searches related to my problem. Granted, by no means exhaustive, but unsuccessful nonetheless.
Thus, I hereby by contribute with my first post in the email group hoping to find some help.

I work in coastal Norway, and I'd like to produce different rasters based on estimates for when the sea-level was either higher, or lower, than today.
When I started doing this years ago, it was simply enough for me to use the raster calculator and then produce binary maps using the "<=" or ">=" expression as I only wanted to visualise the difference.
However, today I'd like to continue to work with the rasters where the values on the other side of the threshold that I assign remain intact but
I find it way too tedious having to 1) produce a binary map, 2) convert the cells denoting the sea-level change into vector polygons, and then 3) clipping the old raster into a new one.

I'll try and use an example for what I'd like to try and achieve instead.

Let's say I have an elevation raster with values ranging from -0.001 to 1500m. Now, if I'd be interested in producing a raster where anything below 25m is submerged, then the method that I alluded
to above would produce the following raster = 0 & 1

What I'm interested in doing now instead, is to find some method where I still reset anything below 25m as "0", but where I still have all the remaining values intact.

I'm thinking that there should be a way, either through the raster calculator or the reclassify tool, where I could simply reset anything above or below a certain threshold as either "0", or perhaps even "no data" but at the same time keep all the other elevation values of the raster intact.

This message should hopefully be enough to indicate that I have relatively poor experience with both the reclassify or mapcalc-tool and thus any
brief guide on how I could solve my problem would be greatly appreciated!

If anything is unclear just let me know and I can try to reformulate.

Best,
Victor

Hi Erik,

IIUC, you would need something like the following:

r.mapcalc expression=“bla = if(elev <= 25, 0.0, elev)”

or

r.mapcalc expression=“bla = if(elev <= 25, null(), elev)”

HTH,

Vero

El mié, 10 feb 2021 a las 8:47, Erik Victor Lundstrøm (<Victor.Lundstrom@uib.no>) escribió:

Hi everyone,

I’ve done some google searches related to my problem. Granted, by no
means exhaustive, but unsuccessful nonetheless.
Thus, I hereby by contribute with my first post in the email group
hoping to find some help.

I work in coastal Norway, and I’d like to produce different rasters
based on estimates for when the sea-level was either higher, or lower,
than today.
When I started doing this years ago, it was simply enough for me to use
the raster calculator and then produce binary maps using the “<=” or
“>=” expression as I only wanted to visualise the difference.
However, today I’d like to continue to work with the rasters where the
values on the other side of the threshold that I assign remain intact
but
I find it way too tedious having to 1) produce a binary map, 2) convert
the cells denoting the sea-level change into vector polygons, and then
3) clipping the old raster into a new one.

I’ll try and use an example for what I’d like to try and achieve
instead.

Let’s say I have an elevation raster with values ranging from -0.001 to
1500m. Now, if I’d be interested in producing a raster where anything
below 25m is submerged, then the method that I alluded
to above would produce the following raster = 0 & 1

What I’m interested in doing now instead, is to find some method where I
still reset anything below 25m as “0”, but where I still have all the
remaining values intact.

I’m thinking that there should be a way, either through the raster
calculator or the reclassify tool, where I could simply reset anything
above or below a certain threshold as either “0”, or perhaps even “no
data” but at the same time keep all the other elevation values of the
raster intact.

This message should hopefully be enough to indicate that I have
relatively poor experience with both the reclassify or mapcalc-tool and
thus any
brief guide on how I could solve my problem would be greatly
appreciated!

If anything is unclear just let me know and I can try to reformulate.

Best,
Victor


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

Hello Erik,
try this in r.mapcalc:
new_dem = if(old_dem < 25, null(), old_dem)

old_dem – name of map with input DEM;
null() – value to assign to cells below 25 (could be 0 too).

Keep in mind – your approach will put under water everything below a
specified level even if there is a natural or artificial dam
preventing water from intruding into the area. Use r.lake to perform
floodfill instead of simple water level rise (be ware – could be
memory hungry on large coputational regions).
Second thing – AFAIK Norway is experiencing intensive GIA. Thus simply
playing around with water level on dem is really primitive way how to
reconstruct palaeoenvironment or predict long term future.

Good luck,
Māris.