Bug report #12802

invisible topology

Added by Sandro Santilli over 9 years ago. Updated almost 9 years ago.

Status:Closed
Priority:High
Assignee:Sandro Santilli
Category:DB Manager
Affected QGIS version:2.8.3 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:20898

Description

The topology "city_data" as created by PostGIS topology regression test cannot be showed anymore by TopoViewer plugin of DBManager.
I'm not sure it has to do with the SRID=-1 or what else, but nothing is shown in the map.

Manually loading the "edge_data" table works.
But the "edge_data" table as loaded by the DBManager TopoViewer cannot be seen.
By saving the project I can see that the DBManager created layer has an empty extent, and hitting "Update Extents" in the layer properties (general tab) does not change things.

This happens in both 2.8 and master branches.

Associated revisions

Revision a4e629b3
Added by Sandro Santilli over 9 years ago

DBManager topoviewer: don't be fooled by srid=-1 in topology.topology

Fixes #12802

Revision fcc51bcd
Added by Sandro Santilli over 9 years ago

DBManager topoviewer: don't be fooled by srid=-1 in topology.topology

Fixes #12802

History

#1 Updated by Sandro Santilli over 9 years ago

  • Status changed from Open to Closed
  • Resolution set to invalid

can't reproduce, dunno what happened.

#2 Updated by Sandro Santilli over 9 years ago

  • Status changed from Closed to Reopened
  • Resolution deleted (invalid)

Actually, I'm still seeing it, on both 2.8 and master.
Pretty easy to reproduce. Just load POSTGIS_SOURCE_TREE/topology/test/load_topology.sql into a topology-enabled database and try to see it. Nothing is shown. Puzzling :/

#3 Updated by Sandro Santilli over 9 years ago

  • Priority changed from Normal to Severe/Regression

Sorry but I'd call this a blocker. I hadn't tested 2.8.0 or 2.8.1 or 2.8.2 yet, but 2.8 branch has an unusable topoviewer.
I'm sure the plugin being used is the one from the build dir, as it's written in the console (debug build):

src/core/qgsmaplayer.cpp: 1084: (loadNamedStyle) [0ms] uri = /usr/src/qgis/build/2.8/output/python/plugins/db_manager/db_plugins/postgis/plugins/qgis_topoview/templates/next_right.qml myURI = dbname='postgis_reg' port=5493 sslmode=disable key='edge_id' srid=-1 type=LINESTRING table="city_data"."edge_data" (geom) sql=

I confirm the table does contain data as I can load it as a single table (also via DBManager) and it is then visible.
Only it it not visible when loaded by the topoviewer. I tried changing the style after load but it still doesn't get visible.

#4 Updated by Sandro Santilli over 9 years ago

LayerProperties->General->LayerSource is as follows:

For the broken (not visible) layer:

dbname='postgis_reg' port=5493 sslmode=disable key='edge_id' srid=-1 type=LINESTRING table="city_data"."edge_data" (geom) sql=

For the working (visible) layer:

dbname='postgis_reg' port=5493 sslmode=disable key='edge_id' table="city_data"."edge_data" (geom) sql=

#5 Updated by Sandro Santilli over 9 years ago

And this is another working version of the same table, this time loaded via "Add PostGIS Layer" dialog:

dbname='postgis_reg' port=5493 sslmode=disable key='edge_id' srid=0 type=LINESTRING table="city_data"."edge_data" (geom) sql=

At this point the only different thing between the working and non-working versino is the srid=0 (working) vs. srid=-1
(not working)

Did anything change in that reguard, Jurgen ?

#6 Updated by Sandro Santilli over 9 years ago

Filed a ticket in PostGIS to request it being nicer with clients: https://trac.osgeo.org/postgis/ticket/3192
But it's still nice for QGIS to cleanly handle this.

#7 Updated by Sandro Santilli over 9 years ago

NOTE: master branch is also affected by this.
I'm testing a fix that only changes the DBManager plugin, reinterpreting SRID=-1 to SRID=0 but I would like it even better not to need this. Can I just omit the SRID and rely on the provider to figure it out for each table (would be easy by looking in geometry_columns)

#8 Updated by Sandro Santilli over 9 years ago

gah, the patch shows it still fails with this "LayerSource":

dbname='postgis_reg' port=5493 sslmode=disable key='edge_id' srid=0 type=LINESTRING table="city_data"."edge_data" (geom) sql=

#9 Updated by Sandro Santilli over 9 years ago

Sorry, the patch DOES work, only you need to zoom to the layer after loading the topology.

#10 Updated by Sandro Santilli over 9 years ago

Now trying patching postgresql provider instead, to assume it's not just SRID=0 that "does not constraint" but also SRID=-1.

#11 Updated by Sandro Santilli over 9 years ago

The provider patch didn't work, so for safety I'll just touch the dbmanager plugin, taking any SRID<=0 in topology.topology as if it was SRID=0. The topology support in postgis was only official starting with 2.0.0 so by that time SRID=0 is the official unknown value.

#12 Updated by Sandro Santilli over 9 years ago

  • Assignee set to Sandro Santilli
  • % Done changed from 0 to 80

There's no 2.8.3 choice in the "Target version", how should make sure the fix for this enters 2.8.3 ?

#13 Updated by Sandro Santilli over 9 years ago

  • Status changed from Reopened to Closed

#14 Updated by Sandro Santilli over 9 years ago

  • Status changed from Closed to Reopened

So I pushed the fix (for DBManager topoviewer plugin) in both 2.8 branch (target: 2.8.3) and master branch (target: 2.11?).
But other than writing this note I see it would not be easy to tell which version got the fix from just reading this ticket.
I think we should improve this.

#15 Updated by Sandro Santilli over 9 years ago

  • Affected QGIS version changed from 2.8.2 to 2.8.3

It turns out the canvas is back blank after saving and re-opening the project, so this is still not fully fixed :(

#16 Updated by Nyall Dawson about 9 years ago

  • Priority changed from Severe/Regression to High

Not a blocker

#17 Updated by Sandro Santilli almost 9 years ago

  • Status changed from Reopened to Closed
  • Resolution set to fixed/implemented

I cannot reproduce with current master (b2a12735c5e75d28f452545591374b16a62f937c)

Also available in: Atom PDF