[Qgis-user] PostGIS views

Frank Broniewski brfr at metrico.lu
Thu Mar 6 04:59:14 PST 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

I've a problem adding a PostGIS view to my QGIS project. I have a
osm2pgsql database and a view which selects all the buildings from the
planet_osm_polygon table.

The first thing I notice is that there are two entries for the
buildings view, one with a Polygon spatial type, and one where I have
to select the spatial type. OK, the same is true for the
planet_osm_polygon table, so I think this is OK.

Now I mark the Polygon-building view and click on the Add button and I
get an error with the db credentials and the below message:
... is an invalid layer and cannot be loaded. Please check the message
log for details. So here's the output from that - not that there is
more insight to be gained ;-) :
dbname='lux' host=XYZ port=5432 user='XYZ' password='YZX' key='osm_id'
srid=3857 type=POLYGON table="public"."buildings" (way) sql= is an
invalid layer - not loaded

Adding a view from the planet_osm_point works though. And also if I
add the planet_osm_polygon table with a corresponding filter set. Any
ideas what could be wrong with the view?

Software versions are:
QGIS 2.2
PostGIS 2.1
PostgreSQL 9.3
Ubuntu 12.04 (Ubuntugis-unstable PPA)

View def:
CREATE OR REPLACE VIEW buildings AS
 SELECT planet_osm_polygon.osm_id,
    planet_osm_polygon.name,
    planet_osm_polygon.way
   FROM planet_osm_polygon
  WHERE planet_osm_polygon.tags ? 'building'::text;
- -- 
Frank BRONIEWSKI

METRICO s.à r.l.
géomètres
technologies d'information géographique
rue des Romains 36
L-5433 NIEDERDONVEN

tél.: +352 26 74 94 - 28
fax.: +352 26 74 94 99
http://www.metrico.lu
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJTGHEKAAoJEHopqW0d1cQVKhgH/3+cOlsHRMKkSZjITDLHCO9z
cpHh6+EYXSJOgJ7T5koZmWwCmDGlY4dXDBsDffViP+Wm6zsXkBiyr73i9xdImfoX
/PyxrcuQrFC+/qaf9m0RdHH4NCW/oFRhnFjeQqcuVznnOb6tO/z9vmLhvS3s91sK
7d+NIDt/J4MV/3UTRdK5DHjuaEyimYiYi799HLTNTxuCXaee9XJqmEj3XgoneY1O
LZ/iEXQBNuR/Ilz1erXN4dSp2M8Wbhyv/pSCUTFVOufsmDU6wmyQ87ZMUu6lFiDQ
YzEAiQ2sU3Xyjiyh5fLNuS+SuVqucBhabKahBOwQPVLDJyha3A9/UI5n1YTLTVY=
=y0p7
-----END PGP SIGNATURE-----



More information about the Qgis-user mailing list