On Fri, Jun 24, 2011 at 2:51 PM, Fernando Barbat <[email protected]> wrote:
> I have three questions about SQL Views:
>
> 1 - Is it posible to show a SQL View layer more than once in a WMS request
> using different sets of parameters?
> I've read this from SQL Views documentation:
>
> "The viewparams can be also specified on a layer per layer basis using the
> syntax viewparams=l1p1:v1;l1p2:v2,l2p1:v1;l2p2:v2,..., that is, separating
> each layer map with a comma. In this case the number of parameter maps must
> match the number of layers (or feature types) included in the request."

This functionality is available only in 2.1.1, in 2.1.0 you won't find it.
The online guide always reflects the latest stable, guides
for a specific version are included as PDF among the downloads.

> Let's suppose I have to simple polygon layers A and B, and a SQL View layer
> named sqlViewLayer defined by this query: "select the_geom from
> %parameter%".
>
> However, the following query returns an error.
>
> http://localhost:8080/geoserver/wms?strict=true&LAYERS=sqlViewLayer,sqlViewLayer&VIEWPARAMS=parameter:A,parameter:B&TRANSPARENT=TRUE&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=polygon&FORMAT=image%2Fpng&WIDTH=2205&HEIGHT=822&SRS=...&BBOX=...
>
> <ServiceExceptionReport version="1.1.1">
> <ServiceException>
>       java.lang.IllegalArgumentException: Invalid key-value pair length (3
> elements). Invalid key-value pair length (3 elements).
> </ServiceException>
> </ServiceExceptionReport>
>
> What could be happening?

I don't know, the full stack trace and the full url would be needed to
check that.
>
> 2 - Is it possible to apply different styles to each instance of the layer?

Yes

> 3 - Are SQL Views optimized to use the spatial index a backing Postgis
> table?

The sql views are sent more or less as-is to the database. More or less because
they are actually used as subqueries, so that GS does not have a need
to actually
interpret them to add the extra filters:

select <attributes from the OGC request>
from (<your sql view definition, with params expanded) as gt_view
where <filters coming from the OGC request>

It's up to the database optimizer to decide whether to use spatial
indexes or not, but
if the distribution statistics are up to date, it should

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

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

-------------------------------------------------------

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a 
definitive record of customers, application performance, security 
threats, fraudulent activity and more. Splunk takes this data and makes 
sense of it. Business sense. IT sense. Common sense.. 
http://p.sf.net/sfu/splunk-d2d-c1
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to