[GRASS-dev] [GRASS GIS] #669: let users save/load mapcalc expressions

#669: let users save/load mapcalc expressions
--------------------+-------------------------------------------------------
Reporter: timmie | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.0
Component: wxGUI | Version: svn-develbranch6
Keywords: | Platform: Linux
      Cpu: x86-32 |
--------------------+-------------------------------------------------------
The mapcalc expressions are sometimes long.
Please enable a save/laod option.

The mapcalc expression files may have placefolders for raster files or
reference particular rasters.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/669&gt;
GRASS GIS <http://grass.osgeo.org>

#669: let users save/load mapcalc expressions
--------------------------+-------------------------------------------------
  Reporter: timmie | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: normal | Milestone: 6.4.0
Component: wxGUI | Version: svn-develbranch6
Resolution: | Keywords:
  Platform: Linux | Cpu: x86-32
--------------------------+-------------------------------------------------
Changes (by timmie):

  * type: defect => enhancement

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/669#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#669: let users save/load mapcalc expressions
--------------------------+-------------------------------------------------
  Reporter: timmie | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Resolution: | Keywords:
  Platform: Linux | Cpu: x86-32
--------------------------+-------------------------------------------------
Changes (by hamish):

  * milestone: 6.4.0 => 6.5.0

Comment:

why not just cut & paste from a text file or redirect from a file on the
command line? (r.mapcalc will accept input from stdin already)

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/669#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#669: let users save/load mapcalc expressions
--------------------------+-------------------------------------------------
  Reporter: timmie | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Resolution: | Keywords:
  Platform: Linux | Cpu: x86-32
--------------------------+-------------------------------------------------
Comment (by martinl):

wxGUI in GRASS >= 65 uses combobox for showing history of commands. It can
probably help. Also take a look at raster mapcalculator dialog (Raster ->
Map calculator).

Martin

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/669#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#669: let users save/load mapcalc expressions
--------------------------+-------------------------------------------------
  Reporter: timmie | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Resolution: | Keywords:
  Platform: Linux | Cpu: x86-32
--------------------------+-------------------------------------------------
Comment (by timmie):

@hamish:
I was talking about the GUI version
'''Raster -> Map calculator'''
I know that I can save shell expressions or history to a text file.

Replying to [comment:3 martinl]:
> wxGUI in GRASS >= 65 uses combobox for showing history of commands. It
can probably help. Also take a look at raster mapcalculator dialog (Raster
-> Map calculator).
Yes, the combobox-history is helpful.

I mean in the ''Raster -> Map calculator'' there could be a button save
and another for load where one can just save the expression.
It could then be shared among projects and users.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/669#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#669: let users save/load mapcalc expressions
--------------------------+-------------------------------------------------
  Reporter: timmie | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Resolution: | Keywords: map calculator
  Platform: Linux | Cpu: x86-32
--------------------------+-------------------------------------------------
Changes (by martinl):

  * keywords: => map calculator

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/669#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#669: let users save/load mapcalc expressions
--------------------------+-------------------------------------------------
  Reporter: timmie | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Resolution: | Keywords: map calculator
  Platform: Linux | Cpu: x86-32
--------------------------+-------------------------------------------------
Comment (by 1gray):

Replying to [ticket:669 timmie]:
> The mapcalc expressions are sometimes long.
> Please enable a save/laod option.
> The mapcalc expression files may have placefolders for raster files or
reference particular rasters.

This is already possible when using the command-line interface. Consider,
e. g.:
{{{
   bash$ (r=baz ; a=foo ; b=bar ; r.mapcalc "\"$r\" = \"$a\" + \"$b\"")
}}}

Note that you can rely on all the Bash facilities here, like, e. g.,
looping constructs:
{{{
   bash$ (for i in $(seq 1 10) ; do
              r.mapcalc "\"result${i}\" = \"baz\" * \"foo${i}\" +
\"bar${i}\""
          done)
}}}

After the snippet of code is tested, it may easily be shared with the
colleagues using either:
  * shared local filesystem;
  * shared NFS or SMB/CIFS volume;
  * shared VCS or your own public DVCS repository;
  * a mailing list, a newsgroup or a Wiki page;
  * a WWW page;
  * or a sheer variety of other means.

