[gdal-dev] VRT with attribute filter?

Even Rouault even.rouault at mines-paris.org
Fri May 18 06:10:11 EDT 2012


Le vendredi 18 mai 2012 07:12:03, Tyler Mitchell a écrit :
> I've done my best to comb through the code but can't see how to use an
> attribute filter in a (OGR) VRT definition.

Tyler,

You have 2 possibilities :

1) Probalby not what you want for your use case, but you can set a OGR VRT and 
set externally an attribute filter on the returned layer. The attribute filter 
should be applied directly on the underlying source layer if you set 
<attrFilterPassThrough>TRUE</attrFilterPassThrough> in the <OGRVRTLayer> (or 
if no explicit <Field> is present, or -in trunk- automatically in compatible 
cases)

2) Or you use a <SrcSQL> definition with a WHERE clause in it. In case the 
underlying datasource as a specific implementation of ExecuteSQL() , that 
should be efficient (and even if it doesn't the generic OGR SQL engine should 
extract the WHERE clause and pass it to the SetAttributeFilter() 
implementation of the underlying layer)

Even

> 
> Tyler_______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev


More information about the gdal-dev mailing list