<div><div dir="auto">Hi,</div><div dir="auto"><br></div><div dir="auto">Are there any good C++ courses for QGIS that you would recommend?</div><div dir="auto"><br></div><div dir="auto">Thanks</div><div class="gmail_quote"><div>On Luan 30 MFómh 2019 at 20:01, Clemens Raffler <<a href="mailto:clemens.raffler@gmail.com">clemens.raffler@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thank you Nyall for your feedback and for mentoring me in this process! <br>
I will definitely have a look at other Python algorithms.<br>
<br>
I managed to open a pull request <br>
(<a href="https://github.com/qgis/QGIS/pull/32070" rel="noreferrer" target="_blank">https://github.com/qgis/QGIS/pull/32070</a>) containing the new algorithm <br>
sources and the integration into cmake.<br>
I ran into some problems when applying the prepare_commit.sh script <br>
(output: nothing was modified) but everything else went smoothly.<br>
<br>
Please have a look at the code and feel free to contact me!<br>
<br>
Best regards,<br>
Clemens<br>
<br>
<br>
On 30.09.19 02:08, Nyall Dawson wrote:<br>
> On Mon, 30 Sep 2019 at 03:06, Clemens Raffler <<a href="mailto:clemens.raffler@gmail.com" target="_blank">clemens.raffler@gmail.com</a>> wrote:<br>
>> Dear QGIS Developers,<br>
>><br>
>> lately I have been using the 'Create Grid' algorithm a lot on huge areas<br>
>> and with a rather fine grid resolution. I was not surprised that<br>
>> creating a very fine grid took a very long time as the algorithm is<br>
>> currently implemented in python.<br>
>><br>
>> In order to speed up my work I decided to experiment a little with C++<br>
>> (coming from a python background) development in QGIS and ported the<br>
>> algorithm to C++ based on other native algorithms. The code is working<br>
>> very well, the grid creation process has been sped up significantly. I<br>
>> would now like to contribute the code to the QGIS project so that other<br>
>> users can benefit from the speedup.<br>
> Sounds fantastic, and a very valuable (and desired) contribution! Nice work!<br>
><br>
>> - Is there any reason why certain algorithms (eg. the Create Grid alg)<br>
>> should not be available in C++?<br>
> No. In fact, the opposite! The long-term goal is to port all these<br>
> algorithms away from Python and to c++. Python is GREAT for plugin<br>
> based algorithms and for quickly developing new algorithms, but it's<br>
> just not competitive in speed vs the c++ algorithms. We've also had a<br>
> LOT of issues in the past where Python algorithms break due to lack of<br>
> compile time checks when QGIS API (or other Processing Python code) is<br>
> revised. In contrast, I'm not aware of a single regression of this<br>
> nature in any of the ported c++ algorithms.<br>
><br>
> (My advice for readers out there: don't write big, complex<br>
> applications in Python. full stop.)<br>
><br>
>> - As I am not familiar with the processes how native processing<br>
>> algorithms get committed to the main repository (pull requests,<br>
>> prepare-commit.sh, sip, etc.), would anybody like to help/mentor/guide<br>
>> me through this process and review the code?<br>
> **raises hand**<br>
><br>
>> - Are there any special requirements on testing infrastructure for C++<br>
>> algs which should be implemented too (I have not worked with tests so far)?<br>
> Looks like there's already good test coverage with the existing Python<br>
> algorithm. These existing tests will carry over to the c++ port, so<br>
> it's likely that nothing extra is required here.<br>
><br>
> In general, there's some "desirable changes" which we are encouraging<br>
> when porting an existing algorithm to c++, but none of them apply in<br>
> this particular case. Specifically:<br>
><br>
> - use the QgsProcessingFeatureBasedAlgorithm subclass wherever possible.<br>
> - add support for dynamic parameters where desirable.<br>
><br>
><br>
>> So far, my experience with porting python algs to C++ has been very good<br>
>> with Create Grid and I would like to work on other ports if everything<br>
>> goes well.<br>
> That's great to hear!  I'd suggest having a look at a really simple<br>
> feature based algorithm like DensifyGeometries as a great candidate<br>
> for learning. There's almost no logic in the Python code for this one,<br>
> so it would be a great one to learn the overall process of porting to<br>
> c++ without the complexities of having to port a lot of<br>
> python-specific logic.<br>
><br>
> Nyall<br>
_______________________________________________<br>
QGIS-Developer mailing list<br>
<a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">QGIS-Developer@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a></blockquote></div></div><div dir="ltr">-- <br></div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>Le gach dea ghui,<br></div><div><span style="color:rgb(61,133,198)"><b><span style="background-color:rgb(255,255,255)"><i>Shane Carey</i></span></b></span></div><div><span style="color:rgb(61,133,198)"><b><span style="background-color:rgb(255,255,255)"><i>GIS and Data Solutions Consultant</i></span></b></span><br></div></div></div></div></div></div></div>