Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Trying to get hand-drawn polygon delimiter for spatial query via OpenLayers to mapserver (then postgis). I can get the WKT of the drawn polygon and can substitute the dynamic values, but am having trouble getting the spatial query properly formatted.

Filter defined in OpenLayers:

myfilter = new OpenLayers.Filter.Logical({
            type: OpenLayers.Filter.Logical.AND,
            filters: [ new OpenLayers.Filter.Spatial({
               type: OpenLayers.Filter.Spatial.INTERSECTS,
               property: "footprint",
               value: curr_wkt
               new OpenLayers.Filter.Comparison({
                  type: OpenLayers.Filter.Comparison.EQUAL_TO,
                  property:  "roll",
                  value: roll

What myfilter looks like after created:

(INTERSECTS(footprint, '(POLYGON((-161.6625 71.073751831055,-167.625 69.498751831055,-168.3 65.673751831055,
-166.275 61.848751831055,-157.6125 64.773751831055,-161.6625 71.073751831055))')) AND (roll = '4')

But in the POST output from Firebug when run, the filter gets converted to an undefined Box (or Envelope if using 1.1.0):

POST result -

footprint undefined undefined undefined undefined roll 4

Is the WKT the wrong input format to use? Why does it change it to Box?

share|improve this question
<wfs:Query typeName="feature:mytable" srsName="EPSG:4326"> <ogc:Filter xmlns:ogc="">; <ogc:And> <ogc:Intersects> <ogc:PropertyName>footprint</ogc:PropertyName> <gml:Envelope xmlns:gml=""; srsName="EPSG:4326"> <gml:lowerCorner>undefined undefined</gml:lowerCorner> <gml:upperCorner>undefined undefined</gml:upperCorner> </gml:Envelope> </ogc:Intersects> <ogc:PropertyIsEqualTo matchCase="true"> <ogc:PropertyName>roll</ogc:PropertyName> <ogc:Literal>4</ogc:Literal> </ogc:PropertyIsEqualTo> </ogc:And> </ogc:Filter> </wfs:Query> – sallybb Sep 11 '13 at 23:41
Above is the POST (v.1.1.0) output that's missing from the original question. – sallybb Sep 11 '13 at 23:46

Your Answer


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

Browse other questions tagged or ask your own question.