TransWikia.com

Filtering GeoServer GetFeatureInfo request

Geographic Information Systems Asked by Alex_knd on May 7, 2021

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?

One Answer

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.

Answered by Ian Turton on May 7, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP