[GRASS-dev] wxGUI data catalog

Anna Petrášová kratochanna at gmail.com
Fri May 2 21:12:32 PDT 2014


Hi,


On Thu, May 1, 2014 at 1:18 PM, Martin Landa <landa.martin at gmail.com> wrote:

> Hi all,
>
> one of my students (Tereza, cc'ed) started to work on simple version
> of the data catalog implemented as a new tab in Layer Manager. This
> tool will allow to manage maps in the current location (remove, copy,
> or rename). Later could be added support for copying maps between
> different locations (including automated reprojection), preview of
> data and so on.
>

Do you plan to discuss somewhere the design of the catalog? Perhaps
summarize the main points about the integration with layer manager and map
display, gui design, planned features etc on Trac?


> Currently we are facing to the question whether to use in her code
> pyGRASS or just GRASS Python Scripting Library.  pyGRASS is not
> currently used in wxGUI at all (with only one exception - see
> gui_core/gselect.py [1]). There are some wxGUI components which should
> be rewritten using pygrass (those which already use ctypes), eg. wxGUI
> vector digitizer, but it's another story.
>
> So the question: do we start using pyGRASS in wxGUI more often even in
> the code where we don't need ctypes access and calling GRASS commands
> through GRASS Python Scripting Library is enough.
>
> The sample code from data catalog (copying maps):
>
> GRASS Python Scripting Library:
>
> cur_mapset = grass.gisenv()['MAPSET']
> grass.run_command('g.gisenv', set = 'MAPSET=%s' % dst_mapset)
> grass.run_command('g.copy', rast='%s@%s,%s' % (src_map, src_mapset,
> dst_name))
> grass.run_command('g.gisenv', set = 'MAPSET=%s' % cur_mapset)
>
> pyGRASS:
>
> cur_mapset = str(Mapset())
> Mapset(dst_mapset).current()
> g.copy(rast = '%s@%s,%s' % (src_map, src_mapset, dst_name)) # *
> Mapset(cur_mapset).current()
>
> * this could be replaced by something more fancy by modifying pyGRASS
>
> What is you opinion?
>
> Personally I incline to promote pyGRASS as interface for user scripts,
> but in wxGUI I still prefer to use GRASS Scripting Library to call
> GRASS commands on the background.
>

I agree with that, I am not sure if pyGRASS would give us some advantage in
the mapset/location management, I haven't used it for these tasks. But I
would like to hear from some who already used it like this.

Anna


> Martin
>
> [1]
> http://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/gui_core/gselect.py#L55
>
> --
> Martin Landa * http://geo.fsv.cvut.cz/gwiki/Landa
> _______________________________________________
> grass-dev mailing list
> grass-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20140503/2682f071/attachment.html>


More information about the grass-dev mailing list