[mapserver-users] Differerent output format for GetFeatureInfo - template strategy

Seth G sethg at geographika.co.uk
Thu Jun 25 07:36:51 PDT 2020


Hi,

I'm not sure if you have a custom template for each layer already, or if this something you want to avoid?

I'm guessing ideally you want to be able to change the LAYER - TEMPLATE via the URL?
Although this is not listed in the docs at https://mapserver.org/cgi/runsub.html#parameters-supported looking at the source I think it can be replaced via a URL. 

You can also set a CLASS TEMPLATE via the URL, and maybe have a different CLASS for each INFO_FORMAT and select it with GetStyles. 

Changing the format filename for each layer might be a possibility?
https://mapserver.org/cgi/runsub.html#parameters-supported
OUTPUTFORMAT: FORMATOPTION: FILENAME (must have a MAP VALIDATION pattern)

Seth

--
web:http://geographika.co.uk
twitter: @geographika


On Thu, Jun 25, 2020, at 2:12 PM, jorge.mendesdejesus at isric.org wrote:
> Dear mapserver community
> 
> I am trying to set a WMS where the a GetFeatureInfo will support more than one INFO_FORMAT, currently I have text/html implemented [1], which uses a layer level implementation. This works fine when you have only one format [2].
> 
> Now I need to have 2 formats, html and geojson/json. 
> 
> Documentation is very clear that the best strategy is to use the OUTPUTFORMAT, each output format associated with a specific template, this works fine .
> 
> Problem is that all examples that I see using outputformat have a very clear layer name indication (below is nums)
> 
> // mapserver template
> [resultset layer=mums]
> 
> This simplely doesn't work if you have 100 layers on a mapfile and we need a output format template for all of them, I have search for some generic parameter that could relay the layer name being used but no luck. With setting the layer name it doesn't work!! And arguments can't be replaced 
> 
> Question :
> - How can I have a generic [resultset ] that can be use by multiple layers???? [3] 
> - Template at layer level works good but I don't think we can support 2 formats there, is this correct??? 
> 
> 
> System:
> mapserver7.6.0 gdal2.4 proj4
> 
> 
> Thank you 
> Jorge de Jesus
> 
> [1] https://maps.isric.org/mapserv?map=/map/bdod.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&BBOX=47.130647,8.931116,48.604188,29.54223&CRS=EPSG:4326&WIDTH=1073&HEIGHT=445&LAYERS=bdod_0-5cm_Q0.5&STYLES=&FORMAT=image/tiff&QUERY_LAYERS=bdod_0-5cm_Q0.5&INFO_FORMAT=text/html&I=509&J=359&FEATURE_COUNT=1
> 
> [2] https://gis.stackexchange.com/questions/343901/getfeatureinfo-template-of-mapserver-not-replacing-values
> 
> [3] https://pastebin.com/FdepGTf7
> 
> 
> 
> ISRIC — World Soil Information

> 

> PO Box 353 | 6700 AJ Wageningen

> Droevendaalsesteeg 3 (Building 101) | 6708 PB Wageningen <https://www.wageningencampus.nl/nl/campus/over/gebouwen/show/Gaia-gebouwnummer-101.htm>

> The Netherlands

> Telephone (Secretariat): +31 317 483735

> E-mail: info at isric.org <blocked::mailto:soil.isric at wur.nl>

> **
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20200625/657946c8/attachment.html>


More information about the mapserver-users mailing list