Many thanks for being pedantic Ben! I had suspected that <gml:
exterior> was correct for GML 3.1.1. I applied all the other changes
you noted and the request is now working perfectly. Thanks again!
Here is the working code:
var postData =
'<wfs:GetFeature\n'
+ ' service="WFS"\n'
+ ' version="1.1.0"\n'
+ ' outputFormat="text/xml; subtype=gml/3.1.1"\n'
+ ' maxFeatures="350"\n'
+ ' xmlns:wfs="http://www.opengis.net/wfs"\n'
+ ' xmlns:ogc="http://www.opengis.net/ogc"\n'
+ '
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\n'
+ ' xmlns:gml="http://www.opengis.net/gml"\n'
+ ' xsi:schemaLocation="http://www.opengis.net/wfs\n'
+ ' http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">\n'
+ ' <wfs:Query typeName="ROS:titleExtents"
srsName="urn:x-ogc:def:crs:EPSG:27700">\n'
+ ' <ogc:Filter
xmlns:ogc="http://www.opengis.net/ogc">\n'
+ ' <ogc:Intersects>\n'
+ '
<ogc:PropertyName>the_geom</ogc:PropertyName>\n'
+ ' <gml:Polygon
srs="urn:x-ogc:def:crs:EPSG:27700">\n'
+ ' <gml:exterior>\n'
+ ' <gml:LinearRing>\n'
+ '
<gml:posList>'325114.43014706 673592.1753978 325112.1897978
673577.23973604 325124.8851103 673584.70756692 325114.43014706
673592.1753978'</gml:posList>\n'
+ ' </gml:LinearRing>\n'
+ ' </gml:exterior>\n'
+ ' </gml:Polygon>\n'
+ ' </ogc:Intersects>\n'
+ ' </ogc:Filter>\n'
+ ' </wfs:Query>\n'
+ '</wfs:GetFeature>\n';
var request = new OpenLayers.Request.POST({
url: '/ros/geoserver/wfs',
data: postData,
headers: {
"Content-Type": "text/xml"
},
callback: function (response) {
// read the response from GeoServer
var format = new OpenLayers.Format.GML.v3({});
// Add features to vector layer
selection_layer.addFeatures(format.read(response.responseText));
alert(response.responseText);
},
failure: function (response) {
alert("Invalid request");
}
});
Chris
-----Original Message-----
From: Ben Caradoc-Davies [mailto:[email protected]]
Sent: 16 May 2012 03:20
To: Muir, Christopher
Cc: [email protected].
Subject: Re: [Geoserver-users] WFS 1.1.0 getFeature request not working
And while I am being pedantic (never!), WFS 1.1.0 ogc:Query has an
attribute "srsName" not "srs".
Kind regards,
Ben.
On 16/05/12 10:14, Ben Caradoc-Davies wrote:
> GeoServer won't care about this either, but valid requests are easier
to
> debug.
--
Ben Caradoc-Davies <[email protected]>
Software Engineer
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre
P Please consider the environment - do you really need to print this email?
**********************************************************************
This e-mail (and any files or other attachments transmitted with it) is
intended solely for the attention of the addressee(s). Unauthorised use,
disclosure, storage, copying or distribution of any part of this e-mail is not
permitted. If you are not the intended recipient please destroy the email,
remove any copies from your system and inform the sender immediately by return.
Registers of Scotland does not accept any liability or responsibility for any
damage caused by any virus transmitted by this email or for changes made to
this e-mail after it was sent.
All communications to or from Registers of Scotland may be automatically
logged, monitored and/or recorded in order to secure the effective operation of
the system and for other lawful purposes. The views or opinions contained
within this e-mail may not necessarily reflect those of the Keeper of the
Registers of Scotland.
**********************************************************************
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users