[GRASS-dev] Wildcards in multiple map input?

Hi,

For the QGIS-GRASS-plugin update Radim, Pedro, Andrew and me were discussion how to implement multiple selections for map input in the UI in QGIS.

In this context I was thinking that the ability to use wildcards would be really handy for GRASS newcomers. People who are not afraid of the command line can of course easily pipe g.list output to modules with multiple input or re-use the latter from file like e.g. in temporal modules.

My idea would be to allow something like this:

r.series input=temperature_*_05_17 output=norway_national_day_temperature_avg method=average (in order to calculate average temperature for Norways national day for example)

in the GUI and/or command line, where wildcards are evaluated to a list of available maps following that pattern.

The “*” is not allowed in map names, right, so, whenever it appears in a multiple map input it might used to trigger a respective g.list operation…

My question is:

Would it be of interest and feasible to add such a feature to GRASS?

Just an idea to make things easier for beginners and those who only use the GUI…

Cheers

Stefan

On Wed, Sep 9, 2015 at 7:06 AM, Blumentrath, Stefan <
Stefan.Blumentrath@nina.no> wrote:

Hi,

For the QGIS-GRASS-plugin update Radim, Pedro, Andrew and me were
discussion how to implement multiple selections for map input in the UI in
QGIS.

In this context I was thinking that the ability to use wildcards would be
really handy for GRASS newcomers. People who are not afraid of the command
line can of course easily pipe g.list output to modules with multiple input
or re-use the latter from file like e.g. in temporal modules.

My idea would be to allow something like this:

r.series input=temperature_*_05_17
output=norway_national_day_temperature_avg method=average (in order to
calculate average temperature for Norways national day for example)

in the GUI and/or command line, where wildcards are evaluated to a list of
available maps following that pattern.

The “*” is not allowed in map names, right, so, whenever it appears in a
multiple map input it might used to trigger a respective g.list operation…

My question is:

Would it be of interest and feasible to add such a feature to GRASS?

Just an idea to make things easier for beginners and those who only use
the GUI...

I thought there was a ticket about this, but I can't find it. The
suggestion I remember (but it never got implemented) is to reuse a dialog
for selecting multiple maps using regular expressions (accessible from
layer manager) and have a small button near the map entry in the
autogenerated dialogs which would open this dialog and transfer the
resulting map series back in the map entry field. So this would be
implemented on the GUI level. Your suggestion would be implemented on
parser level. I guess both have some pluses and minuses.

Anna

Cheers

Stefan

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Hi Anna,

Thanks for your reply. The closest I found was this:

https://trac.osgeo.org/grass/ticket/1251

Might be dangerous to use an asterisk at command / parser level as the result of the evaluation (meaning the resulting list of maps) is not necessarily known to the user in advance (or may be different from what he or she expects)!?

Anyway, if you consider it a useful feature I will open a ticket …

Cheers

Stefan

···

On Wed, Sep 9, 2015 at 7:06 AM, Blumentrath, Stefan <Stefan.Blumentrath@nina.no> wrote:

Hi,

For the QGIS-GRASS-plugin update Radim, Pedro, Andrew and me were discussion how to implement multiple selections for map input in the UI in QGIS.

In this context I was thinking that the ability to use wildcards would be really handy for GRASS newcomers. People who are not afraid of the command line can of course easily pipe g.list output to modules with multiple input or re-use the latter from file like e.g. in temporal modules.

My idea would be to allow something like this:

r.series input=temperature_*_05_17 output=norway_national_day_temperature_avg method=average (in order to calculate average temperature for Norways national day for example)

in the GUI and/or command line, where wildcards are evaluated to a list of available maps following that pattern.

The “*” is not allowed in map names, right, so, whenever it appears in a multiple map input it might used to trigger a respective g.list operation…

My question is:

Would it be of interest and feasible to add such a feature to GRASS?

Just an idea to make things easier for beginners and those who only use the GUI…

I thought there was a ticket about this, but I can’t find it. The suggestion I remember (but it never got implemented) is to reuse a dialog for selecting multiple maps using regular expressions (accessible from layer manager) and have a small button near the map entry in the autogenerated dialogs which would open this dialog and transfer the resulting map series back in the map entry field. So this would be implemented on the GUI level. Your suggestion would be implemented on parser level. I guess both have some pluses and minuses.

Anna

Cheers

Stefan


grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

On Thu, Sep 10, 2015 at 10:07 AM, Blumentrath, Stefan <
Stefan.Blumentrath@nina.no> wrote:

Hi Anna,

Thanks for your reply. The closest I found was this:

https://trac.osgeo.org/grass/ticket/1251

that's a different one... Maybe I don't remember it correctly

Might be dangerous to use an asterisk at command / parser level as the
result of the evaluation (meaning the resulting list of maps) is not
necessarily known to the user in advance (or may be different from what he
or she expects)!?

Anyway, if you consider it a useful feature I will open a ticket …

yes, thanks

Cheers

Stefan

*From:* Anna Petrášová [mailto:kratochanna@gmail.com]
*Sent:* 10. september 2015 15:44
*To:* Blumentrath, Stefan <Stefan.Blumentrath@nina.no>
*Cc:* GRASS developers list (grass-dev@lists.osgeo.org) <
grass-dev@lists.osgeo.org>; Andrew McAninch <amcaninch@gmail.com>; Radim
Blazek (radim.blazek@gmail.com) <radim.blazek@gmail.com>
*Subject:* Re: [GRASS-dev] Wildcards in multiple map input?

On Wed, Sep 9, 2015 at 7:06 AM, Blumentrath, Stefan <
Stefan.Blumentrath@nina.no> wrote:

Hi,

For the QGIS-GRASS-plugin update Radim, Pedro, Andrew and me were
discussion how to implement multiple selections for map input in the UI in
QGIS.

In this context I was thinking that the ability to use wildcards would be
really handy for GRASS newcomers. People who are not afraid of the command
line can of course easily pipe g.list output to modules with multiple input
or re-use the latter from file like e.g. in temporal modules.

My idea would be to allow something like this:

r.series input=temperature_*_05_17
output=norway_national_day_temperature_avg method=average (in order to
calculate average temperature for Norways national day for example)

in the GUI and/or command line, where wildcards are evaluated to a list of
available maps following that pattern.

The “*” is not allowed in map names, right, so, whenever it appears in a
multiple map input it might used to trigger a respective g.list operation…

My question is:

Would it be of interest and feasible to add such a feature to GRASS?

Just an idea to make things easier for beginners and those who only use
the GUI...

I thought there was a ticket about this, but I can't find it. The
suggestion I remember (but it never got implemented) is to reuse a dialog
for selecting multiple maps using regular expressions (accessible from
layer manager) and have a small button near the map entry in the
autogenerated dialogs which would open this dialog and transfer the
resulting map series back in the map entry field. So this would be
implemented on the GUI level. Your suggestion would be implemented on
parser level. I guess both have some pluses and minuses.

Anna

Cheers

Stefan

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

On 10/09/15 16:07, Blumentrath, Stefan wrote:

Hi Anna,

Thanks for your reply. The closest I found was this:

https://trac.osgeo.org/grass/ticket/1251

Might be dangerous to use an asterisk at command / parser level as the
result of the evaluation (meaning the resulting list of maps) is not
necessarily known to the user in advance (or may be different from what
he or she expects)!?

Especially when maps from other mapsets might be read as well. I agree that this is a potentially dangerous feature and believe that a solution on GUI level, with possibility of intermediate control by the user of the list of selected maps, might be safer.

Moritz