[GRASS-dev] Working with TGIS without starting GRASS explicitly

Vaclav Petras wenzeslaus at gmail.com
Sun Feb 26 20:37:01 PST 2017


Older, but the general ideas still apply:

On Thu, Sep 22, 2016 at 12:01 PM, Laurent C. <lrntct at gmail.com> wrote:
>
> My software is not really a GRASS module, it is more independent and
> use only GRASS as a back-end. It is fully written in Python and using
> --exec or GRASS_BATCH_JOB does not seems very practical.

You can use --exec only for the part of the code which is using GRASS, i.e.
you have two scripts, one which is the main program, and other one which
the the GRASS GIS script or even a module which you call using --exec.

> 2016-09-22 1:36 GMT-05:00 Blumentrath, Stefan <Stefan.Blumentrath at nina.no
>:
> > Hei Laurent,
> >
> > What about using the --exec magic from > GRASS 7.2?
> >
https://grass.osgeo.org/grass72/manuals/grass7.html#batch-jobs-with-the-exec-interface
> > (or the GRASS_BATCH_JOB solution)?
> >
> > Cheers
> > Stefan
> >
> > 2016-09-21 18:27 GMT-05:00 Laurent C. <lrntct at gmail.com>:
> >> Hi Sören,
> >>
> >> Setting LD_LIBRARY_PATH is working, thanks. But it cannot be set at
> >> run-time, which is not very user-friendly.

Well, that's really complain to operating system authors I think.
Unfortunately, I don't really know the story behind it.

> >> I guess this issue is related to the ticket 2424 [1].

Yes. Same issue. Linked this conversation there.

> >> I managed to get it work at run-time by restarting the program with
> >> sys.execv() after setting the path [2], but I find it a bit ugly and
> >> quite verbose to be multi-platform.

As [2] says, not really reliable.

> >> It would be great if an easier option was possible.

Yes. GRASS GIS libraries do not install as other libraries like Qt for
example, the distribution of GRASS GIS binaries would need to change. There
are issues related to this on Mac as well. Any solution will likely make
having parallel GRASS GIS installations much more difficult. But somebody
experienced with packaging would need to speak to that.

Vaclav

> >> [1] https://trac.osgeo.org/grass/ticket/2424
> >> [2]
http://stackoverflow.com/questions/6543847/setting-ld-library-path-from-inside-python
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20170226/17c1a238/attachment.html>


More information about the grass-dev mailing list