Re: [Geoserver-users] Cascading WMS ok, but feature info fails?

2021-04-08 Thread Rahkonen Jukka (MML)
Hi,

I would say that it is very hard or impossible to support generally cascading 
GetFeatureInfo. If it happens to work it is a reason to be happy. If it does 
not work then what to blame is the WMS standard itself. GetFeatureInfo is 
optional and servers can do almost anything with it. Of course if the mime type 
that the server is using does not match with the data then it is probably a 
bug. However, the GML alike output from Mapserver is probably well known so it 
could be supported https://www.mapserver.org/ogc/wms_server.html and test-url 
https://demo.mapserver.org/cgi-bin/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&BBOX=-11.332970,24.121208,47.584718,57.965035&SRS=EPSG:4326&WIDTH=1001&HEIGHT=575&LAYERS=cities&STYLES=&FORMAT=image/png&TRANSPARENT=true&QUERY_LAYERS=cities&INFO_FORMAT=gml&X=229&Y=280

With Mapserver GetFeatureInfo must be especially configured for each layer 
separately and having GML as info_format requires some additional steps. That 
means that normally Mapservers do not support GML. JSON or GeoJSON as 
info_format is even more hard to configure, though possible.

I copied a few excerpts from the WMS 1.3.0 standard to show that GetFeatureInfo 
is not really designed to support cascading. If is was that at least one common 
and compulsory INFO_FORMAT had been defined.

"GetFeatureInfo is an optional operation. It is only supported for those Layers 
for which the attribute queryable="1" (true) has been defined or inherited. A 
client shall not issue a GetFeatureInfo request for other layers. A WMS shall 
respond with a properly formatted service exception (XML) response (code = 
OperationNotSupported) if it receives a GetFeatureInfo request but does not 
support it.

The GetFeatureInfo operation is designed to provide clients of a WMS with more 
information about features in the pictures of maps that were returned by 
previous Map requests. The canonical use case for GetFeatureInfo is that
a user sees the response of a Map request and chooses a point (I,J) on that map 
for which to obtain more information. The basic operation provides the ability 
for a client to specify which pixel is being asked about, which layer(s) should 
be investigated, and what format the information should be returned in. 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.

7.4.3.5 INFO_FORMAT
The mandatory INFO_FORMAT parameter indicates what format to use when returning 
the feature information. Supported values for a GetFeatureInfo request on a WMS 
server are listed as MIME types in one or more  
elements of its service metadata. The entire MIME type string in  is 
used as the value of the INFO_FORMAT parameter. In an HTTP environment, the 
MIME type shall be set on the
returned object using the Content-type entity header. If the request specifies 
a format not supported by the server, the server shall issue a service 
exception (code = InvalidFormat). EXAMPLE The parameter INFO_FORMAT=text/xml 
requests that the feature information be formatted in XML."


7.4.4 GetFeatureInfo response
The server shall return a response according to the requested INFO_FORMAT if 
the request is valid, or issue a service exception otherwise. The nature of the 
response is at the discretion of the service provider, but it shall
pertain to the feature(s) nearest to (I,J).

-Jukka Rahkonen-


-Alkuperäinen viesti-
Lähettäjä: Richard Duivenvoorde  
Lähetetty: torstai 8. huhtikuuta 2021 16.56
Vastaanottaja: andrea.a...@geo-solutions.it
Kopio: Tim Sutton ; GeoServer Mailing List List 

Aihe: Re: [Geoserver-users] Cascading WMS ok, but feature info fails?

Thanks Andrea,

On 4/8/21 3:10 PM, Andrea Aime wrote:
> "Not ok" result, it's starting with a tag named "msGMLOutput". 

> That's not a GML feature collection, just something that looks somehow 
> similar to it.
> We'd need to build a GML parser that's not "schema driven" to parse 
> that thing (being schema driven means, it follows the structure expected by 
> the GML during a parse, failing to find it, it returns nothing or throws an 
> error)... or build a specific one for that output.
> A possibly better alternative would be adding support for GeoJSON output in 
> cascading a FeatureInfo.

GeoJSON output would be cool! So: if you ask geojson on geoserver it will also 
ask geojson on the (cascaded) serve

Re: [Geoserver-users] Cascading WMS ok, but feature info fails?

2021-04-08 Thread Richard Duivenvoorde
Thanks Andrea,

On 4/8/21 3:10 PM, Andrea Aime wrote:
> "Not ok" result, it's starting with a tag named "msGMLOutput". 

> That's not a GML feature collection, just something that looks somehow 
> similar to it.
> We'd need to build a GML parser that's not "schema driven" to parse that 
> thing (being schema driven means, it follows the structure
> expected by the GML during a parse, failing to find it, it returns nothing or 
> throws an error)... or build a specific one for that output.
> A possibly better alternative would be adding support for GeoJSON output in 
> cascading a FeatureInfo.

GeoJSON output would be cool! So: if you ask geojson on geoserver it will also 
ask geojson on the (cascaded) server?

If I am right, that is the Minnesote Mapserver GML? Not 100% sure, but that 
would also be a good candidate to support.

