[GRASS-user] No Data everywhere when I extract the shadow from a DEM using r.sunmask

Hello,

First of all, I’m new to this mailinglist and to GrassGIS in general.

So, I’m trying to use the r.sunmask command in order to extract the shadow from an SRTM DEM of the Alps mountains (Switzerland).
The image had to be first reprojected when I’ve imported it to a EPSG:21781 location, in order to get both the (lat, lon) in meters (similarly to the elevation).

Here is the command I’m executing (note that the time of the day was chosen at 09:00 in the morning to maximize the shadow):

r.sunmask elevation=n46_e006_1arc_v3@PERMANENT output=alps-sunmask.tif year=2014 month=9 day=23 hour=9 minute=0 timezone=1

The problem I have is that the image produced is emtpy (no-data everywhere).
Is there a parameter I’m forgetting to add to the r.sunmask command?
Or should I use r.sun command instead, even though I’m not sure about the parameters I should provide to it either ?

Hakim.

Hakim Benoudjit wrote

Hello,

First of all, I'm new to this mailinglist and to GrassGIS in general.

So, I'm trying to use the `r.sunmask` command in order to extract the
shadow from an `SRTM DEM` of the Alps mountains (Switzerland).
The image had to be first `reprojected` when I've imported it to a
`EPSG:21781` location, in order to get both the (lat, lon) in meters
(similarly to the elevation).

Here is the command I'm executing (note that the time of the day was
chosen
at 09:00 in the morning to maximize the shadow):

r.sunmask elevation=n46_e006_1arc_v3@PERMANENT output=alps-sunmask.tif
year=2014 month=9 day=23 hour=9 minute=0 timezone=1

The problem I have is that the image produced is emtpy (no-data
everywhere).
Is there a parameter I'm forgetting to add to the `r.sunmask` command?
Or should I use `r.sun` command instead, even though I'm not sure about
the
parameters I should provide to it either ?

Hakim.

have you set your computional region to your DEM by g.region?

-----
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html

Welcome Most likely you need to set the region to your DEM. FAQ #1 when using GRASS: Always set the region first

···

On 09/04/2017 05:15 PM, Hakim Benoudjit wrote:

Hello,

First of all, I’m new to this mailinglist and to GrassGIS in general.

So, I’m trying to use the r.sunmask command in order to extract the shadow from an SRTM DEM of the Alps mountains (Switzerland).
The image had to be first reprojected when I’ve imported it to a EPSG:21781 location, in order to get both the (lat, lon) in meters (similarly to the elevation).

Here is the command I’m executing (note that the time of the day was chosen at 09:00 in the morning to maximize the shadow):

r.sunmask elevation=n46_e006_1arc_v3@PERMANENT output=alps-sunmask.tif year=2014 month=9 day=23 hour=9 minute=0 timezone=1

The problem I have is that the image produced is emtpy (no-data everywhere).
Is there a parameter I’m forgetting to add to the r.sunmask command?
Or should I use r.sun command instead, even though I’m not sure about the parameters I should provide to it either ?

`g.region -p ```rast=n46_e006_1arc_v3@PERMANENT``

Hakim.

_______________________________________________
grass-user mailing list
[grass-user@lists.osgeo.org](mailto:grass-user@lists.osgeo.org)
[https://lists.osgeo.org/mailman/listinfo/grass-user](https://lists.osgeo.org/mailman/listinfo/grass-user)
-- 
Micha Silver
Ben Gurion Univ.
Sde Boker, Remote Sensing Lab
cell: +972-523-665918

Thanks guys for the quick response.
You were right, the shadow wasn’t detected because the region hasn’t been set.

Now it seems to be working, but I’m wondering between r.sunmask and r.sun which one should be used to calculate the shadow mask?

Thanks.

Hakim.

···

On 4 September 2017 at 15:43, Micha Silver <tsvibar@gmail.com> wrote:

On 09/04/2017 05:15 PM, Hakim Benoudjit wrote:

Hello,

First of all, I’m new to this mailinglist and to GrassGIS in general.

Welcome

So, I’m trying to use the r.sunmask command in order to extract the shadow from an SRTM DEM of the Alps mountains (Switzerland).
The image had to be first reprojected when I’ve imported it to a EPSG:21781 location, in order to get both the (lat, lon) in meters (similarly to the elevation).

Here is the command I’m executing (note that the time of the day was chosen at 09:00 in the morning to maximize the shadow):

r.sunmask elevation=n46_e006_1arc_v3@PERMANENT output=alps-sunmask.tif year=2014 month=9 day=23 hour=9 minute=0 timezone=1

The problem I have is that the image produced is emtpy (no-data everywhere).
Is there a parameter I’m forgetting to add to the r.sunmask command?
Or should I use r.sun command instead, even though I’m not sure about the parameters I should provide to it either ?

Most likely you need to set the region to your DEM.
`g.region -p ```rast=n46_e006_1arc_v3@PERMANENT``

FAQ #1 when using GRASS: Always set the region first

Hakim.

_______________________________________________
grass-user mailing list
[grass-user@lists.osgeo.org](mailto:grass-user@lists.osgeo.org)
[https://lists.osgeo.org/mailman/listinfo/grass-user](https://lists.osgeo.org/mailman/listinfo/grass-user)
-- 
Micha Silver
Ben Gurion Univ.
Sde Boker, Remote Sensing Lab
cell: +972-523-665918

On Mon, Sep 4, 2017 at 5:59 PM, Hakim Benoudjit <h.benoudjit@gmail.com> wrote:

Thanks guys for the quick response.
You were right, the shadow wasn't detected because the region hasn't been
set.

Now it seems to be working, but I'm wondering between `r.sunmask` and
`r.sun` which one should be used to calculate the shadow mask?

Personally I think that r.sun is more powerful here since it uses a
more advanced algorithm.

HTH,
Markus