Skip to content
Permalink
Browse files

Use ST_Force2D from PostGIS-2.1.0 up

  • Loading branch information
Sandro Santilli
Sandro Santilli committed Mar 3, 2015
1 parent 6fd879d commit 472fbbed4903dae01debf7e805b550996f594218
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/providers/postgres/qgspostgresfeatureiterator.cpp
@@ -322,7 +322,12 @@ bool QgsPostgresFeatureIterator::declareCursor( const QString& whereClause )
if ( mSource->mForce2d )
{
geom = QString( "%1(%2)" )
.arg( mConn->majorVersion() < 2 ? "force_2d" : "st_force_2d" )
// Force_2D before 2.0
.arg( mConn->majorVersion() < 2 ? "force_2d"
// ST_Force2D since 2.1.0
: mConn->majorVersion() > 2 || mConn->minorVersion() > 0 ? "st_force2d"
// ST_Force_2D in 2.0.x
: "st_force_2d" )
.arg( geom );
}

0 comments on commit 472fbbe

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