Bug report #1134

grass toolbox: can't unselect an optional map

Added by hamish - over 12 years ago. Updated over 11 years ago.

Status:Closed
Priority:Low
Assignee:Lorenzo Masini
Category:GRASS
Affected QGIS version: Regression?:No
Operating System:Debian Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:11194

Description

Hi,

in the GRASS toolbox, if you have a module open that can take an optional map, once you select a map there is no way to unselect it again, i.e. go back to "none". You can replace it with another map.

example: "post_mask" option of the v.surf.icw addon script:
http://trac.osgeo.org/grass/browser/grass-addons/vector/v.surf.icw/qgis-toolbox

thanks,
Hamish

Associated revisions

Revision ee75633d
Added by Lorenzo Masini over 11 years ago

Added the possibility to unselect an optional (required="no" into interface-description of the grass module) to fix #1134.

git-svn-id: http://svn.osgeo.org/qgis/trunk/[email protected] c8812cc2-4d05-0410-92ff-de0c093fc19c

Revision 1e1c65d2
Added by Lorenzo Masini over 11 years ago

Added the possibility to unselect an optional (required="no" into interface-description of the grass module) to fix #1134.

git-svn-id: http://svn.osgeo.org/qgis/[email protected] c8812cc2-4d05-0410-92ff-de0c093fc19c

Revision d5e0f5a5
Added by Lorenzo Masini over 11 years ago

Added the possibility to unselect an optional (required="no" into interface-description of the grass module) to fix #1134.

git-svn-id: http://svn.osgeo.org/qgis/trunk/[email protected] c8812cc2-4d05-0410-92ff-de0c093fc19c

Revision 58594404
Added by Lorenzo Masini over 11 years ago

Added the possibility to unselect an optional (required="no" into interface-description of the grass module) to fix #1134.

git-svn-id: http://svn.osgeo.org/qgis/[email protected] c8812cc2-4d05-0410-92ff-de0c093fc19c

History

#1 Updated by Lorenzo Masini over 11 years ago

There are other modules which have this problem?

#2 Updated by hamish - over 11 years ago

Replying to [comment:1 rugginoso]:

There are other modules which have this problem?

Yes there should be very many. Sorry for posting a non-standard module as an example.

I seem to recall that Radim may have done something about this some weeks ago when he was working on the QGIS/GRASS parser code???

Sorry I don't have a newish version of QGIS in front of me (due to lack of official Debian package...), I can give some solid examples later.

But a quick grep of the man pages gives some probables:

$  grep 'name</em>]' [rv]\\.*html | cut -f1 -d: | uniq | sed -e 's/.html//'
r.carve
r.category
r.cats
r.colors
r.cost
r.external
r.grow.distance
r.gwflow
r.in.ascii
r.in.gdal
r.kappa
r.lake
r.le.setup
r.los
r.out.gdal
r.out.ppm
r.out.xyz
r.proj
r.random
r.reclass
r.recode
r.region
r.sim.sediment
r.sim.water
r.statistics
r.stats
v.buffer
v.build
v.category
v.clean
v.convert
v.db.connect
v.distance
v.drape
v.edit
v.external
v.extract
v.extrude
v.in.ascii
v.in.db
v.in.dxf
v.in.ogr
v.kernel
v.label
v.label.sa
v.lrs.create
v.lrs.segment
v.net
v.net.iso
v.net.path
v.out.ascii
v.outlier
v.patch
v.proj
v.random
v.reclass
v.segment
v.surf.bspline
v.surf.rst
v.to.3d
v.to.db
v.to.rast
v.transform

may I suggest the r.cost start_rast= or start_points= option.

thanks,
Hamish

#3 Updated by Lorenzo Masini over 11 years ago

I can't understand what do you mean about "can't unselect an optional map".
In the example you provided me (r.cost) you must select a layer into each combobox, so the choice to leave empty one of them is incorrect.
Waiting your explainations :D

#4 Updated by hamish - over 11 years ago

Replying to [comment:3 rugginoso]:

I can't understand what do you mean about "can't unselect an optional map".
In the example you provided me (r.cost) you must select a layer into each combobox, so the choice to leave empty one of them is incorrect.

yeah sorry, that's a bad example. in GRASS it is optional but in the QGIS wrapper it is not.

In GRASS you can use specific coordinates, vector map points, or raster map pixels for the starting points. Apparently the QGIS wrapper for it only offers the chance to use a raster map for that, so it becomes a required option in QGIS.

I'll have to hunt around for one that really shows the behaviour, although the effort to minimize module options in the QGIS wrappers may make it hard.

the general idea is this: some modules take optional input maps with a default of none. (eg if input data comes from a vector map instead) If you use the pulldown menu to select a map for that option there is no way to get back to the "none" state.

Hamish

#5 Updated by Lorenzo Masini over 11 years ago

Uhm undestood.
The solution used in the past seems to be to create a new module.
For example, r.cost. We could create two modules, r.cost.raster and r.cost.points.
What about this solution?

#6 Updated by Lorenzo Masini over 11 years ago

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

Now the grass plug-in checks the required attribute into interface description.

Fixed in 1e1c65d2 (SVN r11329).

Also available in: Atom PDF