Opened 15 years ago
Closed 12 years ago
#669 closed enhancement (fixed)
let users save/load mapcalc expressions
Reported by: | timmie | Owned by: | timmie |
---|---|---|---|
Priority: | normal | Milestone: | 6.5.0 |
Component: | wxGUI | Version: | svn-develbranch6 |
Keywords: | map calculator, r.mapcalc | Cc: | grass-dev@…, martinl |
CPU: | x86-32 | Platform: | All |
Description
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.
Attachments (2)
Change History (26)
comment:1 by , 15 years ago
Type: | defect → enhancement |
---|
comment:2 by , 15 years ago
Milestone: | 6.4.0 → 6.5.0 |
---|
follow-up: 4 comment:3 by , 15 years ago
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
comment:4 by , 15 years ago
@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 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.
comment:5 by , 15 years ago
Keywords: | map calculator added |
---|
follow-ups: 7 8 comment:6 by , 15 years ago
Replying to 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.
comment:7 by , 15 years ago
Replying to 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.
comment:8 by , 15 years ago
Replying to 1gray:
Replying to 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.
comment:9 by , 15 years ago
Keywords: | r.mapcalc added |
---|
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
follow-up: 14 comment:11 by , 14 years ago
Owner: | changed from | to
---|
The attached file will offer options to save/load expressions to files. A Grass notepad is not included.
comment:12 by , 14 years ago
I also tried to tackle: http://trac.osgeo.org/grass/ticket/923
But here I definately need help.
comment:13 by , 14 years ago
Cc: | added |
---|
follow-up: 15 comment:14 by , 14 years ago
Replying to 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...
comment:15 by , 14 years ago
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.
follow-up: 18 comment:17 by , 14 years ago
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.
comment:18 by , 14 years ago
Cc: | added |
---|
follow-up: 20 comment:19 by , 14 years ago
Thanks for attending this. And sorry for being instisting too much. you are also busy...
comment:20 by , 14 years ago
Replying to timmie:
Thanks for attending this. And sorry for being instisting too much. you are also busy...
No problem. Can we close the ticket? Martin
comment:21 by , 14 years ago
Just as note: Arc* programs also use *.exp extension to save SQL queries.
Thus we may decide to change the default file extension for mapcalc expressions to help users that work with both GIS suites.
follow-up: 24 comment:22 by , 14 years ago
Thanks again for backproting the patch also.
Next task would be to enbale also saving/loading of queries (SQL). THese could then even be shared with QGIS. But that will be another bug.
comment:23 by , 14 years ago
Platform: | Linux → All |
---|
comment:24 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Closing as fixed:
- Saving and loading r.mapcalc expressions to file works for 6.4.3svn
- Any file extension can by used (and default is none - no extension is added by default)
Other enhancements mentioned here (create a new ticked if you want them):
- Saving and loading of SQL statements
- Compatibility with QGIS
- Some 'quick save', 'history' and 'recently used' functionality
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)