Hi Andrea, Can you give me a rough direction on what needs to be done? One way is probably to extend the GeoTIFF data store and add few optional parameters? However, I think this should be made into a more generic functionality that can be applied to all raster data stores, or even all types of data stores. So for any store or layer, we can attach additional metadata that contains the pointer to a table (can be from jdbc or csv) and the field names to be mapped (eg, use field ‘id’ as key, and look up fields ‘title’ and ‘desc’). When getfeatureinfo is called, it should process the metadata after everything else has been done and add the extra fields to the JSON response. Is it possible to do this as a plugin without too much refactoring of the existing code base?
Regards, Alvin From: Andrea Aime <[email protected]> Sent: Friday, 5 July 2019 5:41 PM To: Alvin Sebastian <[email protected]> Cc: [email protected] Subject: Re: [Geoserver-users] raster attribute table Hi Alvin, nope, the situation is pretty much the same, what you're looking for it not available, but it would be welcomed functionality and everybody (with dev knowledge or funding) can contribute it Cheers Andrea On Thu, Jul 4, 2019 at 8:00 AM Alvin Sebastian <[email protected]<mailto:[email protected]>> wrote: 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]<mailto:[email protected]> https://lists.sourceforge.net/lists/listinfo/geoserver-users -- Regards, Andrea Aime == 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 [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-users
