I have a table in postgresql with mixed geometry, but it is not accessible in QGIS. I am running QGIS version 2.8.2. Is there any plugin to install for QGIS to render multiple geometry?
You can create views on your table to access the different geometry types as separate layers in QGIS, for example:
CREATE VIEW parcel_polygons AS SELECT id, name, geom::geometry(MultiPolygon, 4326) FROM parcels WHERE GeometryType(geom) = 'MULTIPOLYGON'; CREATE VIEW parcel_points AS SELECT id, name, geom::geometry(Point, 4326) FROM parcels WHERE GeometryType(geom) = 'POINT';
Note the typecast from a generic geometry type (
geometry) to a specific geometry type (
geometry(Point, 4326)). This helps client applications, like QGIS, understand what geometry type is exposed by the view.
Different versions of QGIS load views with varying degrees of success. If you have difficulty loading the view using the "Add PostGIS Layers" dialog, give the "DB Manager" method a try too.