<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:新細明體;
        panose-1:2 2 5 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Microsoft YaHei";
        panose-1:2 11 5 3 2 2 4 2 2 4;}
@font-face
        {font-family:"\@Microsoft YaHei";}
@font-face
        {font-family:"\@新細明體";
        panose-1:2 1 6 1 0 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Dear Germán, <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks for your detailed reply. It is helpful. <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The Processing was used well in the python file following your instruction, especially by setting the sys path as
<o:p></o:p></p>
<p class="MsoNormal">sys.path.append('C:/OSGeo4W/apps/qgis/python/plugins')<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">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.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Best regards,<o:p></o:p></p>
<p class="MsoNormal">Stephen<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b>From:</b> Germán Carrillo <carrillo.german@gmail.com> <br>
<b>Sent:</b> 2023<span lang="ZH-CN" style="font-family:"Microsoft YaHei",sans-serif">年</span>3<span lang="ZH-CN" style="font-family:"Microsoft YaHei",sans-serif">月</span>17<span lang="ZH-CN" style="font-family:"Microsoft YaHei",sans-serif">日</span> 9:45 PM<br>
<b>To:</b> LI, Xin Stephen [MIT] <stephenli@eduhk.hk><br>
<b>Cc:</b> qgis-user@lists.osgeo.org<br>
<b>Subject:</b> Re: [Qgis-user] How to use QGIS plus-ins (QNEAT3, QChainage) in the Python custom applications?<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="mso-element:para-border-div;border:solid windowtext 1.0pt;padding:4.0pt 4.0pt 4.0pt 4.0pt;background:yellow;margin-left:6.0pt;margin-right:6.0pt">
<p style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm;background:yellow;border:none;padding:0cm">
<span style="font-size:9.0pt;font-family:"Microsoft YaHei",sans-serif;color:red">CAUTION:</span><span style="font-size:9.0pt;font-family:"Microsoft YaHei",sans-serif;color:black"> External email. Do not click links or open attachments unless you recognise the
 sender and know the content is safe.<br>
</span><span lang="ZH-CN" style="font-size:9.0pt;font-family:"Microsoft YaHei",sans-serif;color:red">警告:</span><span lang="ZH-CN" style="font-size:9.0pt;font-family:"Microsoft YaHei",sans-serif;color:black">外來電郵。
</span><span lang="ZH-TW" style="font-size:9.0pt;font-family:"Microsoft YaHei",sans-serif;color:black;mso-fareast-language:ZH-TW">如不認識寄件者,或不確定內容是否安全,切勿按下任何連結或開啟任何附件。</span><span style="font-size:9.0pt;font-family:"Microsoft YaHei",sans-serif;color:black;mso-fareast-language:ZH-TW"> <o:p></o:p></span></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal">Hi Stephen, <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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!).<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I created a post to show off the results and to indicate the procedure (it's in Spanish). You can find it at [1].<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Perhaps you intend to use those plugins in a non-GUI application, which should also be possible.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Accessing the underlying plugin's API, if provided, would require an analysis per plugin, which is feasible.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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].<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">On the contrary, QChainage doesn't seem to be a "Processing provider" plugin, so further exploration would be required.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I hope that helps you get started.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Regards, <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Germán<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">---------------------<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">[1] <a href="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" target="_blank">https://geotux.tuxfamily.org/2009/08/31/cargando-plugins-de-qgis-en-el-visor-de-pyqgis/</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">[2] <a href="https://gis.stackexchange.com/questions/279874/using-qgis-processing-algorithms-from-pyqgis-standalone-scripts-outside-of-gui">
https://gis.stackexchange.com/questions/279874/using-qgis-processing-algorithms-from-pyqgis-standalone-scripts-outside-of-gui</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">[3] <a href="https://docs.qgis.org/3.28/en/docs/user_manual/processing/standalone.html?highlight=qgis_process#using-processing-from-the-command-line">https://docs.qgis.org/3.28/en/docs/user_manual/processing/standalone.html?highlight=qgis_process#using-processing-from-the-command-line</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">El vie, 17 mar 2023 a las 4:28, LI, Xin Stephen [MIT] via QGIS-User (<<a href="mailto:qgis-user@lists.osgeo.org" target="_blank">qgis-user@lists.osgeo.org</a>>) escribió:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Hello all QGIS users,
<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">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?
<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">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.
<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Do you have some experience about this or any other approaches/packages could achieve similar functions?<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Stephen<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
</div>
<p class="MsoNormal">_______________________________________________<br>
QGIS-User mailing list<br>
<a href="mailto:QGIS-User@lists.osgeo.org" target="_blank">QGIS-User@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">
https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">
https://lists.osgeo.org/mailman/listinfo/qgis-user</a><o:p></o:p></p>
</div>
</blockquote>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">-- <o:p></o:p></p>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">-----------<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">   |\__  <br>
(:>__)(<br>
   |/    <br>
Soluciones Geoinformáticas Libres                            <br>
<a href="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" target="_blank">http://geotux.tuxfamily.org/</a><br>
<a href="http://twitter.com/GeoTux2" target="_blank">https://twitter.com/GeoTux2</a><o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo" target="_blank"><span style="border:solid windowtext 1.0pt;padding:0cm;text-decoration:none"><img border="0" width="100" height="100" style="width:1.0416in;height:1.0416in" id="Picture_x0020_1" src="cid:~WRD000.jpg" alt="Image removed by sender."></span></a><o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>