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

Francois Hugues hugues.francois at irstea.fr
Sun Feb 17 23:29:17 PST 2013


Hi,

I think this error comes from a mismatch between your non pojected geometry and column type. You may try :
1. st_SetSRID(st_extent(a.geometry), 3003)
2. you may try another test with something like st_envelope(st_union(st_envelope(a.geometry)))

Hugues.


-----Original Message-----
From: postgis-users-bounces at lists.osgeo.org [mailto:postgis-users-bounces at lists.osgeo.org] On Behalf Of Andrea Peri
Sent: Sunday, February 17, 2013 4:06 PM
To: PostGIS Users Discussion
Subject: [postgis-users] How create a polygon rectangular from the BBOX of ageometry.

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


More information about the postgis-users mailing list