Feature request #9521
Introduce support for "prepared" geometries
|Pull Request or Patch supplied:||No||Resolution:||fixed/implemented|
|Easy fix?:||No||Copied to github as #:||18111|
Since GEOS 3.1 there is support for some geometry operations on so called prepared geometries which can greatly improve performance:
We could have a new class QgsPreparedGeometry in QGIS core library that would encapsulate the GEOS operations - various fTools algorithms could benefit from that. For example, points in polygon algorithm which may take really long time otherwise (see #5162)
#2 Updated by Martin Dobias about 6 years ago
Hi Larry - the algorithm in PAL that checks overlaps in PAL works with label candidate rectangles (possibly rotated), it is relatively simple computation to check whether rectangles intersect (16x dot product). I am not sure if prepared geometries would improve that (they are very good for complex geometries). Probably a more valid optimization would be to stop counting overlaps after reaching a certain amount - and penalize the candidate with a fixed cost. In dense areas PAL may compute millions of overlaps without having much use for that.
Also, the overlap-check algorithm is just one part of the pre-processing for labeling - I recall there were also other pieces of code where sub-optimal geometry algorithms were involved...