Skip to content

Commit

Permalink
[processing] add more possible data providers for input vector layers
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugo Mercier committed Jan 11, 2016
1 parent 716664e commit 83a24a3
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions python/plugins/processing/tools/dataobjects.py
Expand Up @@ -248,18 +248,13 @@ def getObjectFromUri(uri, forceLoad=True):
settings.setValue('/Projections/defaultBehaviour', '')

# If is not opened, we open it
layer = QgsVectorLayer(uri, uri, 'ogr')
if layer.isValid():
if prjSetting:
settings.setValue('/Projections/defaultBehaviour', prjSetting)
_loadedLayers[normalizeLayerSource(layer.source())] = layer
return layer
layer = QgsVectorLayer(uri, uri, 'postgres')
if layer.isValid():
if prjSetting:
settings.setValue('/Projections/defaultBehaviour', prjSetting)
_loadedLayers[normalizeLayerSource(layer.source())] = layer
return layer
for provider in ['ogr', 'postgres', 'spatialite', 'virtual']:
layer = QgsVectorLayer(uri, uri, provider)
if layer.isValid():
if prjSetting:
settings.setValue('/Projections/defaultBehaviour', prjSetting)
_loadedLayers[normalizeLayerSource(layer.source())] = layer
return layer
layer = QgsRasterLayer(uri, uri)
if layer.isValid():
if prjSetting:
Expand Down

0 comments on commit 83a24a3

Please sign in to comment.