Skip to content

Commit

Permalink
oracle provider: optionally use extents from metadata table (implements
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Nov 5, 2013
1 parent e3e22be commit 45fea7b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/providers/oracle/qgsoracleprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() ) )
Expand Down

0 comments on commit 45fea7b

Please sign in to comment.