[Mapserver-users] MapServer and postgis using views

Hubert Fröhlich hubert.froehlich at bvv.bayern.de
Mon Mar 1 22:56:47 PST 2004


Hello list,

I use MapServer 4.0 / 4.0.1) with postgis. I have defined a layer in a 
static mapfile (no mapscript at all)

LAYER
   CONNECTIONTYPE postgis
   NAME "flstpgx_poly"
   CONNECTION "dbname=ax host=va45c28 user=postgres"
   DATA "pgpoly from (select * from v_axflst_geom ) as foo using unique
obnr using SRID=31494"
   HEADER "q_flstpgx_header.html"
   FOOTER "q_DEFAULT_footer.html"
   STATUS OFF
   TYPE POLYGON
   MAXSCALE 200000
#  FILTER "gemeinde > 0"
   CLASS
     NAME "Flurstücke"
#   EXPRESSION "gemschl > 0"
     TEMPLATE "q_flstpgx.html"
     COLOR -1 -1 -1
     OUTLINECOLOR 200 0 0
   END
END

v_axflst_geom is a view on a table axflst defining the subset of the 
attributes which I REALLY need.

I have defined a template for browsing and querying the layer.

Browsing is fine. Queries, however, result in an empty html message output.

When I do not work with a view but read directly from the table with the 
mapfile entry

DATA "pgpoly from axflst"

the query seems fine.

Did I miss something in dealing with views?

Greetings,

Hubert

-- 
-------------------------------------------------------------------------------
Dr.-Ing. Hubert Fröhlich			
Bezirksfinanzdirektion München 			
Alexandrastr. 3, D-80538 München, GERMANY
Tel. :+49 (0)89 / 2190 - 2980
Fax  :+49 (0)89 / 2190 - 2997
hubert dot froehlich at bvv dot bayern dot de




More information about the MapServer-users mailing list