Hi,

I am publishing a raster data using the GeoTiff data store. Is there a way to 
customise the JSON response of WMS GetFeatureInfo request? INFO_FORMAT 
parameter must be application/json.
For instance, the request to:
https://geoserver.tern.org.au/geoserver/abares1/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&FORMAT=image%2Fjpeg&TRANSPARENT=true&QUERY_LAYERS=abares1%3Aclum_50m_2018&LAYERS=abares1%3Aclum_50m_2018&exceptions=application%2Fvnd.ogc.se_inimage&INFO_FORMAT=application%2Fjson&FEATURE_COUNT=50&X=50&Y=50&SRS=EPSG%3A3577&STYLES=&WIDTH=101&HEIGHT=101&BBOX=-630357.6613501705%2C-3347248.0467043915%2C356714.02541521227%2C-2360176.3599390085
returns:
{"type":"FeatureCollection","features":[{"type":"Feature","id":"","geometry":null,"properties":{"GRAY_INDEX":125}}],"totalFeatures":"unknown","numberReturned":1,"timeStamp":"2019-07-04T05:20:10.711Z","crs":null}

I need to add more fields to the feature[0].properties object. The values need 
to come from a map function f(x) where x is the pixel value (GRAY_INDEX in this 
case). For instance:
"properties":{"GRAY_INDEX":125, "primary":"water", "classes":"17"}

Similar question was asked on stackexchange in 2016:
https://gis.stackexchange.com/questions/210834/how-do-i-get-raster-attribute-labels-from-a-wms-getfeatureinfo-request

Has there been any new features that can tackle this issue since then?

If it is not possible via an easy way, is there a workaround to do that either 
using a different (raster) data store or scripting plugins or something else 
that does not involve recompiling and repackaging the whole geoserver app?

Regards,

Alvin
_______________________________________________
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


[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to