Skip to content

Commit

Permalink
Use ST_Force2D for PostGIS 2.1+
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandro Santilli committed Sep 5, 2013
1 parent a2774a0 commit 38d960e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/providers/postgres/qgspostgresfeatureiterator.cpp
Expand Up @@ -274,7 +274,9 @@ bool QgsPostgresFeatureIterator::declareCursor( const QString& whereClause )
{
query += QString( "%1(%2(%3%4),'%5')" )
.arg( P->mConnectionRO->majorVersion() < 2 ? "asbinary" : "st_asbinary" )
.arg( P->mConnectionRO->majorVersion() < 2 ? "force_2d" : "st_force_2d" )
.arg( P->mConnectionRO->majorVersion() < 2 ? "force_2d"
: P->mConnectionRO->majorVersion() > 2 || P->mConnectionRO->minorVersion() > 0 ? "ST_Force2D"
: "st_force_2d" )
.arg( P->quotedIdentifier( P->mGeometryColumn ) )
.arg( P->mSpatialColType == sctGeography ? "::geometry" : "" )
.arg( P->endianString() );
Expand Down

0 comments on commit 38d960e

Please sign in to comment.