Skip to content
Permalink
Browse files

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

  • Loading branch information
jef-n committed Jun 26, 2015
1 parent 16ad2f8 commit 90b3efb93dd0b6460ce496a8acd7fcbf34b22f63
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 90b3efb

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