Opened 12 years ago

Closed 12 years ago

#2214 closed defect (fixed)

OGR VRT SpatialFilter performance problem

Reported by: tamas Owned by: tamas
Priority: normal Milestone: 1.6.0
Component: OGR_SF Version: svn-trunk
Severity: normal Keywords:


I've found significal performance problems when using large datasets along with the OGR VRT driver. To limit the number of the data to be retrieved I'd use a spatialfilter and the vrt connection string looks something like: <OGRVRTDataSource><OGRVRTLayer name="mylayer"><SrcDataSource?>ODBC:gisdata,mylayer</SrcDataSource?><SrcLayer?>mylayer</SrcLayer?><GeometryType?>wkbPoint</GeometryType?><GeometryField? encoding="PointFromColumns?" useSpatialSubquery="TRUE" x="lon27" y="lat27"/></OGRVRTLayer></OGRVRTDataSource>

However when the filter geometry is not a rectangle the filter won't be applied. I consider this as a problem, since at least the bbox of the filter geometry should be used to limit the number of the records to be retrieved and the following patch should be applied:

Index: ogrvrtlayer.cpp =================================================================== --- ogrvrtlayer.cpp (revision 13472) +++ ogrvrtlayer.cpp (working copy) @@ -451,7 +451,7 @@

/* Do we want to let source layer do spatial restriction? */ /* -------------------------------------------------------------------- */

char *pszFilter = NULL;

  • if( m_poFilterGeom && m_bFilterIsEnvelope && bUseSpatialSubquery )

+ if( m_poFilterGeom && bUseSpatialSubquery && eGeometryType == VGS_PointFromColumns )


const char *pszXField, *pszYField;

Change History (1)

comment:1 Changed 12 years ago by tamas

Resolution: fixed
Status: newclosed


Note: See TracTickets for help on using tickets.