[Geoserver-devel] GEOS-6420

Hi,

I'd just like to check my understanding of https://jira.codehaus.org/browse/GEOS-6420 (WMS GetFeatureInfo does reproject the featureMember geometry in GeoServer 2.5)

According to the issue and documentation http://docs.geoserver.org/latest/en/user/services/wms/reference.html it appears that the returned geometry should be reprojected into the specified SRS no matter the projection of the layer in Geoserver.

Here is a test case using a layer that is deployed with Geoserver.

If you use the link below, it will return the geometry in EPSG:4326 as expected because the SRS is set to EPSG:4326.

http://localhost:8080/geoserver/topp/wms?REQUEST=GetFeatureInfo&EXCEPTIONS=application/vnd.ogc.se_xml&BBOX=141.228065,-46.65732,152.113183,-37.586388&SERVICE=WMS&INFO_FORMAT=application/json&QUERY_LAYERS=topp:tasmania_state_boundaries&FEATURE_COUNT=50&Layers=topp:tasmania_state_boundaries&WIDTH=600&HEIGHT=500&format=image/png&styles=&srs=EPSG:4326&version=1.1.1&x=303&y=249

If you use this link with an SRS of EPSG:900913 I would expect the returned geometry to be in EPSG:900913 however it is still EPSG:4326.

http://192.168.2.211:8080/geoserver/topp/wms?REQUEST=GetFeatureInfo&EXCEPTIONS=application/vnd.ogc.se_xml&BBOX=15721436.2815,-5886318.25325,16933162.0745,-4521159.95999&SERVICE=WMS&INFO_FORMAT=application/json&QUERY_LAYERS=topp:tasmania_state_boundaries&FEATURE_COUNT=50&Layers=topp:tasmania_state_boundaries&WIDTH=600&HEIGHT=500&format=image/png&styles=&srs=EPSG:900913&version=1.1.1&x=303&y=249

This behaviour seems to be the same as what is seen in GEOS-6420.

I'd appreciate if anyone could test the issue above and let me know if this is a misunderstanding on my part or a regression in Geoserver.

I have also tried to use the workaround (-Dorg.geoserver.wms.featureinfo.render.enabled=false) specified in the Jira issue but to no avail.

My geoserver version is,

Version
2.5-SNAPSHOT
Git Revision
469f323f1f53f64ab3e65ff2746848b49c5426ed
Build Date
03-Aug-2014 16:56
GeoTools Version
11-SNAPSHOT (rev d365f33a505349746b15bef1dfffc99cde2cde68)
GeoWebCache Version
1.5-SNAPSHOT (rev e44af36fc28054134ace0ba3902d0645bddf857e/e44af36fc28054134ace0ba3902d0645bddf857e)

Kind Regards,
Ben

------------------------------------
Ben Khoo
Gaia Resources
p +61 8 9227 7309
w www.gaiaresources.com.au
e ben.khoo@anonymised.com

Looks like the fix was applied to 2.5-SNAPSHOT?

Ok, fix committed. Tomorrow it should be in the nightly build, anyone has time to verify it? (mind, the build must be from Apr 28, or later)

http://ares.boundlessgeo.com/geoserver/2.5.x/

If it is not fixed for you please comment on the issue, and we can re-open the bug.

···

Jody Garnett

On Mon, Aug 11, 2014 at 7:51 AM, Ben Khoo <benk@anonymised.com> wrote:

Hi,

I’d just like to check my understanding of https://jira.codehaus.org/browse/GEOS-6420 (WMS GetFeatureInfo does reproject the featureMember geometry in GeoServer 2.5)

According to the issue and documentation http://docs.geoserver.org/latest/en/user/services/wms/reference.html it appears that the returned geometry should be reprojected into the specified SRS no matter the projection of the layer in Geoserver.

Here is a test case using a layer that is deployed with Geoserver.

If you use the link below, it will return the geometry in EPSG:4326 as expected because the SRS is set to EPSG:4326.

http://localhost:8080/geoserver/topp/wms?REQUEST=GetFeatureInfo&EXCEPTIONS=application/vnd.ogc.se_xml&BBOX=141.228065,-46.65732,152.113183,-37.586388&SERVICE=WMS&INFO_FORMAT=application/json&QUERY_LAYERS=topp:tasmania_state_boundaries&FEATURE_COUNT=50&Layers=topp:tasmania_state_boundaries&WIDTH=600&HEIGHT=500&format=image/png&styles=&srs=EPSG:4326&version=1.1.1&x=303&y=249

If you use this link with an SRS of EPSG:900913 I would expect the returned geometry to be in EPSG:900913 however it is still EPSG:4326.

http://192.168.2.211:8080/geoserver/topp/wms?REQUEST=GetFeatureInfo&EXCEPTIONS=application/vnd.ogc.se_xml&BBOX=15721436.2815,-5886318.25325,16933162.0745,-4521159.95999&SERVICE=WMS&INFO_FORMAT=application/json&QUERY_LAYERS=topp:tasmania_state_boundaries&FEATURE_COUNT=50&Layers=topp:tasmania_state_boundaries&WIDTH=600&HEIGHT=500&format=image/png&styles=&srs=EPSG:900913&version=1.1.1&x=303&y=249

This behaviour seems to be the same as what is seen in GEOS-6420.

I’d appreciate if anyone could test the issue above and let me know if this is a misunderstanding on my part or a regression in Geoserver.

I have also tried to use the workaround (-Dorg.geoserver.wms.featureinfo.render.enabled=false) specified in the Jira issue but to no avail.

My geoserver version is,

