On Tue, Jul 19, 2011 at 2:35 PM, Gis Mage <[email protected]> wrote:
> Hi list!
>
> I'm trying to use a simple cross-layer filter in a WMS GetMap request, like
> in a tutorial here:
> http://docs.geoserver.org/stable/en/user/extensions/querylayer/index.html
>
> Since I'm using GS2.1.1, I've copied querylayer-2.1.1.jar to a lib folder,
> and restarted GS.
>
> Then I've got lines
>
> <ogc:FunctionName nArgs="-1">queryCollection</ogc:FunctionName>
> <ogc:FunctionName nArgs="-1">querySingle</ogc:FunctionName>
> in a WFS capabilities doc. Cool.
>
> When I make a request (from an OpenLayers layer preview page):
>
> http://myserv:8080/geoserver/eko/wms?LAYERS=eko:roads&STYLES=line&FORMAT=image/png&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&EXCEPTIONS=application/vnd.ogc.se_inimage&SRS=EPSG:4326&CQL_FILTER=INTERSECTS(the_geom,
> querySingle('towns',
> 'the_geom'))&BBOX=-14.006625976562,44.797148437497,142.12325683594,96.320009765623&WIDTH=1000&HEIGHT=330
>
> I get an exception:
> Could not parse CQL ilter list.
> Function not found. Parsing: INTERSECTS (the_geom,
> querySingle('poppol1000','the_geom')),
>
> What can be wrong here?

>From the description of the function:

-----------

Queries the specified layer``applying the specified (E)CQL ``filter
and returns the value of attribute from the first feature in the
result set. The layer name should be qualified (e.g. topp:states), the
filter can be INCLUDE if no filtering is desired

-----------

You're missing the third argument, if you want no filtering use
'INCLUDE' as the third parameter.
Make sure the query will always return just one result, otherwise the
function will throw a different
kind of exception. If you need to work with multiple geometries or
just don't know how many
geometries will be returned in advance use queryCollection and
collectGeometries instead.

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

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

------------------------------------------------------------------------------
Magic Quadrant for Content-Aware Data Loss Prevention
Research study explores the data loss prevention market. Includes in-depth
analysis on the changes within the DLP market, and the criteria used to
evaluate the strengths and weaknesses of these DLP solutions.
http://www.accelacomm.com/jaw/sfnl/114/51385063/
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to