Skip to content
Permalink
Browse files
postgres data items: don't set srid for geometryless layers
(cherry picked from commit d6e22af)
  • Loading branch information
jef-n committed Apr 7, 2015
1 parent 7210c4a commit 21b5a82c2137413fe8d6b9ef7e0fc1ee099326bb
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/providers/postgres/qgspostgresdataitems.cpp
@@ -263,8 +263,9 @@ QString QgsPGLayerItem::createUri()

QgsDataSourceURI uri( QgsPostgresConn::connUri( connItem->name() ).connectionInfo() );
uri.setDataSource( mLayerProperty.schemaName, mLayerProperty.tableName, mLayerProperty.geometryColName, mLayerProperty.sql, pkColName );
uri.setSrid( QString::number( mLayerProperty.srids[0] ) );
uri.setWkbType( mLayerProperty.types[0] );
if ( uri.wkbType() != QGis::WKBNoGeometry )
uri.setSrid( QString::number( mLayerProperty.srids[0] ) );
QgsDebugMsg( QString( "layer uri: %1" ).arg( uri.uri() ) );
return uri.uri();
}

0 comments on commit 21b5a82

Please sign in to comment.