1

I have a 14-band raster stored in GeoServer. I use Jiffle based styles to calculate spatial indices on the fly and it works fine.

But when I clic on the map, GetFeatureInfo request returns the information of all the bands.

The request are like:

server/geoserver/wms/?REQUEST=GetFeatureInfo&SRS=EPSG%3A4326&BBOX=-56.12087982359703%2C-12.437183254414979%2C-56.12083982359703%2C-12.43714325441498&HEIGHT=594&WIDTH=528&LAYERS=layer&QUERY_LAYERS=layer&INFO_FORMAT=application%2Fjson&X=243&Y=263

And it returns:

{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"id": "",
"geometry": null,
"properties": {
"Band1": 382,
"Band2": 343,
"Band3": 592,
"Band4": 321,
"Band5": 943,
"Band6": 4470,
"Band7": 5853,
"Band8": 5624,
"Band9": 6089,
"Band10": 6131,
"Band11": 2673,
"Band12": 1208,
"Band13": 3918,
"Band14": 0
}
}
],
"totalFeatures": "unknown",
"numberReturned": 1,
"timeStamp": "2021-03-24T11:18:15.298Z",
"crs": null
}

Is there any cql_filter or something that makes the operation and returns only the spatial index value?

3
  • what happens if you don't use JSON as the output format?
    – Ian Turton
    Commented Mar 24, 2021 at 12:10
  • Results for FeatureType 'layer': -------------------------------------------- Band1 = 382.0 Band2 = 343.0 Band3 = 592.0 Band4 = 321.0 Band5 = 943.0 Band6 = 4470.0 Band7 = 5853.0 Band8 = 5624.0 Band9 = 6089.0 Band10 = 6131.0 Band11 = 2673.0 Band12 = 1208.0 Band13 = 3918.0 Band14 = 0.0 --------------------------------------------
    – Alex_rdq
    Commented Mar 24, 2021 at 12:13
  • At the moment I request json because I am doing the calculation of bands in the front, to show the popups properly
    – Alex_rdq
    Commented Mar 24, 2021 at 12:14

1 Answer 1

0

I've not tried this but it should be possible using a GetFeatureInfo template possibly in conjunction with the raster options.

The freemarker templating language allows you to carry out maths.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.