Bug report #14263

QGIS2.12.3 : processing toolbox : grass7 : r.sunmask fails; too many arguments

Added by Jeremy Spurway about 8 years ago. Updated about 8 years ago.

Status:Closed
Priority:Normal
Assignee:Giovanni Manghi
Category:Processing/GRASS
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:22259

Description

Hi,

r.sunmask fails with error: "Either define sun position or location/date/time parameters"

Log:

@Algorithm r.sunmask - Calculates cast shadow areas from sun position and elevation raster map. starting...

g.proj -c proj4="+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +towgs84=375,-111,431,0,0,0,0 +units=m +no_defs"
r.external input="/home/jeremy/GIS/data/Cultybraggan/EU-DEM_Culty.tif" band=1 output=tmp14550554316328 --overwrite -o
g.region -a n=721000.0 s=716000.0 e=281000.0 w=273000.0 res=25.0
r.sunmask elevation=tmp14550554316328 altitude="0" azimuth="0" year="2000" month="1" day="1" hour="1" minute="0" second="0" timezone="0" east="0" north="0" -z -s output=outputfe8ff83323b74f2a84294d56f2f0ac27 --overwrite
g.region raster=outputfe8ff83323b74f2a84294d56f2f0ac27
r.out.gdal -c createopt="TFW=YES,COMPRESS=LZW" input=outputfe8ff83323b74f2a84294d56f2f0ac27 output="/tmp/processing43baf33306844980bd2aa8e5bd3868ab/c9f220b3d58f4040a233bcce6d0154c6/output.tif"
Cleaning up temporary files...
Starting GRASS GIS...
Executing '/home/jeremy/.qgis2//processing/grass7_batch_job.sh' ...
Default region was updated to the new projection, but if you have multiple mapsets `g.region -d` should be run in each to update the region from the default
Projection information updated
WARNING: Over-riding projection check
Reading band 1 of 1...
r.external complete. Link to raster map created.
ERROR: Either define sun position or location/date/time parameters
ERROR: Raster map not found
ERROR: Raster map or group not found
Execution of '/home/jeremy/.qgis2//processing/grass7_batch_job.sh' finished.
Cleaning up temporary files...
Cleaning up temporary files...
Starting GRASS GIS...
Executing '/home/jeremy/.qgis2//processing/grass7_batch_job.sh' ...
ERROR: Raster map not found
ERROR: Raster map or group not found
Execution of '/home/jeremy/.qgis2//processing/grass7_batch_job.sh' finished.
Cleaning up temporary files... @

r.sunmask command:

r.sunmask elevation=tmp14550554316328 altitude="0" azimuth="0" year="2000" month="1" day="1" hour="1" minute="0" second="0" timezone="0" east="0" north="0" -z -s output=outputfe8ff83323b74f2a84294d56f2f0ac27 --overwrite

It looks like the GUI needs a radio button to allow user to specify (and clarify input requirements) EITHER alt/az OR datetime/position, and that only the relevant arguments are included in the command.

best wishes JS

P.S. congratulations - great work with this integration of GRASS 7.

N.B. affected version is 2.12.3 (this isn't available in drop-down)

History

#1 Updated by Médéric RIBREUX about 8 years ago

  • Affected QGIS version changed from 2.12.2 to master
  • Status changed from Open to Feedback
  • Operating System deleted (OpenSuse)
  • OS version deleted (13.2 32bit)

Hello,

the easiest workaround to solve this bug is to split r.sunmask into two algorithms:
- r.sunmask.position which deals with altitude and azimuth of the sun (no year/month/day/hour/min/sec/timezone asked).
- r.sunmask.datetime which deals with day/time to provide sun position (no altitude/azimuth asked in the dialog box).

What do you think about this ?

#2 Updated by Médéric RIBREUX about 8 years ago

  • Category changed from GRASS to Processing/GRASS

#3 Updated by Giovanni Manghi about 8 years ago

  • Status changed from Feedback to Open
  • Assignee changed from Radim Blazek to Giovanni Manghi
  • Target version deleted (Future Release - High Priority)

What do you think about this ?

I can do that.

#4 Updated by Giovanni Manghi about 8 years ago

  • Resolution set to fixed/implemented
  • Status changed from Open to Closed

Also available in: Atom PDF