[Qgis-developer] QgsGeos creates continuously GEOSGeometry objects in QgsGeometry

A Huarte ahuarte47 at yahoo.es
Wed Mar 2 03:14:03 PST 2016

Hi guys, QgsGeos class wraps the QgsGeometryEngine interface of a QgsAbstractGeometryV2 geometry. It is used massively for many spatial functions (IsGeosValid, contains, crosses, intersects....) in QgsGeometry.But testing perfomance I see that all operations create in QgsGeos a new GEOSGeometry instance from the current QgsGeometry object.It is a performance bottleneck (e.g. labeling), We can test....QgsGeometry a = ...
QgsGeometry b = ...

for (int  i = 0; i < 100; i++)
  bool contains = a.contains( &b );
The current code creates 200 GEOSGeometry objects.
I am right ? Is there one reason for this behavior?

I created a pull ( https://github.com/qgis/QGIS/pull/2859 ) for discussion or review. If I am wrong, my apologies, I delete the pull.
Thanks in advanceAlvaro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20160302/e0df65ad/attachment-0001.html>

More information about the Qgis-developer mailing list