[Qgis-user] How to use QGIS plus-ins (QNEAT3, QChainage) in the Python custom applications?

LI, Xin Stephen [MIT] stephenli at eduhk.hk
Tue Mar 28 02:08:15 PDT 2023


Dear Germán,

Thanks for your detailed reply. It is helpful.

The Processing was used well in the python file following your instruction, especially by setting the sys path as
sys.path.append('C:/OSGeo4W/apps/qgis/python/plugins')

It is to try to use user-defined algorithms for the processing to realise the function similar to QChainage, i.e., divide a path into a series of nodes within it.

Best regards,
Stephen



From: Germán Carrillo <carrillo.german at gmail.com>
Sent: 2023年3月17日 9:45 PM
To: LI, Xin Stephen [MIT] <stephenli at eduhk.hk>
Cc: qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] How to use QGIS plus-ins (QNEAT3, QChainage) in the Python custom applications?


CAUTION: External email. Do not click links or open attachments unless you recognise the sender and know the content is safe.
警告:外來電郵。 如不認識寄件者,或不確定內容是否安全,切勿按下任何連結或開啟任何附件。
Hi Stephen,


if I understand your intention well, yes, I think it's possible, since I've used QGIS plugins in a custom PyQGIS application back in the days (namely, 2009!).

I created a post to show off the results and to indicate the procedure (it's in Spanish). You can find it at [1].

Perhaps you intend to use those plugins in a non-GUI application, which should also be possible.

Accessing the underlying plugin's API, if provided, would require an analysis per plugin, which is feasible.

For instance, QNEAT3 is a "Processing provider" plugin, which is handy for multiple reasons. For instance, you can use it via custom PyQGIS standalone scripts (see "Using QGIS Processing algorithms from PyQGIS standalone scripts (outside of GUI)" at [2]) or the "qgis_process" utility [3].

On the contrary, QChainage doesn't seem to be a "Processing provider" plugin, so further exploration would be required.

I hope that helps you get started.


Regards,

Germán
---------------------
[1] https://geotux.tuxfamily.org/2009/08/31/cargando-plugins-de-qgis-en-el-visor-de-pyqgis/<https://protect2.fireeye.com/v1/url?k=31323334-501cfaeb-3130cb80-454455535732-267de21dafc248d6&q=1&e=7d337f9d-5681-4729-9548-b59bcd0a7842&u=https%3A%2F%2Fgeotux.tuxfamily.org%2F2009%2F08%2F31%2Fcargando-plugins-de-qgis-en-el-visor-de-pyqgis%2F>
[2] https://gis.stackexchange.com/questions/279874/using-qgis-processing-algorithms-from-pyqgis-standalone-scripts-outside-of-gui
[3] https://docs.qgis.org/3.28/en/docs/user_manual/processing/standalone.html?highlight=qgis_process#using-processing-from-the-command-line

El vie, 17 mar 2023 a las 4:28, LI, Xin Stephen [MIT] via QGIS-User (<qgis-user at lists.osgeo.org<mailto:qgis-user at lists.osgeo.org>>) escribió:
Hello all QGIS users,

Is there some approaches to import the QGIS plus-ins (QNEAT3, QChainage) as a library or package in the Python custom applications where PyQGIS imported?

The functions of QNEAT3 to find shortest paths are expended to be used. Then, the shortest paths are expected to be marked/divided by points with the same distances.

Do you have some experience about this or any other approaches/packages could achieve similar functions?

Stephen

_______________________________________________
QGIS-User mailing list
QGIS-User at lists.osgeo.org<mailto:QGIS-User at lists.osgeo.org>
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

--
-----------
   |\__
(:>__)(
   |/
Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/<https://protect2.fireeye.com/v1/url?k=31323334-501cfaeb-3130cb80-454455535732-b82cd17fb2ead88b&q=1&e=7d337f9d-5681-4729-9548-b59bcd0a7842&u=http%3A%2F%2Fgeotux.tuxfamily.org%2F>
https://twitter.com/GeoTux2<http://twitter.com/GeoTux2>

[Image removed by sender.]<http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20230328/efb0f4f7/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ~WRD000.jpg
Type: image/jpeg
Size: 823 bytes
Desc: ~WRD000.jpg
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20230328/efb0f4f7/attachment.jpg>


More information about the QGIS-User mailing list