Bug report #9748

PostGIS table loads but won't display.

Added by Jesse Bishop over 5 years ago. Updated over 4 years ago.

Status:Closed
Priority:Severe/Regression
Assignee:-
Category:Data Provider/PostGIS
Affected QGIS version:2.2.0 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:18298

Description

PostGIS layers with 4d geometry will load in QGIS 2.2 but will not draw. The attribute table is visible and it is possible to query against it. I have been able to repeat this using:
  • POSTGRESQL 9.3.1 POSTGIS="2.1.1 r12113" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.10.1, released 2013/08/26" LIBXML="2.7.3" LIBJSON="UNKNOWN" TOPOLOGY RASTER
  • POSTGRESQL 9.1.6 POSTGIS="2.0.2 r10789" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.9.2, released 2012/10/08" LIBXML="2.7.3" LIBJSON="UNKNOWN" RASTER

The layers display with no issues in QGIS 2.0. After dumping the layers to shapefile using pgsql2shp, the shapefile can be added to QGIS 2.2 and it will display. Also, converting the geometry to 2d (using ST_Force2d) results in the layer being visible in QGIS 2.2.

I did not have data available to test whether the same issue affects 3dm or 3dz data from PostGIS.


Related issues

Related to QGIS Application - Bug report #9032: LINESTRINGM not displayed Closed 2013-11-08
Related to QGIS Application - Bug report #10757: PostGIS table view loads but won't display Closed 2014-06-30
Related to QGIS Application - Bug report #9651: PostGIS polyhedral and TIN layers not handled anymore Closed 2014-02-25
Duplicated by QGIS Application - Bug report #10406: Impossible to display PostGIS table with geometry in 4 di... Closed 2014-05-30

Associated revisions

Revision 016b03b5
Added by Jürgen Fischer over 5 years ago

postgres: convert 4d geometries to 2d (fixes #9748)

Revision f512e87f
Added by Sandro Santilli over 4 years ago

Detect number of dimensions for tables with unconstrained type

Fixes #9748

Revision 3d6554e0
Added by Sandro Santilli over 4 years ago

Detect number of dimensions for tables with unconstrained type

Fixes #9748

(cherry picked from commit f512e87ffd0ed7297520bf63830c1fc5c37d7ee9)

History

#1 Updated by Alessandro Pasotti over 5 years ago

  • Priority changed from Normal to Severe/Regression

Just a me too: I have a couple of postgis tables that are not visible in 2.2 (they were in previous version).

The tables have column MultiPolygonZM

In the logs I see (might be unrelated though):

rc/core/symbology-ng/qgsrendererv2.cpp: 362: (renderFeatureWithSymbol) feature 89: unsupported wkb type 0x800007d6 for rendering

After changing geometry to 2D with ST_Force_2D the layers becomes visible again.

This is the query I used:
ALTER TABLE prg_tutela ALTER COLUMN geom TYPE geometry(MultiPolygon,32632) USING ST_Force_2d(geom);

See also:
http://gis.stackexchange.com/questions/88785/postgresql-table-wont-display-in-qgis-2-2

#2 Updated by Jürgen Fischer over 5 years ago

  • Category set to Data Provider/PostGIS

#3 Updated by Jürgen Fischer over 5 years ago

  • Status changed from Open to Closed

#4 Updated by Sandro Santilli over 4 years ago

  • Status changed from Closed to Reopened
  • Target version set to Version 2.8.2

Reopening as this table does not load in any of 1.8, 2.4, 2.6, 2.8 and master barnches:

CREATE TABLE t (g geometry);
INSERT INTO t VALUES ('POINT(0 0 0 0)');

See also http://trac.osgeo.org/postgis/ticket/3068

#5 Updated by Sandro Santilli over 4 years ago

Note that enforcing a coordinate dimension constraint so that geometry_columns."coord_dimension" returns 4 is not enough by itself, but it also takes geometry_columns.type to be != 'GEOMETRY' for QGIS to force 2d. It would be very helpful to get a comprehensive testcase covering all combinations.

#6 Updated by Sandro Santilli over 4 years ago

I've pushed a fix as f512e87ffd0ed7297520bf63830c1fc5c37d7ee9 -- is it ok to backport this to 2.8 branch too ?

#7 Updated by Sandro Santilli over 4 years ago

  • Status changed from Reopened to Closed

Also available in: Atom PDF