Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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.

enter image description here

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:

<Filter xmlns:gml="http://www.opengis.net/gml">
    <Intersection>
        <PropertyName>the_geom</PropertyName>
        <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>
    </Intersection>
 </Filter>
share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.