Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
postgres provider: also cast geography to geometry when using && (fixes
  • Loading branch information
jef-n committed Jun 26, 2015
1 parent 16ad2f8 commit 90b3efb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/providers/postgres/qgspostgresfeatureiterator.cpp
Expand Up @@ -289,14 +289,14 @@ QString QgsPostgresFeatureIterator::whereClauseRect()
.arg( mSource->mRequestedSrid.isEmpty() ? mSource->mDetectedSrid : mSource->mRequestedSrid );
}

bool castToGeometry = mSource->mSpatialColType == sctGeography ||
mSource->mSpatialColType == sctPcPatch;

QString whereClause = QString( "%1%2 && %3" )
.arg( QgsPostgresConn::quotedIdentifier( mSource->mGeometryColumn ) )
.arg( mSource->mSpatialColType == sctPcPatch ? "::geometry" : "" )
.arg( castToGeometry ? "::geometry" : "" )
.arg( qBox );

bool castToGeometry = mSource->mSpatialColType == sctGeography ||
mSource->mSpatialColType == sctPcPatch;

if ( mRequest.flags() & QgsFeatureRequest::ExactIntersect )
{
QString curveToLineFn; // in postgis < 1.5 the st_curvetoline function does not exist
Expand Down

0 comments on commit 90b3efb

Please sign in to comment.