Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
postgres provider: restore behaviour to keep 3d wkb (refs #9651,
followup bd311c8)
- Loading branch information
Showing
1 changed file
with
10 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -454,13 +454,15 @@ bool QgsPostgresConn::getTableInfo( bool searchGeometryColumnsOnly, bool searchP | |
srid = INT_MIN; | ||
} | ||
|
||
/*QgsDebugMsg( QString( "%1 : %2.%3.%4: %5 %6 %7 %8" ) | ||
#if 0 | ||
QgsDebugMsg( QString( "%1 : %2.%3.%4: %5 %6 %7 %8" ) | ||
.arg( gtableName ) | ||
.arg( schemaName ).arg( tableName ).arg( column ) | ||
.arg( type ) | ||
.arg( srid ) | ||
.arg( relkind ) | ||
.arg( dim ) );*/ | ||
.arg( dim ) ); | ||
#endif | ||
|
||
layerProperty.schemaName = schemaName; | ||
layerProperty.tableName = tableName; | ||
|
@@ -470,11 +472,11 @@ bool QgsPostgresConn::getTableInfo( bool searchGeometryColumnsOnly, bool searchP | |
layerProperty.srids = QList<int>() << srid; | ||
layerProperty.sql = ""; | ||
/* | ||
* NOTE: force2d may get a false negative value | ||
* force2d may get a false negative value | ||
* (dim == 2 but is not really constrained) | ||
* http://trac.osgeo.org/postgis/ticket/3068 | ||
*/ | ||
layerProperty.force2d = dim > 2; | ||
layerProperty.force2d = dim > 3; | ||
addColumnInfo( layerProperty, schemaName, tableName, isView ); | ||
|
||
if ( isView && layerProperty.pkCols.empty() ) | ||
|
@@ -1303,10 +1305,9 @@ void QgsPostgresConn::retrieveLayerTypes( QgsPostgresLayerProperty &layerPropert | |
query += QString::number( srid ); | ||
} | ||
|
||
if ( ! layerProperty.force2d ) | ||
if ( !layerProperty.force2d ) | ||
{ | ||
query += ","; | ||
query += QString( "%1(%2%3)" ) | ||
query += QString( ",%1(%2%3)" ) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
strk
Contributor
|
||
.arg( majorVersion() < 2 ? "ndims" : "st_ndims" ) | ||
.arg( quotedIdentifier( layerProperty.geometryColName ) ) | ||
.arg( layerProperty.geometryColType == sctGeography ? "::geometry" : "" ); | ||
|
@@ -1325,10 +1326,9 @@ void QgsPostgresConn::retrieveLayerTypes( QgsPostgresLayerProperty &layerPropert | |
QString type = gresult.PQgetvalue( i, 0 ); | ||
QString srid = gresult.PQgetvalue( i, 1 ); | ||
|
||
if ( ! layerProperty.force2d ) | ||
if ( !layerProperty.force2d && gresult.PQgetvalue( i, 2 ).toInt() > 3 ) | ||
{ | ||
QString ndims = gresult.PQgetvalue( i, 2 ); | ||
if ( ndims.toInt() > 2 ) layerProperty.force2d = true; | ||
layerProperty.force2d = true; | ||
} | ||
|
||
if ( type.isEmpty() ) | ||
|
was this intentional ?