Skip to content
Permalink
Browse files

postgres provider: also cast geography to geometry when using && (fixes

#8572)

(cherry picked from commit 90b3efb)
  • Loading branch information
jef-n committed Jun 26, 2015
1 parent 166bcd4 commit 3792afdb2365235410bbef2e98ef9007332908a4
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/providers/postgres/qgspostgresfeatureiterator.cpp
@@ -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

0 comments on commit 3792afd

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