IOW, all the requested functionality is, in fact, present in GRASS (except
for the sharing part, but why should it be?) Therefore, I'm suggesting
'''wontfix''' for this one.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/669#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>

#669: let users save/load mapcalc expressions
--------------------------+-------------------------------------------------
  Reporter: timmie | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Resolution: | Keywords: map calculator
  Platform: Linux | Cpu: x86-32
--------------------------+-------------------------------------------------
Comment (by glynn):

Replying to [comment:6 1gray]:
> This is already possible when using the command-line interface.
Consider, e. g.:
{{{
   bash$ (r=baz ; a=foo ; b=bar ; r.mapcalc "\"$r\" = \"$a\" + \"$b\"")
}}}

Note that r.mapcalc allows map names to be quoted using either single or
double quotes, so the above can be written as:

{{{
   bash$ (r=baz ; a=foo ; b=bar ; r.mapcalc "'$r' = '$a' + '$b'")
}}}

This is probably clearer than using backslash and double-quote.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/669#comment:7&gt;
GRASS GIS <http://grass.osgeo.org>

#669: let users save/load mapcalc expressions
--------------------------+-------------------------------------------------
  Reporter: timmie | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Resolution: | Keywords: map calculator
  Platform: Linux | Cpu: x86-32
--------------------------+-------------------------------------------------
Comment (by timmie):

Replying to [comment:6 1gray]:
> Replying to [ticket:669 timmie]:
> > The mapcalc expressions are sometimes long.
> > Please enable a save/laod option.
> > The mapcalc expression files may have placefolders for raster files or
reference particular rasters.
>
> This is already possible when using the command-line interface.
Consider, e. g.:
When talking about saving I meant from the wxGUI based map calculator. See
below my component selection.

Thanks for your understanding.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/669#comment:8&gt;
GRASS GIS <http://grass.osgeo.org>

#669: let users save/load mapcalc expressions
--------------------------+-------------------------------------------------
  Reporter: timmie | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Resolution: | Keywords: map calculator, r.mapcalc
  Platform: Linux | Cpu: x86-32
--------------------------+-------------------------------------------------
Changes (by hamish):

  * keywords: map calculator => map calculator, r.mapcalc

Comment:

