Thank you for suggestions concerning the GetFeatureInfo
For one reason or another, I have implemented the suggestion of having all layers bundle, on mapserver template like:
// mapserver template
[resultset layer="Acrisols"]{
"type": "FeatureCollection",
:
[/resultset]
[resultset layer="Albeluvisols"]{
type": "FeatureCollection",
[/resultset]
I have 62 layers (more or less) per mapfile and don't see any speed penalty using this approach
Initially, I tried to use [include file=common.js] instead of the above verbose content, but when using the include approach (my favourite), the variables on the included generic template ([x], [y],[value_0],[class]) wouldn't be expanded to their values. Is template variable inherance implemented or I just bumped into a bug ??
I didnt tested the suggestion from Seth (to many files) , but interresting
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)
Thank you for the tips and suggestions
Jorge S. Mendes de Jesus
mapfile structure:
MAP
:
OUTPUTFORMAT
NAME "geojson"
DRIVER "TEMPLATE"
MIMETYPE "application/geo+json"
FORMATOPTION "FILE=wrb.js"
END
OUTPUTFORMAT
NAME "html"
DRIVER "TEMPLATE"
MIMETYPE "text/html"
FORMATOPTION "FILE=wrb.html"
END
:
WEB
:
'wms_feature_info_mime_type' 'text/html,application/geo+json'
:
LAYER
NAME "Acrisols"
:
TYPE RASTER
TEMPLATE 'DUMMY'
STATUS ON
ISRIC — World Soil Information
PO Box 353 | 6700 AJ Wageningen
Droevendaalsesteeg 3 (Building 101) | 6708 PB Wageningen
The Netherlands
Telephone (Secretariat): +31 317 483735
E-mail: [email protected]
[email protected] wrote:
Dear mapserver communityI 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 replacedQuestion :- 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 proj4Thank youJorge de Jesus[2] https://gis.stackexchange.com/questions/343901/getfeatureinfo-template-of-mapserver-not-replacing-values[3] https://pastebin.com/FdepGTf7ISRIC — World Soil Information
PO Box 353 | 6700 AJ Wageningen
Droevendaalsesteeg 3 (Building 101) | 6708 PB Wageningen
The Netherlands
Telephone (Secretariat): +31 317 483735
E-mail: [email protected]
Dear mapserver communityI 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 replacedQuestion :- 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 proj4Thank youJorge de Jesus[2] https://gis.stackexchange.com/questions/343901/getfeatureinfo-template-of-mapserver-not-replacing-values[3] https://pastebin.com/FdepGTf7ISRIC — World Soil Information
PO Box 353 | 6700 AJ Wageningen
Droevendaalsesteeg 3 (Building 101) | 6708 PB Wageningen
The Netherlands
Telephone (Secretariat): +31 317 483735
E-mail: [email protected]
_______________________________________________ mapserver-users mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/mapserver-users
