Skip to content
Permalink
Browse files

oracle provider: optionally use extents from metadata table (implements

  • Loading branch information
jef-n committed Nov 5, 2013
1 parent e3e22be commit 45fea7b461ab3a61b0d0d034b0f696c85d315499
Showing with 22 additions and 0 deletions.
  1. +22 −0 src/providers/oracle/qgsoracleprovider.cpp
@@ -1993,6 +1993,28 @@ QgsRectangle QgsOracleProvider::extent()
QString sql;
QSqlQuery qry( *mConnection );

if ( mUseEstimatedMetadata )
{
if ( exec( qry, QString( "SELECT sdo_lb,sdo_ub FROM mdsys.all_sdo_geom_metadata m, table(m.diminfo) WHERE owner=%1 AND table_name=%2 AND column_name=%3 AND sdo_dimname='X'" )
.arg( quotedValue( mOwnerName ) )
.arg( quotedValue( mTableName ) )
.arg( quotedValue( mGeometryColumn ) ) ) && qry.next() )
{
mLayerExtent.setXMinimum( qry.value( 0 ).toDouble() );
mLayerExtent.setXMaximum( qry.value( 1 ).toDouble() );

if ( exec( qry, QString( "SELECT sdo_lb,sdo_ub FROM mdsys.all_sdo_geom_metadata m, table(m.diminfo) WHERE owner=%1 AND table_name=%2 AND column_name=%3 AND sdo_dimname='Y'" )
.arg( quotedValue( mOwnerName ) )
.arg( quotedValue( mTableName ) )
.arg( quotedValue( mGeometryColumn ) ) ) && qry.next() )
{
mLayerExtent.setYMinimum( qry.value( 0 ).toDouble() );
mLayerExtent.setYMaximum( qry.value( 1 ).toDouble() );
return mLayerExtent;
}
}
}

bool ok = false;

if ( !mSpatialIndex.isNull() && ( mUseEstimatedMetadata || mSqlWhereClause.isEmpty() ) )

0 comments on commit 45fea7b

Please sign in to comment.
You can’t perform that action at this time.