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

Stefan Keller sfkeller at gmail.com
Fri Mar 18 17:27:37 PDT 2011


Hi Oscar

I don't understand what you really did.

1. GeoServer can only serve tables with id and geometry.

2. Can you specify the view you defined and the join?

To me that would work too (except that the geometry attribute is lacking):

CREATE VIEW resource_file_v(id, files) AS (
  SELECT id, unnest(files) AS files FROM resource_file
);

Yours, S.

2011/3/15 Òscar Vidal Calbet <oscarblo at gmail.com>:
> 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
> _______________________________________________
> 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