<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi Thomas,</p>
<p>Recently more and more is added to QGIS in the `qgis.utils`
module, for example the latest addition is the `@alg` decorator
for processing algorithms [1].</p>
<p>I really like these efforts and more additions are very welcome!</p>
<p>From a workflow perspective, it's good to come up with a QEP or a
thread on the mailing list first. Very often those snippets
overcome shortcomings of the QGIS API which should rather be fixed
on C++ side.</p>
<p>Bests</p>
<p>Matthias<br>
</p>
<p>[1] <a class="moz-txt-link-freetext" href="https://github.com/qgis/QGIS-Enhancement-Proposals/issues/134">https://github.com/qgis/QGIS-Enhancement-Proposals/issues/134</a><br>
</p>
<div class="moz-cite-prefix">On 20.02.19 09:38, Thomas Baumann
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAD3koGmhtG02wsupyXW9D1YTM_MBOODHKGc=1dGpZqY0YtqJRQ@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div dir="ltr">
<div>Hi qgis-devs,</div>
<div><br>
</div>
<div>I recently updated 15 QGIS-plugins to be QGIS3-ready.
Most of them were self written (in house) plugins but four
of them were also plugins from the official repository which
were written by someone else.</div>
<div><br>
</div>
<div>I noticed that there are severals tasks that have many
plugins in common like:</div>
<div>- load a vectorlayer</div>
<div>- add a layer to the layertree</div>
<div>- iterate through all (visible?) layers of the layertree<br>
</div>
<div>- show a message with different levels (info, warning,
critical)</div>
<div>- log messages</div>
<div>- reading setting, writing settings<br>
</div>
<div>- ...</div>
<div><br>
</div>
<div>It seems a bit ineffective that every developer writes
these common task 'from scratch'.</div>
<div><br>
</div>
<div>There already were some ideas to collect common functions
that could be re-used by plugin-developers:</div>
<div><br>
</div>
<div>
<p>-some older functions (GIS2) like</p>
<p><a href="https://github.com/NathanW2/parfait"
rel="nofollow noreferrer" moz-do-not-send="true">https://github.com/NathanW2/parfait</a></p>
<p><a href="https://github.com/qgis/pyqgis_wrappers"
rel="nofollow noreferrer" moz-do-not-send="true">https://github.com/qgis/pyqgis_wrappers</a></p>
<p>and something newer like</p>
<p><a
href="https://github.com/boundlessgeo/lib-qgis-commons"
rel="nofollow noreferrer" moz-do-not-send="true">https://github.com/boundlessgeo/lib-qgis-commons</a>
<a href="https://pypi.org/project/qgiscommons/"
rel="nofollow noreferrer" moz-do-not-send="true">https://pypi.org/project/qgiscommons/</a>
<br>
</p>
<p><br>
</p>
<p>One nice example for utilities collected for a (huge)
plugin is:</p>
<p><a
href="https://github.com/inasafe/inasafe/tree/master/safe/utilities"
rel="nofollow noreferrer" moz-do-not-send="true">https://github.com/inasafe/inasafe/tree/master/safe/utilities</a></p>
</div>
<div><br>
</div>
<div><br>
</div>
<div>Wouldn't it be possible to provide such a collection not
only from privat persons/projects but from the QGIS-project
itself so users could add common functions? <br>
</div>
<div>I think the chances would be higher that such a
"official" collection would be used in the long run and
constantly extended.</div>
<div><br>
</div>
<div>Apart from the fact that developers could save time while
writing their plugins this could perhaps also help to
improve the overall quality of the qgis-plugins as there
would probably be several persons who could/would
countercheck these common functions to make sure they are
well written.</div>
<div><br>
</div>
<div>regards,</div>
<div>Thomas</div>
<div><br>
</div>
<div>PS: I asked something similar also on gis.stackexchange
recently: <br>
</div>
<div><br>
</div>
<div><a
href="https://gis.stackexchange.com/questions/311755/looking-for-common-pyqgis-functions-for-qgis-3"
moz-do-not-send="true">https://gis.stackexchange.com/questions/311755/looking-for-common-pyqgis-functions-for-qgis-3</a>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
QGIS-Developer mailing list
<a class="moz-txt-link-abbreviated" href="mailto:QGIS-Developer@lists.osgeo.org">QGIS-Developer@lists.osgeo.org</a>
List info: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-developer">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a>
Unsubscribe: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-developer">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a></pre>
</blockquote>
</body>
</html>