Skip to content

Commit a4e629b

Browse files
author
Sandro Santilli
committed
DBManager topoviewer: don't be fooled by srid=-1 in topology.topology
Fixes #12802
1 parent 1418fdb commit a4e629b

File tree

1 file changed

+5
-1
lines changed
  • python/plugins/db_manager/db_plugins/postgis/plugins/qgis_topoview

1 file changed

+5
-1
lines changed

python/plugins/db_manager/db_plugins/postgis/plugins/qgis_topoview/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ def run(item, action, mainwindow):
8181
mainwindow.infoBar.pushMessage("Invalid topology", u'Schema "{0}" is not registered in topology.topology.'.format(item.schema().name), QgsMessageBar.WARNING, mainwindow.iface.messageTimeout())
8282
return False
8383

84-
toposrid = str(res[0])
84+
if ( res[0] < 0 ):
85+
mainwindow.infoBar.pushMessage("WARNING", u'Topology "{0}" is registered as having a srid of {1} in topology.topology, we will assume 0 (for unknown)'.format(item.schema().name, res[0]), QgsMessageBar.WARNING, mainwindow.iface.messageTimeout())
86+
toposrid = '0'
87+
else:
88+
toposrid = str(res[0])
8589

8690
# load layers into the current project
8791
toponame = item.schema().name

0 commit comments

Comments
 (0)