Alexandre, Your straight forward method is the best.
PostGIS takes care of optimization using rectangular bounding boxes. Union function works best if you use it as an aggregate function. In OGR, you can use OGRGeometry::UnionCascaded() by passing a OGRGeometryCollection object to it. On Fri, Jun 10, 2011 at 12:58 AM, Alexandre Gacon < alexandre.gacon+g...@gmail.com> wrote: > Hi, > > I am using GDAL/OGR to find the links under a set of towns, on the whole > France territory. > > My links and my towns are stored on a Postgis database. > > For the moment I use the most precise request I can: > > - I make a union of all the polygons of the towns I am interested in > - I send a request with GDAL to the Postgis database to get the links > covered by the geometry > - I read the result > > Would it be faster if I make a request for each town, instead of making the > union of the geometries ? > > Would it be faster if I use a simple spatial filter (like a rectangle) > instead of the precise geometry ? > > -- > Alexandre Gacon > > -- Best regards, Chaitanya kumar CH. /tʃaɪθənjə/ /kʊmɑr/ +91-9494447584 17.2416N 80.1426E
_______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev