Bug report #3507
built-in spatialindex conflicts with external libspatialindex
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Debian||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||fixed/implemented|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||13567|
libspatialindex is used by the python rtree module, but when this module is loaded from within a QGIS python plugin, the symbols from the builtin copy of spatialindex collide and render the python rtree module inoperable.
How to reproduce: install the rtree python module. Start QGIS and open a python console:
>>> import rtree >>> p = rtree.index.Property() >>> p.set_storage(0) True >>> p.get_storage() 1 >>>
Stepping through in gdb shows that libspatialindex.so:Tools::PropertySet::getProperty is shadowed by a function of the same name in libqgis_core.so.
#1 Updated by Volker Fröhlich about 9 years ago
By updating the SpatialIndex wrapper and amending CMakeLists and creating a Cmake script, I managed to build QGIS with a systemwide libspatialindex.
Wonder proposed to update the shipped copy of SpatialIndex and update the wrapper, so the user has the choice to use either lib.
Doing so, would help your problem, I suppose.
I can provide a patch, but I'm not a 100% sure, everything works correct or that my patch is sound, as I am no C++ programmer. Maybe we should do that after 1.7.