[Gdal-dev] spatial intersection of ogr geometry and shapefile features

Martel, Christian Christian.Martel at drdc-rddc.gc.ca
Wed Jun 6 12:29:26 EDT 2007


Hi,

I have an OGR geometry and a shapefile of all worldwide countries. I
need to find which countries intersect my geometry (bbox of country is
fine). I'm working in Python with FWTools. I found some hints in the
list but I need more help.

What should I try ?
- Create a qix index file and work with shapefile ? If so, how to
compare geometries with DataSource.ExecuteSQL(...) command ? How to use
the index for that comparison ?
- In a loop, build ogr geometry of each country and compare it with the
current geometry (not very efficient I think) ?

I have experience with gdal/ogr with python in fwtool and I know how to
write/read shapefiles.

Thanks,
Christian





More information about the Gdal-dev mailing list