[GRASS-dev] Access to GRASS GIS addons

Nikos Alexandris nik at nikosalexandris.net
Thu Oct 11 17:30:30 PDT 2018


* Ondřej Pešek <pesej.ondrek at gmail.com> [2018-10-11 20:20:40 +0200]:

>čt 11. 10. 2018 v 17:24 odesílatel Vaclav Petras <wenzeslaus at gmail.com>
>napsal:
>
>> A 2016 GSoC project took different approach which could be reused in QGIS
>> independently from the current GRASS Plugin or Processing plugin
>> approaches. This is a good base for future work, perhaps even for
>> auto-generating the files needed for GRASS plugin or Processing plugin.
>>
>> https://trac.osgeo.org/grass/wiki/GSoC/2016/PyQtGUI
>>
>
>
>If you start QGIS from the GRASS GIS shell, then you can use a module
>g.pyqt from the above-mentioned GSoC project and parse the name of the
>AddOn as a parameter. It will generate the fully-working GUI for you.
>
>So if you want to create a QGIS plugin and don't want to create the GUI
>from scratch, then you can call something like `g.pyqt r.estimap` after
>clicking on the icon of the plugin and it's done. However, it will still
>work just with maps in GRASS, it will not import them into QGIS or
>something, and there is also this strange thing about running QGIS from the
>GRASS GIS shell.
>
>And I didn't touch the code for some time, so there are still some places
>which should be improved. But it should be working if you have your AddOn
>installed in GRASS.
>
>PS: I believe that the code can be also re-written to generate the QGIS
>plugin GUI without all those strange necessities without so much work, but
>unfortunately I don't have enough time to do it in the near future.

Thank you Ondřej, also through the list.

(@all: we are not far away with Ondřej these days and he already helped me,
i.e. took time earlier in August and explained how it works under Linux, and
during the last days we did make it work on-site--I am yet to try it on a
Windows box though.)

However, I try to collect as much information as I can about it in order to
find the best solution for Windows users.  And I think it is a question
that is of interest for all of us, users of GRASS GIS and QGIS,
regardless of the OS.


Following options:

1. PyQTGUI

- Works under Linux for QGIS 2.x,
- Requires softlinking the Addon's directory which should reside inside
  the PyQTGUI (and possible named without a dot) to QGIS' plugins
  directory -- I guess this can be scripted
- Would require to ship the Addon with the complete PyQTGUI
- Yet to test under Windows

2. PyQGIS?

3. QGIS GRASS Plugin

4. QGIS Processing -- see also: https://gis.stackexchange.com/a/223770/5256

5. Ondřej suggested also another possibility: if an Addon is installed, maybe
then, inside QGIS: GRASS GIS Plugin > GRASS GIS shell > run `r.<addon> --ui`
would suffice?

Any Windows user possibly to try this last option?


Note, there is an "answer" by @Vaclav at
https://gis.stackexchange.com/a/173536/5256, which is rather
discouraging for GRASS GIS Addons through QGIS. I hope we can update it.

Nikos
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20181012/48754668/attachment.sig>


More information about the grass-dev mailing list