[Geoserver-users] Axis order in WMS ?

Hi all
I’m using GeoServer + OpenLayers. As you know, there is some modification between different versions in WFS and WMS. Regrading WFS, everything works correctly, i,e. if Long=40 and Lat=30 then following code works perfectly :

filterString = “DWithin(the_geom, POINT(30 40),1,meters)”;
var filter = encodeURIComponent(filterString);
vectorSource = new ol.source.Vector({
format: new ol.format.GML(),
url: ‘http://localhost:8080/geoserver/wfs?

  • ‘SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&’
  • ‘typename=ws:Layer1&’
  • ‘CQL_FILTER=’ + filter,

});

I mean, i have to define point in Lat/Long order when i’m using WFS 1.1.0 or later. But regarding WMS -though axis order has been changed to Lat/Long in WMS 1.3.0- I can’t get a good result.
Following code works for both WMS 1.1.1 and 1.3.0, without any change in point definition:

layer1 = new ol.layer.Image({
title: ‘myLayer’,
source: new ol.source.ImageWMS({
url: ‘http://localhost:8080/geoserver/wms’,
params: {
LAYERS: ‘ws:Layer1’,
VERSION: ‘1.3.0’,
CQL_FILTER: “DWithin(the_geom, POINT(40 30), 1, meters)”,

}
})
});

Changing code to “POINT(30 40)” returns nothing.
Why it is so? Why Geoserver does not understand axis order of Lat/Long in WMS 1.3.0?

Thanks in advance for your help

Following code works for both WMS 1.1.1 and 1.3.0, without any change in
point definition:
CQL_FILTER: "DWithin(the_geom, POINT(40 30), 1, meters)",

The coordinate order in this filter is defined by WKT (simple features spec),
not by WMS.

See http://docs.geoserver.org/latest/en/user/services/wms/basics.html for an
example that follows the WMS 1.3 order.

Brad

Thanks Brad
I’ve already visited that page. If i got it correctly, axis order in WMS has to be considered only for BBOX? Is there any other paramaters that can be affected by this change in axis order?

Thanks again


From: Brad Hards bradh@anonymised.com
To: ‘Saka Royban’ sakaroyban@anonymised.com; ‘GeoServer Mailing List List’ geoserver-users@lists.sourceforge.net
Sent: Tuesday, August 23, 2016 3:08 PM
Subject: RE: [Geoserver-users] Axis order in WMS ?

Following code works for both WMS 1.1.1 and 1.3.0, without any change in
point definition:
CQL_FILTER: “DWithin(the_geom, POINT(40 30), 1, meters)”,

The coordinate order in this filter is defined by WKT (simple features spec),
not by WMS.

See http://docs.geoserver.org/latest/en/user/services/wms/basics.html for an
example that follows the WMS 1.3 order.

Brad

Thanks Brad and sorry for duplicate message

In following code for WFS, point is defined by WKT . Isn’t it? (Note that it is defined as “POINT(Lat Long)”).

filterString = “DWithin(the_geom, POINT(30 40),1,meters)”;
var filter = encodeURIComponent(filterString);
vectorSource = new ol.source.Vector({
format: new ol.format.GML(),
url: ‘http://localhost:8080/geoserver/wfs?

  • ‘SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&’
  • ‘typename=ws:Layer1&’
  • ‘CQL_FILTER=’ + filter,

});

Regards


From: Brad Hards bradh@anonymised.com
To: ‘Saka Royban’ sakaroyban@anonymised.com; ‘GeoServer Mailing List List’ geoserver-users@lists.sourceforge.net
Sent: Tuesday, August 23, 2016 3:08 PM
Subject: RE: [Geoserver-users] Axis order in WMS ?

Following code works for both WMS 1.1.1 and 1.3.0, without any change in
point definition:
CQL_FILTER: “DWithin(the_geom, POINT(40 30), 1, meters)”,

The coordinate order in this filter is defined by WKT (simple features spec),
not by WMS.

See http://docs.geoserver.org/latest/en/user/services/wms/basics.html for an
example that follows the WMS 1.3 order.

Brad

2D WKT is POINT(x, y). X is usually the longitude.

Brad

Thanks Brad for your help
Yes. WKT format is POINT(x y). But why for WFS, i have to reverse the order to POINT(y x)?
Following code works right but if i change it to POINT(x y), i doesn’t work (Note: Lat=30, Long=40):

filterString = “DWithin(the_geom, POINT(30 40),1,meters)”;
var filter = encodeURIComponent(filterString);
vectorSource = new ol.source.Vector({
format: new ol.format.GML(),
url: ‘http://localhost:8080/geoserver/wfs?

  • ‘SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&’
  • ‘typename=ws:Layer1&’
  • ‘CQL_FILTER=’ + filter,

});

I’ve also tested other functions like INTERSECTS but the problem exists. I have to define points in y/x order to get a correct result form Geoserver.

and it’s a geoserver log for this filter:
filter = [ the_geom dwithin POINT (30 40), distance: 1.0 ]

Regards
Saka


From: Brad Hards <bradh@anonymised.com296…>
To: ‘Saka Royban’ sakaroyban@anonymised.com; ‘GeoServer Mailing List List’ geoserver-users@lists.sourceforge.net
Sent: Wednesday, August 24, 2016 4:55 AM
Subject: RE: [Geoserver-users] Axis order in WMS ?

2D WKT is POINT(x, y). X is usually the longitude.

Brad