Skip to content
Permalink
Browse files

Use ST_Force2D for PostGIS 2.1+

  • Loading branch information
Sandro Santilli
Sandro Santilli committed Jul 29, 2013
1 parent 524fd52 commit 7304dc13c4e604314629375864f136dc79a0ce90
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/providers/postgres/qgspostgresfeatureiterator.cpp
@@ -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() );

0 comments on commit 7304dc1

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