[OpenLayers-Dev] Using xy: false with Protocol.WFS

Steven Ottens steven at minst.net
Wed Aug 4 04:45:13 EDT 2010


Hi all,

I've gotten myself a service to test and there's an extra problem. If the service uses xy=false it expects a boundingbox to be (y1,x1, y2, x2) instead of (x1,y1,x2,x2) (or in this case <lowerCorner>y x</lowerCorner><upperCorner>y x</upperCorner>
I've put a reasonable simple example here:

http://research.geodan.nl/esdin/layer_tester/

The config of the layer in question is: 
var nlsf_fgiGN = new OpenLayers.Layer.Vector(
	"Finland: GN",
	
	{
	strategies: [new OpenLayers.Strategy.BBOX({resFactor: 1})],
		visibility: true,
		projection: new OpenLayers.Projection(""),
		protocol: new OpenLayers.Protocol.WFS({
			formatOptions: {xy: false},
			version: "1.1.0",
			outputFormat: "application/gml+xml; version=3.2",
			srsName: "urn:ogc:def:crs:EPSG::4258",
			extractAttributes:true, 
			url: "http://esdin.geodan.nl/fgi/NLSFGN/transWFSgn",
			featurePrefix: "gn",
			featureType: "NamedPlace",
			featureNS: "urn:x-inspire:specification:gmlas:GeographicalNames:3.0",
			geometryName: "geometry",
			maxFeatures: "10",
			schema: "http://esdin.geodan.nl/fgi/NLSFGN/transWFSgn?service=WFS&REQUEST=DescribeFeatureType&typeName=gn:NamedPlace&version=1.1.0"
		})
	}
);



The request it sends is:
<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.1.0" outputFormat="application/gml+xml; version=3.2" maxFeatures="10" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><wfs:Query typeName="gn:NamedPlace" srsName="urn:ogc:def:crs:EPSG::4258" xmlns:gn="urn:x-inspire:specification:gmlas:GeographicalNames:3.0"><ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:BBOX><ogc:PropertyName>geometry</ogc:PropertyName><gml:Envelope xmlns:gml="http://www.opengis.net/gml" srsName="">

<gml:lowerCorner>-101.5 3.451171875</gml:lowerCorner>
<gml:upperCorner>123.5 8.548828125</gml:upperCorner>

</gml:Envelope></ogc:BBOX></ogc:Filter></wfs:Query></wfs:GetFeature>

And as you can see -101 is longitude not latitude. 

Has anyone ever looked at this, and if not where would I need to look to change this behavior?

Regards,
Steven


On Jul 2, 2010, at 7:56 PM, Steven Ottens wrote:

> On Jul 2, 2010, at 6:17 PM, Tim Schaub wrote:
> 
>> On 7/2/10 3:59 AM, Steven Ottens wrote:
>>> Sorry for replying on my own mail again, but I discovered I was wrong
>>> and there is already a very easy way to do this and I want to make
>>> sure it is archived instead of the approach below:
>>> 
>>> use formatOptions: {xy, false} and it's passed on to the Format
>>> handler (duh!)
>>> 
>> 
>> Thanks for documenting your experience here.  If you're feeling up to it 
>> and have simple example, it would be great to have an addition to the 
>> examples directory.
>> 
> I'm working on an INSPIRE (big thing in Europe) viewer, which will be Open Source but the services tend to be behind a paywall :( I'm happy to create a simple example, I just need a stable free service which serves latitude, longitude. I'll see what I can do to get such a service running, but if someone knows one please tell me.
> 
> Steven

-- 
Steven M. Ottens
Senior Ux Designer
-------------------------------------
Geodan S&R
President Kennedylaan 1
1079 MB Amsterdam (NL)
-------------------------------------
Tel: +31 (0)20 - 5711 315
Fax: +31 (0)20 - 5711 333
-------------------------------------
E-mail: steven.ottens at geodan.nl
Website: www.geodan.nl
KvK-nummer: 33 247475
Disclaimer: www.geodan.nl/disclaimer
-------------------------------------





More information about the Dev mailing list