Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use ST_Force2D from PostGIS-2.1.0 up
  • Loading branch information
Sandro Santilli committed Mar 4, 2015
1 parent d2d6813 commit a525dbd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/providers/postgres/qgspostgresfeatureiterator.cpp
Expand Up @@ -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 );
}

Expand Down

0 comments on commit a525dbd

Please sign in to comment.