[OpenLayers-Users] WFS Error with Spatial Operation
Myeong Hun Jeong
mhjeong74 at gmail.com
Wed Apr 29 03:28:56 EDT 2009
Dear list.
I am using openlayers2.7 and geoserver.
After loading WMS layer, I request WFS with spatial operation.
function wfsQuery()
{
url="
http://localhost:8888/geoserver/wfs?service=WFS&version=1.0.0&typename=topp:states&request=GetFeature&BBOX=-73.99312376470733,40.76203427979042,-73.9239210030026,40.80129519821393
";
OpenLayers.loadURL(url, '', this, wfsResponse);
}
function wfsResponse(transport) {
gmlParser = new OpenLayers.Format.GML();
features = gmlParser.read(transport.responseText);
var styleMapSimple = new OpenLayers.StyleMap({
strokeColor: "black",
strokeWidth:1,
fillColor: "orange",
fillOpacity: 0.7,
});
var layerStyled = new OpenLayers.Layer.Vector("result", {styleMap:
styleMapSimple});
layerStyled.addFeatures(features);
map.addLayer(layerStyled);
}
The code above works well. But I changed the way to request such like
function wfsQuery()
{
url="
http://localhost:8888/geoserver/wfs?&VERSION=1.0.0&SERVICE=WFS&REQUEST=GetFeature&TYPENAME=topp:states&Filter=
<Filter><BBOX><PropertyName>the_geom</PropertyName><Box%20srsName='EPSG:4326'><coordinates>-73.102613,%40.212597,%-72.361859,%41.512517</coordinates></Box></BBOX></Filter>";
OpenLayers.loadURL(url, '', this, wfsResponse);
}
When I request the url above, I got an error message.
The error message is that
<?xml version="1.0" ?>
<ServiceExceptionReport
version="1.2.0"
xmlns="http://www.opengis.net/ogc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/ogc
http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd">
<ServiceException
locator="org.vfny.geoserver.util.requests.readers.XmlRequestReader">
org.xml.sax.SAXException: Attempted to construct illegal filter - I
dont understand the tag: Box. HINT: tags are case-sensitive!
Attempted to construct illegal filter - I dont understand the tag: Box. HINT:
tags are case-sensitive!
</ServiceException></ServiceExceptionReport>
After several testing, I realized that when I request Comparison Operator,
it works well. However, if I request Spatial Operations, I face errors.
How to solve this problem?
Best regards,
Myeonghun Jeong.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090429/4d044f9d/attachment.html
More information about the Users
mailing list