[Qgis-user] PostGIS Query - DB Manager Not Recognizing Geom Column

Bernhard Ströbl bernhard.stroebl at jena.de
Mon Mar 27 22:40:16 PDT 2017


Hi,
you need to explicitly state the geometry type and SRS in you view 
definition like this:
CREATE OR REPLACE VIEW test.testbuff as
SELECT gid, area_id,
st_buffer(testshape.geom, 100)::geometry(Polygon,your_srs_code)
as geom2 FROM test.testshape where testshape.area_id=100;

could be Polygon or Multipolygon depending on the input, your_srs_code 
should be the same as testshape's

QGIS can analyze geometry columns and detect the type (and probably 
SRS), however only relations with geometry fields defined in this way 
are listed in geometry_columns.

Bernhard

Am 27.03.2017 um 23:42 schrieb Michael Treglia:
> Hi All,
>
> I'm running a PostGIS query to create a view, buffering a polygon -
> viewing the result in DB Manager, the associated icon, rather than being
> polygons, is a question mark, and in the info tab for the layer, I see
> the warning ' There is no entry in geometry_columns!'
>
> That said, the layer actually displays fine in QGIS, and in the list of
> fields, the appropriate column is labeled as Type 'geometry'.
>
> Thus, is this really a problem? And if so, any easy fixes? A sample
> query is below:
>
> CREATE OR REPLACE VIEW test.testbuff as
> SELECT gid, area_id, st_buffer(testshape.geom, 100)
> as geom2 FROM test.testshape where testshape.area_id=100;
>
>
> Thanks for any suggestions!
> Mike
>
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>



__________ Information from ESET Mail Security, version of virus signature database 15160 (20170328) __________

The message was checked by ESET Mail Security.
http://www.eset.com





More information about the Qgis-user mailing list