the SQL Builder GUI is another similar place where save-a-string might be
useful as part of a GRASS Notepad collection.
{{{
|
|
|- [-] Mapcalc expressions
| |
| |-- A + B + sin(C)
| |-- sqrt(A^2 + B^2)
|
|- [+] SQL expressions
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/669#comment:9&gt;
GRASS GIS <http://grass.osgeo.org>

#669: let users save/load mapcalc expressions
--------------------------+-------------------------------------------------
  Reporter: timmie | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Resolution: | Keywords: map calculator, r.mapcalc
  Platform: Linux | Cpu: x86-32
--------------------------+-------------------------------------------------
Comment (by hamish):

{{{
|
|- [+] Command line expressions
|
|- [+] Miscellanea
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/669#comment:10&gt;
GRASS GIS <http://grass.osgeo.org>

#669: let users save/load mapcalc expressions
---------------------------------------+------------------------------------
Reporter: timmie | Owner: timmie
     Type: enhancement | Status: new
Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Keywords: map calculator, r.mapcalc | Platform: Linux
      Cpu: x86-32 |
---------------------------------------+------------------------------------
Changes (by hamish):

* cc: grass-dev@… (added)

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/669#comment:13&gt;
GRASS GIS <http://grass.osgeo.org>

#669: let users save/load mapcalc expressions
---------------------------------------+------------------------------------
Reporter: timmie | Owner: timmie
     Type: enhancement | Status: new
Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Keywords: map calculator, r.mapcalc | Platform: Linux
      Cpu: x86-32 |
---------------------------------------+------------------------------------

Comment(by martinl):

Replying to [comment:11 timmie]:
> The attached file will offer options to save/load expressions to files.
A Grass notepad is not included.

Next time please attach a diff file (generated by 'svn diff') rather then
full file...

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/669#comment:14&gt;
GRASS GIS <http://grass.osgeo.org>

#669: let users save/load mapcalc expressions
---------------------------------------+------------------------------------
Reporter: timmie | Owner: timmie
     Type: enhancement | Status: new
Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Keywords: map calculator, r.mapcalc | Platform: Linux
      Cpu: x86-32 |
---------------------------------------+------------------------------------

Comment(by timmie):

> Next time please attach a diff file (generated by 'svn diff') rather
then full file...
Thanks for remembering!
Do you wnat to receive a diff?
Is use a BZR mirror. but the diff schould be the same.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/669#comment:15&gt;
GRASS GIS <http://grass.osgeo.org>

#669: let users save/load mapcalc expressions
---------------------------------------+------------------------------------
Reporter: timmie | Owner: timmie
     Type: enhancement | Status: new
Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Keywords: map calculator, r.mapcalc | Platform: Linux
      Cpu: x86-32 |
---------------------------------------+------------------------------------

Comment(by timmie):

Hello,
does this patch qualify for includion into GRASS?

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/669#comment:16&gt;
GRASS GIS <http://grass.osgeo.org>

#669: let users save/load mapcalc expressions
---------------------------------------+------------------------------------
Reporter: timmie | Owner: timmie
     Type: enhancement | Status: new
Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Keywords: map calculator, r.mapcalc | Platform: Linux
      Cpu: x86-32 |
---------------------------------------+------------------------------------

Comment(by timmie):

Sorry for instisting, but does this qualify or is there something wrong
with my patch?
I would welcome this feature a lot. Tired of copy paste to editors or
taking screenshot of mapcalculator.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/669#comment:17&gt;
GRASS GIS <http://grass.osgeo.org>

Hello,
is there anything wrog with my patch?
Do you not like it because of design issues?

Regards,
Timmie

#669: let users save/load mapcalc expressions
---------------------------------------+------------------------------------
Reporter: timmie | Owner: timmie
     Type: enhancement | Status: new
Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Keywords: map calculator, r.mapcalc | Platform: Linux
      Cpu: x86-32 |
---------------------------------------+------------------------------------

Comment(by timmie):

Sorry for instisting, but does this qualify or is there something wrong
with my patch?
I would welcome this feature a lot. Tired of copy paste to editors or
taking screenshot of mapcalculator.

#669: let users save/load mapcalc expressions
---------------------------------------+------------------------------------
Reporter: timmie | Owner: timmie
     Type: enhancement | Status: new
Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Keywords: map calculator, r.mapcalc | Platform: Linux
      Cpu: x86-32 |
---------------------------------------+------------------------------------
Changes (by martinl):

* cc: martinl (added)

Comment:

Replying to [comment:17 timmie]:
> Sorry for instisting, but does this qualify or is there something wrong
with my patch?
> I would welcome this feature a lot. Tired of copy paste to editors or
taking screenshot of mapcalculator.

Modified patch committed in r44068, testing welcomed. Thanks for the
patch. Martin

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/669#comment:18&gt;
GRASS GIS <http://grass.osgeo.org>

#669: let users save/load mapcalc expressions
---------------------------------------+------------------------------------
Reporter: timmie | Owner: timmie
     Type: enhancement | Status: new
Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Keywords: map calculator, r.mapcalc | Platform: Linux
      Cpu: x86-32 |
---------------------------------------+------------------------------------

Comment(by timmie):

Thanks for attending this.
And sorry for being instisting too much. you are also busy...

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/669#comment:19&gt;
GRASS GIS <http://grass.osgeo.org>

#669: let users save/load mapcalc expressions
---------------------------------------+------------------------------------
Reporter: timmie | Owner: timmie
     Type: enhancement | Status: new
Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Keywords: map calculator, r.mapcalc | Platform: Linux
      Cpu: x86-32 |
---------------------------------------+------------------------------------

Comment(by martinl):

Replying to [comment:19 timmie]:
> Thanks for attending this.
> And sorry for being instisting too much. you are also busy...

No problem. Can we close the ticket? Martin

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/669#comment:20&gt;
GRASS GIS <http://grass.osgeo.org>