[QGIS-Developer] Interaction API?
G. Allegri
giovanni.allegri at gmail.com
Fri Sep 10 08:38:58 PDT 2021
>
> Otherwise it is very well be possible to implement a "pipe" into QGIS /
> API for QGIS using various techniques (maybe even expose iface and some
> nasty "exec"ing :D ). E. g. check out
> https://github.com/gem/oq-irmt-qgis/tree/qgis3-socketserver which uses
> websockets.
A socket server is exactly what I was thinking of. I did it a couple of
times in the past (both a simple udp socket and an http server in another
case)
By the way I'm not sure it is worth it. Other solutions (through DB, files,
whatever) might suffice.
Giovanni
> Cheers, Hannes
>
>
> Am 10.09.21 um 14:38 schrieb andrea antonello:
>
> Hi Richard,
>
> > I guess you mean QGIS Desktop, right? AFAIK the only option is to use
>> its Python API, which requires all the PyQGIS <
>> https://docs.qgis.org/3.16/en/docs/pyqgis_developer_cookbook/index.html>
>> and binary libs to be available inside the environment.
>>
>> Just curious: but would it be possible to 'attach' your script to a
>> running/visible instance of QGIS?
>>
>> From:
>> https://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/intro.html#python-applications
>>
>> So: I start QGIS, and then from some python console (NOT the internal
>> one), I can try to load (and show!) a shapefile in current mapcanvas? Or
>> pan/zoom? That would be cool for demonstrations...
>>
>
> I have to apologize and give a little context. I teach geographic
> scripting at a local university. Students come from the previous geomatics
> course with Arc.
> Since I have no intention to teach Arc scripting, I have been doing it for
> several years now happily using a scripting environment based on Geoscript
> Groovy [1].
> So we are talking about a completely different programming language.
> In the last year I have been able to pull some of them over to QGIS, but
> the traction is low. So I was hoping to be able to attach to some APi to
> load results into a running QGIS instance. That would be really cool,
> surely convince them and I would have been able to develop the geoscript
> part necessary to my environment.
>
> In the meanwhile I read Gio's comment: "Another option could be run a
> "micro server" inside a pyqgis plugin and serve an ad-hoc API from it :)"
>
> Yes, that would have been my dream :-)
>
> Thanks for your comments.
>
> Andrea
>
>
> [1] https://jericks.github.io/geoscript-groovy-cookbook
>
>
>>
>> Regards,
>>
>> Richard Duivenvoorde
>>
>>
>>
> _______________________________________________
> QGIS-Developer mailing listQGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>
> --
> Johannes Kröger / GIS-Entwickler/-Berater
> WhereGroup GmbH
> Eifelstraße 7
> 53119 Bonn
> Germany
>
> Fon: +49 (0)228 / 90 90 38 - 36
> Fax: +49 (0)228 / 90 90 38 - 11
> johannes.kroeger at wheregroup.comwww.wheregroup.com
> Geschäftsführer:
> Olaf Knopp, Peter Stamm
> Amtsgericht Bonn, HRB 9885
> -------------------------------
>
> ---------------------------------------------
> Aufwind durch Wissen!
> Jetzt neu: Web-Seminare und Online-Schulungen
> bei der www.foss-academy.com
> ---------------------------------------------
>
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20210910/ccdf2f60/attachment.html>
More information about the QGIS-Developer
mailing list