On Mon, Dec 19, 2011 at 12:02 PM, Richard Fry <[email protected]> wrote:
>
>
> Hello,
>
>
>
> We are using geoserver to develop a portal to map survey data. As part of
> the database we have a large number response data tables which have a fixed
> table schema, but varying geometries and data rows. To enable the dynamic
> generation of map data based on an end users search criteria we have used
> SQL views (from postgresql 8.4.1 with postgis 1.5) within geoserver to
> return the map data with the tablename as the parameter:
>
>
>
> "Select * from %tableName%"
>
>
>
> This all works well for displaying the various different tables as a wms -
> however we have encountered a problem when performing GetFeatureInfo
> requests to Geoserver. This is best demonstrated on our GeoServer layer
> preview service. The following URL returns the default SQL view layer which
> when clicked upon returns the GetFeatureInfo details without any errors:
>
>
>
>
> http://wiserd.comp.glam.ac.uk:5432/geoserver/WISERD/wms?service=WMS&version=1.1.0&request=GetMap&layers=WISERD:SQL&&styles=&bbox=144750.5589668988,164082.08484382974,357048.2350393735,399518.38172061724&width=461&height=512&srs=EPSG:27700&format=application/openlayers
>
> However when you specify the tableName in the viewparams the
> getFeatureInfo request returns the following error:
>
>
>
> java.lang.RuntimeException: java.io.IOException java.io.IOException null
> ERROR: column "area_id" does not exist Position: 19
>
>
>
>
>
>
> http://wiserd.comp.glam.ac.uk:5432/geoserver/WISERD/wms?service=WMS&version=1.1.0&request=GetMap&layers=WISERD:SQL&styles=&bbox=144750.5589668988,164082.08484382974,357048.2350393735,399518.38172061724&width=461&height=512&srs=EPSG:27700&format=application/openlayers&viewparams=tableName:x_sid_liw2007_aefa_
>
>
>
> Is there something that I have missed or is it a bug in the software?
>
The sql views do not work if you change _anything_ in the set of returned
attributes when moving around
the parameters, and the parameter should have a default value so that
GeoServe can compute the table
schema in advance.
That list of attribute must not change regardless of what parameter you
provide.
In your case it seems a area_id attribute was there when GeoServer first
computed the table schema,
but changing the table name it was not part of the results anymore
Cheers
Andrea
--
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 962313
mob: +39 339 8844549
http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf
Please take note that GeoSolutions will be closed for Christmas holidays
from 27/12 to 30/12
-------------------------------------------------------
------------------------------------------------------------------------------
Learn Windows Azure Live! Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for
developers. It will provide a great way to learn Windows Azure and what it
provides. You can attend the event by watching it streamed LIVE online.
Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users