Skip to content
Permalink
Browse files

postgres data items: don't set srid for geometryless layers

  • Loading branch information
jef-n committed Apr 7, 2015
1 parent 12d7cfc commit d6e22af94965a6601d93374e892edb2a9a5ebd6c
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 d6e22af

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