[postgis-users] Publishing WMS from PostTGIS table with ARRAY type field

Òscar Vidal Calbet oscarblo at gmail.com
Tue Mar 15 14:28:28 PDT 2011


Hey everyone,

I published some WMS services in Geoserver from PostGIS database and I
need to make a GetFeaureInfo that gives me data from different tables,
which can be solved by creating a VIEW. The problem is that I need
that one of the fields in the VIEW be allowed to give me N entities
referring to N files (strings with the path) related with the feature.
To solve that in Postgres I created an ARRAY of  Composite Types in
the table:

CREATE TYPE file AS (

    file_name        varchar(64),

    file_url         varchar(256),

    ...
);



CREATE TABLE resource_file

(

  id serial NOT NULL,

  from_table varchar(32) NOT NULL,

  with_id integer NOT NULL,

  files ARRAY file,

  CONSTRAINT resource_file_pkey PRIMARY KEY (id)

)

So I'm creating a VIEW with the feature JOIN resource_file to get the
info of the feature with all the (N) files associated. But when I'm
publishing the VIEW, apparently there is no error but the ARRAY field
is missing. I check in the OpenGIS® Web Map Server Implementation
Specification
, but I didn't find anything about if it can be done or not.

Is it possible?
I would like to solve the problem by having only one request to the
server to get the N files. Any suggestions?
Maybe I can create a function in Postgres that builds already the
content (a string with html tags) to show the N files and pass this to
the view?

Thanks in advance!
oscar



More information about the postgis-users mailing list