[QGIS-Developer] Intersections with Qgis

Håvard Tveite havard.tveite at nmbu.no
Mon Apr 6 03:01:11 PDT 2020


You can try QgsSpatialIndex.  Look around for examples.

Håvard

On 06.04.2020 11:37, Johannes Wildermuth wrote:
> Hello developers
> I've been currently working on a python plugin in which I have to find 
> all possible intersections on one layer. I want to improve the 
> efficiency of this task. It roughly looks like this:
> for i, geom in enumerate(geoms):
>      for j, geom in enumerate(geoms):
>          if j > i:
>              //intersections
> Is there a faster way? Perhaps with multithreading / rtree?
> Regards
> Johannes Wildermuth


More information about the QGIS-Developer mailing list