[Gdal-dev] ogr find neighbours

Didrik Pinte dpinte at itae.be
Wed May 10 10:49:58 EDT 2006


Le mercredi 10 mai 2006 à 10:26 -0400, Frank Warmerdam a écrit :
> 
> Didrik,
> 
> I would suggest only using Touches() and Overlaps() on polygons whose extent
> overlaps.  Touches() and Overlaps() are very expensive.

Looking at the profiling of the code, I understand your suggestion ;-)

> In fact, you might want to install a spatial filter with a box slightly
> larger than your polygon.  Then if you build a spatial index for your
> shapefile you will only have to read and examine a very small number of
> polygons assuming your polygons aren't too extreme.

What do you mean exactly by a spatial filter ? Just creating a buffer
around the bbox of each polygon ?

Here is a screen capture of the polygons i'm working on :
http://itae.be/downloads/dataset.png

Is there a way with ogr in Python to take into account a .shx file ?

Didrik




More information about the Gdal-dev mailing list