Skip to content

Commit 90b3efb

Browse files
committedJun 26, 2015
postgres provider: also cast geography to geometry when using && (fixes #8572)
1 parent 16ad2f8 commit 90b3efb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎src/providers/postgres/qgspostgresfeatureiterator.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,14 +289,14 @@ QString QgsPostgresFeatureIterator::whereClauseRect()
289289
.arg( mSource->mRequestedSrid.isEmpty() ? mSource->mDetectedSrid : mSource->mRequestedSrid );
290290
}
291291

292+
bool castToGeometry = mSource->mSpatialColType == sctGeography ||
293+
mSource->mSpatialColType == sctPcPatch;
294+
292295
QString whereClause = QString( "%1%2 && %3" )
293296
.arg( QgsPostgresConn::quotedIdentifier( mSource->mGeometryColumn ) )
294-
.arg( mSource->mSpatialColType == sctPcPatch ? "::geometry" : "" )
297+
.arg( castToGeometry ? "::geometry" : "" )
295298
.arg( qBox );
296299

297-
bool castToGeometry = mSource->mSpatialColType == sctGeography ||
298-
mSource->mSpatialColType == sctPcPatch;
299-
300300
if ( mRequest.flags() & QgsFeatureRequest::ExactIntersect )
301301
{
302302
QString curveToLineFn; // in postgis < 1.5 the st_curvetoline function does not exist

0 commit comments

Comments
 (0)
Please sign in to comment.