I have a shape file consisting of thousands of features/polygons.
I have to extract only those polygons which are within the reference
polygon.

I tried as follows:

refpoly = feat.GetGeometryRef()

fi =  'data.shp'
ids = ogr.Open(fi,0)
inlay = ids.GetLayer(0)
for feat in inlay:
    ctype = feat.GetField('Name')
    geomi = feat.GetGeometryRef()
       if geomi.Within(refpoly):
           write ods....

But it is running for weeks and not yet finished.
How to do it faster?

thanks
Ian
_______________________________________________
gdal-dev mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to