[postgis-users] How create a polygon rectangular from the BBOX of a geometry.

pcreso at pcreso.com pcreso at pcreso.com
Mon Feb 18 09:30:11 PST 2013


Your view needs a primary key to work.

your gid value provides this in the table, but QGIS may not be picking this up in the view?

Does this help?

http://gis.stackexchange.com/questions/25699/how-to-make-a-spatial-view-in-postgis-and-add-it-as-a-layer-in-qgis

Brent Wood

--- On Mon, 2/18/13, Andrea Peri <aperi2007 at gmail.com> wrote:

From: Andrea Peri <aperi2007 at gmail.com>
Subject: [postgis-users] How create a polygon rectangular from the BBOX of a geometry.
To: "PostGIS Users Discussion" <postgis-users at postgis.refractions.net>
Date: Monday, February 18, 2013, 4:06 AM

Hi,

I have a table named "route_streets" with a linear geometry in the epsg:3003.

I try to create a view (v_route_streets)  that has as geometry a
polygon with the BBOX of the linear geometry.

To do this I try this sql:

  create view streets.v_route_streets as
    select a.gid, a.ri05_name as name,
ST_Extent(a.geometry)::geometry(POLYGON, 3003) as geometry from
streets.route_streets as a group by a.gid,a.ri05_nome;

It is normally created but when try to use it on qgis I'm hhaving an error.
QGIS say that this is not a valid layer.

I don't understand where is the problem.

I'm using postgis 2.0.1

Any hint is welcome,

thx,


-- 
-----------------
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-----------------
_______________________________________________
postgis-users mailing list
postgis-users at lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20130218/c76a9127/attachment.html>


More information about the postgis-users mailing list