> In anyone is interested in contributing a change, believe it should happen 
> around here:
> https://github.com/geoserver/geoserver/blob/b05e92aa12fb0bf7568d28908d88d67d759919ac/src/wms/src/main/java/org/geoserver/wms/featureinfo/WMSLayerIdentifier.java#L82-L81
>  
> 

Would that mean 'just passing' the geojson? Or should it first be deserialized 
into some JSON object(s)? And then at least fixing the layer/namespace name? 
... or not?

If anybody is interested in coding this? Let me know, I think I can at least 
partly fund this.
(if nobody is interested I put it on my long list of weekend projects)

Would be nice to have some kind of 'crowdfund' site, in which users could throw 
money at certain (smaller) features...
cc Kartoza/Tim Sutton, maybe it is an idea to put this in the 'projecta' 
project [0]
Though I realize that pushing smaller amounts of money over the world is not 
that easy...

Regards,

Richard Duivenvoorde

[0] https://github.com/qgis/QGIS-Django





___
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://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Re: [Geoserver-users] Cascading WMS ok, but feature info fails?

2021-04-08 Thread Andrea Aime
On Thu, Apr 8, 2021 at 2:58 PM Richard Duivenvoorde 
wrote:

> Hi All,
>
> I'm trying to cascade the following public/open service:
>
> https://service.pdok.nl/bzk/brocptkenset/wms/v1_0?request=getcapabilities
> it has one layer: 'cpt_kenset' (epsg:28992) being borehole-information.
>
> After setting up as a cascading store/layer I can just get a WMS map fine.
>
> But trying to retrieve getfeatureinfo, I receive an empty
> FeatureCollection??
>
> The url from my local (2.19) test server (from geotools develment log)
> returns in an empty resultset:
>
>
> http://localhost/geoserver/ows?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&BBOX=136329.07250007192487828,448242.24533979734405875,136573.94125728702056222,448591.21790481149218976&CRS=EPSG:28992&WIDTH=708&HEIGHT=1009&LAYERS=cite:cpt_kenset&STYLES=&FORMAT=image/png&QUERY_LAYERS=cite:cpt_kenset&INFO_FORMAT=application/json&I=488&J=574&FEATURE_COUNT=10
>
> Taking this url, but changing the host/url part AND the layername (to
> remove the cite-namespace):
>
>
> https://service.pdok.nl/bzk/brocptkenset/wms/v1_0?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&BBOX=136329.07250007192487828,448242.24533979734405875,136573.94125728702056222,448591.21790481149218976&CRS=EPSG:28992&WIDTH=708&HEIGHT=1009&LAYERS=cpt_kenset&STYLES=&FORMAT=image/png&QUERY_LAYERS=cpt_kenset&INFO_FORMAT=application/json&I=488&J=574&FEATURE_COUNT=10
>
> you get a fine result.
>
> Testing with 'application/vnd.ogc.gml' instead of 'application/json'
> (because I googled something around that), is also fine:
>

GeoServer can cascade feature info only if the remote server can produce a
GML feature collection as the output:


> OK result:
>
> https://service.pdok.nl/bzk/brocptkenset/wms/v1_0?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&BBOX=136329.07250007192487828,448242.24533979734405875,136573.94125728702056222,448591.21790481149218976&CRS=EPSG:28992&WIDTH=708&HEIGHT=1009&LAYERS=cpt_kenset&STYLES=&FORMAT=image/png&QUERY_LAYERS=cpt_kenset&INFO_FORMAT=application/vnd.ogc.gml&I=488&J=574&FEATURE_COUNT=10
>
>
"Not ok" result, it's starting with a tag named "msGMLOutput". That's not a
GML feature collection, just something that looks somehow similar to it.
We'd need to build a GML parser that's not "schema driven" to parse that
thing (being schema driven means, it follows the structure
expected by the GML during a parse, failing to find it, it returns nothing
or throws an error)... or build a specific one for that output.
A possibly better alternative would be adding support for GeoJSON output in
cascading a FeatureInfo.

In anyone is interested in contributing a change, believe it should happen
around here:
https://github.com/geoserver/geoserver/blob/b05e92aa12fb0bf7568d28908d88d67d759919ac/src/wms/src/main/java/org/geoserver/wms/featureinfo/WMSLayerIdentifier.java#L82-L81

Cheers
Andrea

== GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf
Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa
(LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549
http://www.geo-solutions.it http://twitter.com/geosolutions_it
--- *Con riferimento
alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 -
Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni
circostanza inerente alla presente email (il suo contenuto, gli eventuali
allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i
destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per
errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le
sarei comunque grato se potesse darmene notizia. This email is intended
only for the person or entity to which it is addressed and may contain
information that is privileged, confidential or otherwise protected from
disclosure. We remind that - as provided by European Regulation 2016/679
“GDPR” - copying, dissemination or use of this e-mail or the information
herein by anyone other than the intended recipient is prohibited. If you
have received this email by mistake, please notify us immediately by
telephone or e-mail.*
___
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://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users