Skip to content

Commit

Permalink
postgres data items: don't set srid for geometryless layers
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Apr 7, 2015
1 parent 12d7cfc commit d6e22af
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/providers/postgres/qgspostgresdataitems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit d6e22af

Please sign in to comment.