Opened 16 years ago

Closed 15 years ago

#1134 closed defect (fixed)

grass toolbox: can't unselect an optional map

Reported by: hamish Owned by: rugginoso
Priority: major: does not work as expected Milestone: Version 1.0.3
Component: GRASS Version: 0.10.0
Keywords: grass toolbox Cc:
Must Fix for Release: Yes Platform: Debian
Platform Version: Etch Awaiting user input: no

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

Change History (6)

comment:1 by rugginoso, 15 years ago

Owner: changed from nobody to rugginoso

There are other modules which have this problem?

in reply to:  1 comment:2 by hamish, 15 years ago

Replying to 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

comment:3 by rugginoso, 15 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

in reply to:  3 comment:4 by hamish, 15 years ago

Replying to 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

comment:5 by rugginoso, 15 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?

comment:6 by rugginoso, 15 years ago

Resolution: fixed
Status: newclosed

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

Note: See TracTickets for help on using tickets.