GetFeatureInfo: Support multiple featureCollections per query layer

Description

Dear GeoServer community,

in the past, GeoServer has supported that a “query layer” of a GetFeatureInfo request is resolved into multiple feature collections representing the hits for different types.

Unfortunately, this has recently been broken as side effect of some enhancements (GeoJSON templates). I'd like to prepare a pull request to enable this again, along with unit tests.

We really need this for some internal customizations that no longer work with current GeoServers.

Many thanks in advance,

Andreas

Environment

None

Activity

Andreas W 
March 2, 2022 at 9:46 AM
(edited)

Ok, glad to hear. I think the extra burden is very small. It is about enabling and optimizing an error message in case of template execution errors only.

Here is the fresh pull request:

Thanks a lot for taking care!

Andreas

Andrea Aime 
March 2, 2022 at 9:22 AM

So you have a single layer that returned multiple feature collections? If so, that indeed worked by accident, was not meant to be supported. But if you can change the code and add tests, without increasing complexity/maintenance burden, it would be ok.

Andreas W 
March 2, 2022 at 8:50 AM

Almost: The raster layers in the backend system are based on vector layers. So, if my_raster_layer internally consists of my_lines and my_polygons those are returned.

Jukka Rahkonen 
March 2, 2022 at 8:25 AM

Does it mean that if GetFeatureInfo has &QUERY_LAYER=my_raster_layer it will actually send back information from for example my_raster_layer_footprint_polygons layer?

Andreas W 
March 2, 2022 at 8:17 AM

Hi Jukka,

it is a combination of the following:

  1. a custom GeoTools GridCoverage implementation which integrates a proprietary backend providing raster data.

  2. a custom GeoServer `org.geoserver.wms.featureinfo.LayerIdentifier` which resolves GetFeatureInfoRequests into a List of FeatureCollections.

This was working out of the box within GeoServer series 2.17.x at least.

I don’t know for sure if this can be achieved with a combination of built-in data stores, but I can well imagine.

Best regards,

Andreas

Fixed

Details

Assignee

Reporter

Fix versions

Affects versions

Components

Priority

Created March 1, 2022 at 9:16 PM
Updated March 14, 2022 at 4:02 PM
Resolved March 14, 2022 at 4:02 PM