[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-users
Subject:    Re: [postgis-users] change column type in view
From:       "Francois Hugues" <hugues.francois () irstea ! fr>
Date:       2012-08-29 14:12:00
Message-ID: 3CB901080554B04881D30F111F62D93001F63290 () nadia ! grenoble ! cemagref ! fr
[Download RAW message or body]

--===============8154645568103350154==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01CD85F0.47918272"

This is a multi-part message in MIME format.


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@postgis.refractions.net \
[mailto:postgis-users-bounces@postgis.refractions.net] De la part de Dale Rudrum \
Envoyé : mercredi 29 août 2012 15:55 À : postgis-users@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


[Attachment #3 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.19258"></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=860245713-29082012>Didi you simply try to change type on the fly ? 
Something like should work</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=860245713-29082012></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=860245713-29082012><FONT color=#000000 size=3 
face="Times New Roman">st_estimated_extent('public', 
geometry_columns.f_table_name, geometry_columns.f_geometry_column)::geometry AS 
extent</FONT></SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#000000 size=3 face="Times New Roman"><SPAN 
class=860245713-29082012></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=860245713-29082012>Hugues.</SPAN></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV align=left><FONT size=2 face=Arial></FONT>&nbsp;</DIV><BR>
<DIV dir=ltr lang=fr class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>De&nbsp;:</B> 
postgis-users-bounces@postgis.refractions.net 
[mailto:postgis-users-bounces@postgis.refractions.net] <B>De la part de</B> Dale 
Rudrum<BR><B>Envoyé&nbsp;:</B> mercredi 29 août 2012 15:55<BR><B>À&nbsp;:</B> 
postgis-users@postgis.refractions.net<BR><B>Objet&nbsp;:</B> [postgis-users] 
change column type in view<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV>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:</DIV>
<DIV></DIV>
<DIV>CREATE OR REPLACE VIEW project_overview AS <BR>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<BR>FROM geometry_columns<BR>WHERE 
geometry_columns.f_table_name::text &lt;&gt; 'project_overview';</DIV>
<DIV></DIV>
<DIV>which works fine, save that the type of the column extent is not geometry. 
Therefore autocad and quantum GIS cannot acces the information</DIV>
<DIV>Is there a way to change this in the definition of the view, or to bypass 
the problem&nbsp;by using a second view? As a newby I'm stuck at this 
point.</DIV>
<DIV>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.</DIV>
<DIV></DIV>
<DIV>Thanks</DIV>
<DIV>Dale Rudrum</DIV></BODY></HTML>


_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

--===============8154645568103350154==--

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic