Skip to content
Permalink
Browse files

postgres provider: fix b85af12

  • Loading branch information
jef-n committed May 14, 2013
1 parent 38d63d1 commit 0caf6650c1c99a4def1b2485f8650423f2fa330f
Showing with 8 additions and 17 deletions.
  1. +8 −17 src/providers/postgres/qgspostgresprovider.cpp
@@ -2640,8 +2640,13 @@ bool QgsPostgresProvider::getGeometryDetails()
}
}

if ( QgsPostgresConn::wkbTypeFromPostgis( detectedType ) == QGis::WKBUnknown )
mDetectedGeomType = QgsPostgresConn::wkbTypeFromPostgis( detectedType );
mDetectedSrid = detectedSrid;

if ( mDetectedGeomType == QGis::WKBUnknown )
{
mDetectedSrid = "";

QgsPostgresLayerProperty layerProperty;
if ( !mIsQuery )
{
@@ -2675,9 +2680,6 @@ bool QgsPostgresProvider::getGeometryDetails()
{
QgsMessageLog::logMessage( tr( "Geometry type and srid for empty column %1 of %2 undefined." ).arg( mGeometryColumn ).arg( mQuery ) );
}

detectedType = "";
detectedSrid = "";
}
else
{
@@ -2697,29 +2699,18 @@ bool QgsPostgresProvider::getGeometryDetails()
if ( layerProperty.size() == 1 )
{
// only what we requested is available
detectedType = layerProperty.types[ 0 ];
detectedSrid = layerProperty.srids[ 0 ];
}
else
{
// we need to filter
detectedType = "";
detectedSrid = "";
mDetectedGeomType = layerProperty.types[ 0 ];
mDetectedSrid = QString::number( layerProperty.srids[ 0 ] );
}
}
else
{
// geometry type undetermined or not unrequested
QgsMessageLog::logMessage( tr( "Feature type or srid for %1 of %2 could not be determined or was not requested." ).arg( mGeometryColumn ).arg( mQuery ) );
detectedType = "";
detectedSrid = "";
}
}
}

mDetectedGeomType = QgsPostgresConn::wkbTypeFromPostgis( detectedType );
mDetectedSrid = detectedSrid;

QgsDebugMsg( QString( "Detected SRID is %1" ).arg( mDetectedSrid ) );
QgsDebugMsg( QString( "Requested SRID is %1" ).arg( mRequestedSrid ) );
QgsDebugMsg( QString( "Detected type is %1" ).arg( mDetectedGeomType ) );

0 comments on commit 0caf665

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