Re: [Geoserver-users] GetFeatureInfo WMS v1.3.0 issue with I and J parameters

2019-08-14 Thread Chris Buckmaster via Geoserver-users
Thanks for the very helpful information Andrea!

Chris

From: Andrea Aime [mailto:andrea.a...@geo-solutions.it]
Sent: 14 August 2019 08:16
To: Chris Buckmaster
Cc: GeoServer Mailing List List
Subject: Re: [Geoserver-users] GetFeatureInfo WMS v1.3.0 issue with I and J 
parameters

Hi Chris,
GWC is running inside GeoServer, that may make you think that they play by the 
same rules... but they don't.
GeoServer WMS is accessible at this address, and the request works:

https://maps.runnymede.gov.uk/geoserver/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&FORMAT=image%2Fpng&TRANSPARENT=true&QUERY_LAYERS=council%3Apolling_districts&LAYERS=council%3Apolling_districts&SRS=EPSG%3A27700&TILED=true&INFO_FORMAT=application%2Fjson&I=174&J=127&WIDTH=256&HEIGHT=256&CRS=EPSG%3A27700&STYLES=&BBOX=492761%2C164864%2C499929%2C172032

The "full WMS" GWC extension you're using is instead managed directly by GWC, 
it's not sharing
code with GeoServer, and has a different behavior. I cannot find indications as 
to which versions of WMS are supported
on that endpoint, but it's really old and has not been touched in ages, by that 
I'm guessing it was designed to work
only with WMS 1.1.
Indeed the code has no indication of supporting I and J, see here:

https://github.com/GeoWebCache/geowebcache/blob/master/geowebcache/wms/src/main/java/org/geowebcache/service/wms/WMSService.java#L377

I also don't see support for the WMS 1.3 own version of axis flipping 
(EPSG:4326 interpreted as north/east)... which makes me notice another thing,
in WMS 1.3 the output crs is called "CRS" not "SRS", GeoServer is tolerant 
about the difference (same codebase implements both services) but
the properly formed request would be:

https://maps.runnymede.gov.uk/geoserver/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&FORMAT=image%2Fpng&TRANSPARENT=true&QUERY_LAYERS=council%3Apolling_districts&LAYERS=council%3Apolling_districts&CRS=EPSG%3A27700&TILED=true&INFO_FORMAT=application%2Fjson&I=174&J=127&WIDTH=256&HEIGHT=256&CRS=EPSG%3A27700&STYLES=&BBOX=492761%2C164864%2C499929%2C172032

Long story short:

  *   If you want to use WMS 1.3 stick to the GeoSever WMS
  *   If you want to use GWC own WMS stick to WMS 1.1
  *   If you want to use both at the same time, WMS 1.3 support for GWC needs 
to be written (could be a bunch of extra ifs in the existing code, most of the 
behavior is similar).. pull requests welcomed ;-)
Cheers
Andrea



On Tue, Aug 13, 2019 at 7:53 PM Chris Buckmaster via Geoserver-users 
mailto:geoserver-users@lists.sourceforge.net>>
 wrote:
Hi

I am trying to send a GetFeatureInfo request using WMS v1.3.0 via OpenLayers 
but am receiving the below error message from GeoWebCache:

“400: The parameters for x and y must both be positive integers.”

On looking at the GeoServer reference 
manual<https://docs.geoserver.org/stable/en/user/services/wms/reference.html>, 
when working with v1.3.0 it should be using the ‘I’ and ‘J’ parameters rather 
than ‘X’ and ‘Y’ – if I change it to ‘X’ and ‘Y’ it works but OpenLayers uses 
‘I’ and ‘J’ for its WMS request.

I am using GeoServer v2.13.1 and OpenLayers v5.3.

Please see examples below:

(Using WMS version 1.3.0 and I/J parameters – not working)
https://maps.runnymede.gov.uk/geoserver/gwc/service/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&FORMAT=image%2Fpng&TRANSPARENT=true&QUERY_LAYERS=council%3Apolling_districts&LAYERS=council%3Apolling_districts&SRS=EPSG%3A27700&TILED=true&INFO_FORMAT=application%2Fjson&I=174&J=127&WIDTH=256&HEIGHT=256&CRS=EPSG%3A27700&STYLES=&BBOX=492761%2C164864%2C499929%2C172032

(Using WMS version 1.3.0 and X/Y parameters – working)
https://maps.runnymede.gov.uk/geoserver/gwc/service/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&FORMAT=image%2Fpng&TRANSPARENT=true&QUERY_LAYERS=council%3Apolling_districts&LAYERS=council%3Apolling_districts&SRS=EPSG%3A27700&TILED=true&INFO_FORMAT=application%2Fjson&X=174&Y=127&WIDTH=256&HEIGHT=256&CRS=EPSG%3A27700&STYLES=&BBOX=492761%2C164864%2C499929%2C172032




Think before you print this. We are committed to being transparent about why 
and how we collect and use your personal data. Please see our Privacy Statement 
for further details. This message, and associated files, is intended only for 
the use of the individual or entity to which it is addressed and may contain 
information that is confidential or subject to copyright. If you are not the 
intended recipient please note that any copying or distribution of this 
message, or files associated with this message, is strictly prohibited. If you 
have received this message in error, please notify us immediately. Opinions, 
conclusions and

Re: [Geoserver-users] GetFeatureInfo WMS v1.3.0 issue with I and J parameters

