[mapserver-users] Differerent output format for GetFeatureInfo - template strategy
Steve Lime
sdlime at gmail.com
Sat Jun 27 06:55:49 PDT 2020
If your data is very standardized I can see where this would be helpful. I
think if the layer attribute was interpreted as a regex then that might do
the trick. I’d advocate adding another attribute though to avoid a
regression since layer names commonly contain characters that would be
problematic in a regex. Something like “layerPattern”. With that you could
do:
[resultset layerPattern=“.”]
...
[/resultset]
and it would apply to all layers. Note there is also include support in
templates so you can use a common presentation over and over even if you
had to define a resultset for each layer. So something like:
[resultset layer=“l1”]
[include file=“common.html”]
[/resultset]
[resultset layer=“l2”]
[include file=“common.html”]
[/resultset]
This could be a candidate for 7.6.1 I suppose.
—Steve
On Thu, Jun 25, 2020 at 7:20 AM <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
> <https://www.google.com/maps/search/Droevendaalsesteeg+3+(Building+101)+%7C+6708+PB+Wageningen+The+Netherlands?entry=gmail&source=g>
>
> Telephone (Secretariat): +31 317 483735
>
> E-mail: info at isric.org
>
>
> _______________________________________________
> 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/20200627/15230874/attachment.htm>
More information about the MapServer-users
mailing list