[postgis-users] postgis through views

Stephen Woodbridge woodbri at swoodbridge.com
Thu Oct 27 16:15:11 PDT 2005


Eric Hanson wrote:
> We're trying to use PostGIS through a VIEW with Mapserver.  We have two 
> identical tables, one being accessed natively and one through a VIEW with
> 
> CREATE VIEW r200408_wet_fill as select * from r2004_wet_fill.

Eric,

Can you try doing something like:

CREATE VIEW r200408_wet_fill as select oid, * from r2004_wet_fill

-Steve W.

> Things seem to not be working.  Are there any known problems for using 
> VIEWs with PostGIS?
> 
> Thanks,
> Eric
> 
> 
> [client 24.22.56.63] PHP Warning:  [MapServer Error]: msDrawMap(): 
> Failed to draw layer named 'Wetlands'.\n in 
> /n/fs.research.pdx.edu/disk/resuser01/u/elhanson/public_html/oscdl/map.php 
> on line 281, referer: 
> http://geospatial.research.pdx.edu:1025/~elhanson/oscdl/
> [client 24.22.56.63] PHP Warning:  [MapServer Error]: 
> prepare_database(): Error executing POSTGIS DECLARE (the actual query) 
> statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT 
> asbinary(force_collection(force_2d(the_geom)),'NDR'),OID::text from 
> r200408_wet_fill WHERE the_geom && setSRID('BOX3D(7477447.5409836 
> 540799.999999963,7865352.4590164 811999.99999998)'::BOX3D, 
> find_srid('','r200408_wet_fill','the_geom') )' <br><br>\n\nPostgresql 
> reports the error as 'ERROR:  column "oid" does not 
> exist\n'<br><br>\n\nMore Help:<br><br>\n\nError with POSTGIS data 
> variable. You specified '<check your .map file>'.<br>\nStandard 
> ways of specifiying are : <br>\n(1) 'geometry_column from 
> geometry_table' <br>\n(2) 'geometry_column from (<sub query>) as 
> foo using unique <column name> using SRID=<srid#>' 
> <br><br>\n\nMake sure you put in the 'using unique  <column name>' 
> and 'using SRID=#' clauses in.\n\n<br><br>For more help, please see 
> http://postgis.refractions.net/documentation.php 
> \n\n<br><br>Mappostgis.c - version of Jan 23/2004.\n\n in 
> /n/fs.research.pdx.edu/disk/resuser01/u/elhanson/public_html/oscdl/map.php 
> on line 281, referer: 
> http://geospatial.research.pdx.edu:1025/~elhanson/oscdl/
> [client 24.22.56.63] PHP Fatal error:  Call to a member function 
> saveImage() on a non-object in 
> /n/fs.research.pdx.edu/disk/resuser01/u/elhanson/public_html/oscdl/map.php 
> on line 285, referer: 
> http://geospatial.research.pdx.edu:1025/~elhanson/oscdl/
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 




More information about the postgis-users mailing list