[Geoserver-users] WMS OGC-filter fails with “I dont understand the tag: gml:Polygon”

Hi,

I believe that using &FILTER= is only supported in WFS. With WMS you should flip the OGC filter inside SLD. If you know that you will use only Geoserver you could have a try with CQL filters http://docs.geoserver.org/stable/en/user/tutorials/cql/cql_tutorial.html

-Jukka Rahkonen-

···

Mattias Bengtsson wrote:

I’m trying to construct an OGC filter to pass to a WMS GetMap request to GeoServer but I can’t seem to do it. The goal is to show the parts of the layer that intersects with a supplied polygon.

Here is an explanatory image: http://moonlite.github.io/files/description.png

When I run the query I don’t get a result but get this in the server logs:

org.xml.sax.SAXException: Attempted to construct illegal filter - I dont understand the tag: gml:Polygon. HINT: tags are case-sensitive!

Any ideas?

The query:

http://kar-toffel1.kartena.intra:8080/geoserver/kartena/wms?LAYERS=kartena%3Aosakert-luftkabel&STYLES=&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&SRS=EPSG%3A2400&FILTER=%3CFilter%20xmlns%3Agml%3D%22http%3A%2F%2Fwww.opengis.net%2Fgml%22%3E%3CIntersects%3E%3CPropertyName%3Ethe_geom%3C%2FPropertyName%3E%3Cgml%3APolygon%20srsName%3D%22http%3A%2F%2Fwww.opengis.net%2Fgml%2Fsrs%2Fepsg.xml%232400%22%3E%3Cgml%3AouterBoundaryIs%3E%3Cgml%3ALinearRing%3E%3Cgml%3Acoordinates%3E1271018%2C6404272%201271210%2C6404272%201271210%2C6404209%201271018%2C6404272%3C%2Fgml%3Acoordinates%3E%3C%2Fgml%3ALinearRing%3E%3C%2Fgml%3AouterBoundaryIs%3E%3C%2Fgml%3APolygon%3E%3C%2FIntersects%3E%3C%2FFilter%3E&CRS=EPSG%3A2400&BBOX=1270899.0723165,6404076.7312769,1271329.8765605,6404348.0392931&WIDTH=524&HEIGHT=330

The filter unescaped:

the_geom

<gml:Polygon srsName=“http://www.opengis.net/gml/srs/epsg.xml#2400”>

gml:outerBoundaryIs

gml:LinearRing

gml:coordinates

1271018,6404272

1271210,6404272

1271210,6404209

1271018,6404272

</gml:coordinates>

</gml:LinearRing>

</gml:outerBoundaryIs>

</gml:Polygon>

Thanks in advance!

Mattias at Kartena

On Mon, Apr 29, 2013 at 12:04 PM, Rahkonen Jukka
<jukka.rahkonen@anonymised.com>wrote:

Hi,****

** **

I believe that using &FILTER= is only supported in WFS. With WMS you
should flip the OGC filter inside SLD. If you know that you will use only
Geoserver you could have a try with CQL filters
http://docs.geoserver.org/stable/en/user/tutorials/cql/cql_tutorial.html

GeoServer should support &FILTER=... as an extension in WMS, and it should
work just like in WFS

Cheers
Andrea

--

GeoServer training in Milan, 6th & 7th June 2013! Visit
http://geoserver.geo-solutions.it for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

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