Skip to content

Reimplement the Kdtree Algorithm

In my last pull request I noticed a section warning about errors in the "src/kdtree.c" file, especially the part about memory leak which scared me a little.

image_2022-07-22_121452041

So I tried to fix the file, but I didn't understand anything that was going on there. So I decided to take the opportunity to completely rewrite the algorithm, but now using C++ and classes, which is much more Qt-style than structs.

After many YouTube tutorials, I managed to write an algorithm that passed the "reversegeocodertest" automated test. And it is much smaller than the original, because I only implemented the functions that are used in the project.

I also tested by opening an image in Koko with the Latitude and Longitude data in the metadata. Both my version of the code and the old one gave the same result.

And about the licenses, the REUSE specification requires that all files have a license, so I chose the most permissive one available, but if you want I can change it.

I also had to remove the BSD-3-Clause license file as it was only being used by the old Kdtree implementation

Edited by Silas Henrique Alves Araújo

Merge request reports