[Mapserver-users] MapServer and postgis using views

Hubert Fröhlich hubert.froehlich at bvv.bayern.de
Tue Mar 2 07:01:41 EST 2004


Dirk Geschwandtner wrote:
> At 07:56 02.03.2004, you wrote:
> 
>> 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?
> 
> 
> Hello Hubert,
> have you inserted the geometry column of the view into the 
> geometry_columns table?
> 
> To perform queries on the view you have to insert  a line containing the 
> db name, the name
> of the view, the name of the geometry column, the dimension of the 
> column, an srid and the geometry
> type of the column in the view.
> 

Well, I tried out something like

insert into geometry_columns(f_table_catalog, f_table_schema, 
f_table_name, f_geometry_column, coord_dimension, srid, type) 
values('','public','v_axflst_geom','pgpoly',2, '31494','MULTIPOLYGON');

which had neither positive nor negative effect.

( I left out the attributes "attrelid" and "varattnum" of 
"geometry_columns" as I did not know how to set them.  attrelid seems to 
be the value of the attribute "relfilenode" from pg_class. )


I would like to point out that this means that MapServer obviously tried 
to compose a message similarly to a query error etc., but the html body 
remains empty. Moreover, I worked with DEBUG=of, but there is no hint in 
the error log.

PS. I am working with MapServer 4.0.1, PostgreSQL 7.4.1 and Postgis 0.8 
with GEOS 1.0.0 on board

-- 
-------------------------------------------------------------------------------
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