Version
2.5-SNAPSHOT
Git Revision
469f323f1f53f64ab3e65ff2746848b49c5426ed
Build Date
03-Aug-2014 16:56
GeoTools Version
11-SNAPSHOT (rev d365f33a505349746b15bef1dfffc99cde2cde68)
GeoWebCache Version
1.5-SNAPSHOT (rev e44af36fc28054134ace0ba3902d0645bddf857e/e44af36fc28054134ace0ba3902d0645bddf857e)

Kind Regards,
Ben


Ben Khoo
Gaia Resources
p +61 8 9227 7309
w www.gaiaresources.com.au
e ben.khoo@anonymised.com



Geoserver-devel mailing list
Geoserver-devel@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

On Mon, Aug 11, 2014 at 4:51 PM, Ben Khoo <benk@anonymised.com> wrote:

Hi,

I'd just like to check my understanding of
https://jira.codehaus.org/browse/GEOS-6420 (WMS GetFeatureInfo does
reproject the featureMember geometry in GeoServer 2.5)

According to the issue and documentation
http://docs.geoserver.org/latest/en/user/services/wms/reference.html it
appears that the returned geometry should be reprojected into the specified
SRS no matter the projection of the layer in Geoserver.

Nope, neither the docs nor the ticket state that explicitly.

The ticket was about a layer in EPSG:2157, with a request in EPSG:2157,
with GetFeatureInfo apparenlty
returning coordinates in lat/lon (I say apparently, because what they were
actually getting were screen coordinates,
in pixels).

The documentation does not contain an example of reprojection either.

If we go down to the OGC specification, they only say:

------------------------------

Because the WMS protocol is stateless, the GetFeatureInfo request indicates
to the WMS what map the user is viewing by including
most of the original GetMap request parameters (all but VERSION and
REQUEST). From the spatial context
information (BBOX, CRS, WIDTH, HEIGHT) in that GetMap request, along with
the I,J position the user chose,
the WMS can (possibly) return additional information about that position.
*The actual semantics of how a WMS decides what to return more information
about, or what exactly to return, are*
*left up to the WMS provider.*

------------------------------

If you look at the GeoServer history, none of "vector" GetFeatureInfo
output formats ever reprojected the geometries
in the requested CRS, all of them always returned the geometries in the
layer native SRS.

Now, I'm not saying this behavior is correct, but it has been around for
almost 10 years now, which
means it cannot be changed lightly, as it would break existing clients.

Now, given than most clients using GetFeatureInfo GML/JSON outputs are
verticals (since a generic
WMS client cannot be assuming any such output format), I believe what we
could do is to add
either a request parameter, or a admin level setting in the WMS panel
(ideally both), to make the GetFeatureInfo
reproject the results to the GetMap target projection
(contributions/sponsorship to implement this
are welcomed as usual :-p )

Cheers
Andrea

--

GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

Ahh I see now that I have misunderstood the ticket.

Agreed that you certainly wouldn't want to change the long standing behaviour of Geoserver - that would be very bad karma.

Thanks to you and Jody for the prompt reply and thanks for the work that you have put into Geoserver.

Regards
Ben

----- Original Message -----
From: "Andrea Aime" <andrea.aime@anonymised.com>
To: "Ben Khoo" <benk@anonymised.com>
Cc: "Geoserver-devel" <geoserver-devel@lists.sourceforge.net>
Sent: Tuesday, 12 August, 2014 1:22:56 AM
Subject: Re: [Geoserver-devel] GEOS-6420

On Mon, Aug 11, 2014 at 4:51 PM, Ben Khoo < benk@anonymised.com > wrote:

Hi,

I'd just like to check my understanding of https://jira.codehaus.org/browse/GEOS-6420 (WMS GetFeatureInfo does reproject the featureMember geometry in GeoServer 2.5)

According to the issue and documentation http://docs.geoserver.org/latest/en/user/services/wms/reference.html it appears that the returned geometry should be reprojected into the specified SRS no matter the projection of the layer in Geoserver.

Nope, neither the docs nor the ticket state that explicitly.

The ticket was about a layer in EPSG:2157, with a request in EPSG:2157, with GetFeatureInfo apparenlty
returning coordinates in lat/lon (I say apparently, because what they were actually getting were screen coordinates,
in pixels).

The documentation does not contain an example of reprojection either.

If we go down to the OGC specification, they only say:

------------------------------

Because the WMS protocol is stateless, the GetFeatureInfo request indicates to the WMS what map the user is viewing by including
most of the original GetMap request parameters (all but VERSION and REQUEST). From the spatial context
information (BBOX, CRS, WIDTH, HEIGHT) in that GetMap request, along with the I,J position the user chose,
the WMS can (possibly) return additional information about that position.
The actual semantics of how a WMS decides what to return more information about, or what exactly to return, are
left up to the WMS provider.

------------------------------

If you look at the GeoServer history, none of "vector" GetFeatureInfo output formats ever reprojected the geometries
in the requested CRS, all of them always returned the geometries in the layer native SRS.

Now, I'm not saying this behavior is correct, but it has been around for almost 10 years now, which
means it cannot be changed lightly, as it would break existing clients.

Now, given than most clients using GetFeatureInfo GML/JSON outputs are verticals (since a generic
WMS client cannot be assuming any such output format), I believe what we could do is to add
either a request parameter, or a admin level setting in the WMS panel (ideally both), to make the GetFeatureInfo
reproject the results to the GetMap target projection (contributions/sponsorship to implement this
are welcomed as usual :-p )

Cheers
Andrea

--

==

GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------