[postgis-users] change column type in view
Francois Hugues
hugues.francois at irstea.fr
Wed Aug 29 07:12:00 PDT 2012
Didi you simply try to change type on the fly ? Something like should work
st_estimated_extent('public', geometry_columns.f_table_name, geometry_columns.f_geometry_column)::geometry AS extent
Hugues.
________________________________
De : postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] De la part de Dale Rudrum
Envoyé : mercredi 29 août 2012 15:55
À : postgis-users at postgis.refractions.net
Objet : [postgis-users] change column type in view
To have an easy and quick acces to the various projects we have had over the years I would like to have a table with in it polygons representing the areas in which work was done. It seems to me that a view would be easiest as this is updated automatically. I came up with this script:
CREATE OR REPLACE VIEW project_overview AS
SELECT geometry_columns.f_table_name AS table, geometry_columns.f_geometry_column AS geometrycol, st_estimated_extent('public', geometry_columns.f_table_name, geometry_columns.f_geometry_column) AS extent
FROM geometry_columns
WHERE geometry_columns.f_table_name::text <> 'project_overview';
which works fine, save that the type of the column extent is not geometry. Therefore autocad and quantum GIS cannot acces the information
Is there a way to change this in the definition of the view, or to bypass the problem by using a second view? As a newby I'm stuck at this point.
Also suggestions for different setups solving my problem would be appreciated. Because of our use of autocad we are restricted to PostGIS 1.5 on postgres 9.0.
Thanks
Dale Rudrum
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20120829/94d921ab/attachment.html>
More information about the postgis-users
mailing list