2019-08-14 Thread Andrea Aime
Hi Chris,
GWC is running inside GeoServer, that may make you think that they play by
the same rules... but they don't.
GeoServer WMS is accessible at this address, and the request works:

https://maps.runnymede.gov.uk/geoserver/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&FORMAT=image%2Fpng&TRANSPARENT=true&QUERY_LAYERS=council%3Apolling_districts&LAYERS=council%3Apolling_districts&SRS=EPSG%3A27700&TILED=true&INFO_FORMAT=application%2Fjson&I=174&J=127&WIDTH=256&HEIGHT=256&CRS=EPSG%3A27700&STYLES=&BBOX=492761%2C164864%2C499929%2C172032

The "full WMS" GWC extension you're using is instead managed directly by
GWC, it's not sharing
code with GeoServer, and has a different behavior. I cannot find
indications as to which versions of WMS are supported
on that endpoint, but it's really old and has not been touched in ages, by
that I'm guessing it was designed to work
only with WMS 1.1.
Indeed the code has no indication of supporting I and J, see here:

https://github.com/GeoWebCache/geowebcache/blob/master/geowebcache/wms/src/main/java/org/geowebcache/service/wms/WMSService.java#L377

I also don't see support for the WMS 1.3 own version of axis flipping
(EPSG:4326 interpreted as north/east)... which makes me notice another
thing,
in WMS 1.3 the output crs is called "CRS" not "SRS", GeoServer is tolerant
about the difference (same codebase implements both services) but
the properly formed request would be:

https://maps.runnymede.gov.uk/geoserver/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&FORMAT=image%2Fpng&TRANSPARENT=true&QUERY_LAYERS=council%3Apolling_districts&LAYERS=council%3Apolling_districts&CRS=EPSG%3A27700&TILED=true&INFO_FORMAT=application%2Fjson&I=174&J=127&WIDTH=256&HEIGHT=256&CRS=EPSG%3A27700&STYLES=&BBOX=492761%2C164864%2C499929%2C172032

Long story short:

   - If you want to use WMS 1.3 stick to the GeoSever WMS
   - If you want to use GWC own WMS stick to WMS 1.1
   - If you want to use both at the same time, WMS 1.3 support for GWC
   needs to be written (could be a bunch of extra ifs in the existing code,
   most of the behavior is similar).. pull requests welcomed ;-)

Cheers
Andrea



On Tue, Aug 13, 2019 at 7:53 PM Chris Buckmaster via Geoserver-users <
geoserver-users@lists.sourceforge.net> wrote:

> Hi
>
>
>
> I am trying to send a GetFeatureInfo request using WMS v1.3.0 via
> OpenLayers but am receiving the below error message from GeoWebCache:
>
>
>
> “400: The parameters for x and y must both be positive integers.”
>
>
>
> On looking at the GeoServer reference manual
> ,
> when working with v1.3.0 it should be using the ‘I’ and ‘J’ parameters
> rather than ‘X’ and ‘Y’ – if I change it to ‘X’ and ‘Y’ it works but
> OpenLayers uses ‘I’ and ‘J’ for its WMS request.
>
>
>
> I am using GeoServer v2.13.1 and OpenLayers v5.3.
>
>
>
> Please see examples below:
>
>
>
> (Using WMS version 1.3.0 and I/J parameters – not working)
>
>
> https://maps.runnymede.gov.uk/geoserver/gwc/service/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&FORMAT=image%2Fpng&TRANSPARENT=true&QUERY_LAYERS=council%3Apolling_districts&LAYERS=council%3Apolling_districts&SRS=EPSG%3A27700&TILED=true&INFO_FORMAT=application%2Fjson&I=174&J=127&WIDTH=256&HEIGHT=256&CRS=EPSG%3A27700&STYLES=&BBOX=492761%2C164864%2C499929%2C172032
>
>
>
> (Using WMS version 1.3.0 and X/Y parameters – working)
>
>
> https://maps.runnymede.gov.uk/geoserver/gwc/service/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&FORMAT=image%2Fpng&TRANSPARENT=true&QUERY_LAYERS=council%3Apolling_districts&LAYERS=council%3Apolling_districts&SRS=EPSG%3A27700&TILED=true&INFO_FORMAT=application%2Fjson&X=174&Y=127&WIDTH=256&HEIGHT=256&CRS=EPSG%3A27700&STYLES=&BBOX=492761%2C164864%2C499929%2C172032
>
>
>
>
>
>
>
>
> Think before you print this. We are committed to being transparent about
> why and how we collect and use your personal data. Please see our Privacy
> Statement for further details. This message, and associated files, is
> intended only for the use of the individual or entity to which it is
> addressed and may contain information that is confidential or subject to
> copyright. If you are not the intended recipient please note that any
> copying or distribution of this message, or files associated with this
> message, is strictly prohibited. If you have received this message in
> error, please notify us immediately. Opinions, conclusions and other
> information in this message that do not relate to the official business of
> Runnymede Borough Council shall be understood as neither given nor endorsed
> by Runnymede Borough Council.
> ___
> Geoserver-users mailing list
>
> Please make sure you read the following two resources before posting to
> this list:
> - Earning your support instead of buying it, but Ian Turton:
> http://www.ianturton.com/talks/foss4g.html#/
> - The GeoServer user list posting guidelines:
> http://ge