Skip to content
Snippets Groups Projects
Commit fc5ec398 authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Add i18n information

parent 6be983db
Branches
No related tags found
No related merge requests found
MAP
# This mapfile is generated using Jinja2 templates
#
# Copyright (C) 2023 NIBIO <https://www.nibio.no/>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
NAME "VIPS.PSILARTEMP"
# WGS84
EXTENT -1.5831861262936526 52.4465003983706595 39.2608060398730458 71.7683216082912736
UNITS DD
CONFIG "MS_ERRORFILE" "/disks/data01/mapserver/log/PSILARTEMP.log"
PROJECTION
"init=epsg:4326"
END
WEB
IMAGEPATH "/disks/data01/mapserver/tmp/"
IMAGEURL "/tmp/"
# List of standard metadata: https://mapserver.org/ogc/wms_server.html#web-object-metadata
# i18n support: https://mapserver.org/ogc/inspire.html#inspire-multi-language-support
METADATA
"wms_keywordlist" "VIPS model Carrot Rust Fly (PSILARTEMP)"
"wms_abstract" "
<p>The warning system model &laquo;Carrot rust fly temperature&raquo; is based on a Finnish temperature-based model (Markkula <em>et al</em>, 1998; Tiilikkala &amp; Ojanen, 1999; Markkula <em>et al</em>, 2000). The model determines the start of the flight period for the 1st and 2nd generation of carrot rust fly based on accumuleted degree-days (day-degrees) over a base temperature of 5,0 &deg;C. VIPS uses the model for the 1st generation only.</p>
<p>Standard air temperature (temperature measured 2 m above ground) is used in the model. Degree-days are defined for this model as the sum of the difference between a base temperature of 5,0 &deg;C and the mean temperature for all days with a temperature &gt;5,0 &deg;C, in other words (daily mean temperature &ndash; 5,0 &deg;C) from 1 March (beginning when the ground has thawed).</p>
<h3>Interpretation of the warning</h3>
<p>Green rectangles indicate that the flight period has not yet begun. The accumulated day-degrees are &lt; 260 degree-days (day-degrees).</p>
<p>Yellow rectangles indicate that the flight period is beginning and that flies can be coming into the field. The accumulated day-degrees are &ge; 260 degree-days (day-degrees).</p>
<p>Red rectangles indicate peak flight period. The accumulated day-degrees are &ge; 360 degree-days (day-degrees).</p>
<p>Grey rectangles indicate that the flight period of the 1st generation is over. The accumulated day-degrees are &ge; 560 degree-days (day-degrees).</p>
<p>Be aware that in areas with field covers (plastic, single or double non-woven covers, etc.) with early crops the preceding season (either on the current field or neighboring fields), the flight period can start earlier due to higher soil temperature under the covers.</p>
<p>The graphic presentation shows the progress of the day-degree calculation that is the basis for the green, yellow and red warnings (the line: &laquo;Accumulated day-degrees with the base temperature of 5 degrees C&raquo;). The graph show straight horizontal lines for the threshold values. &laquo;Day-degree threshold for low likelihood of attack&raquo; corresponds to when the warning changes from green to yellow (260 day-degrees). &laquo;Day-degree threshold for high likelihood of attack &raquo; corresponds to when the warning changes from yellow to red (360 day-degrees). &laquo;Day-degree threshold for end of flight period&raquo; corresponds to when the warning changes from red to grey (560 day-degrees) and the flight period for the 1st generation is considered to be over. When the line &laquo; Accumulated day-degrees with the base temperature of 5 degrees C&raquo; intersects one of the lines for the day-degree threshold, the warning will advance to the next level and the color of the warning rectangle will change. The graph also shows the daily mean temperature for the relevant weather station. The graph is dynamic and the user can choose which parameters that are shown by clicking on the explanation below the graph.</p>
<h3>Warning season &ndash; start and end of the warning</h3>
<p>Starting time: Shown in VIPS from 1 April (starting date for accumulation of degree-days beginning from when the ground has thawed).<br /> Ending time: When the model has reached the requirement for the end of the flight period for the 1st generation (560 day-degrees).</p>
<h3>Testing and validation of the model</h3>
<h4>National</h4>
<p>The model has been tested for Norwegian conditions in the period of 2011-2015. Validation has shown that the model was accurate for most locations for the 1st generation. The model was, however, inaccurate for the 2nd generation for many locations and was totally incorrect for the district of J&aelig;ren. Based on the validation results, we have therefore chosen to remove warning of the 2nd generation of carrot rust fly from this model.</p>
<h4>International</h4>
<p>The model is in use in Finland. The extent to which the model has been validated in Finland is uncertain, but a validation was done in the summer of 1997. This validation showed that the model was quite accurate, but that the threshold temperature sm should be lowered to 255 day-degrees for the start of the flight period (as opposed to 260 degree-days in the original model) and 355 degree-days forthe peak flight period (as opposed to 360 degree-days in the original model) (Tiilikkala &amp; Ojanen, 1999).</p>
<h3>Literature</h3>
<p>Markkula, I., H. Ojanen and K. Tiilikkala. 1998. Forecasting and monitoring of the carrot fly (<em>Psila rosae</em>) in Finland. The 1998 Brighton Conference: Pests and Diseases: Conference Proceedings, Volume 2, pages 657-662.</p>
<p>Tiilikkala, K. and H. Ojanen. 1999. Use of a geographical information system (GIS) for forecasting the activities of carrot fly and cabbage root fly. IOBC/WPRS Bulletin 22 (5): 15-24.</p>
<p>Markkula, I., A. Hannukkala, A. Lehtinen, I. Mattila, H. Ojanen, S. Raisjio, P. Reijonen and K. Tiilikkala. 2000. Pest warnings and forecasts sent as SMS messages from models into \"farmer's pocket\". In publication: Pests &amp; Diseases 2000. Proceedings of an international conference held at the Brighton Hilton Metropole Hotel, UK, 13-16 November 2000. BCPC Conference Proceedings pages 285-290.</p>
<p>&nbsp;</p>
<p><strong>Contacts</strong></p>
<p>Annette Folkedal Schj&oslash;ll <a href=\"mailto:annette.folkedal.schjoll@nibio.no\">annette.folkedal.schjoll@nibio.no</a><br />Tor J. Johansen <a href=\"mailto:tor.johansen@nibio.no\">tor.johansen@nibio.no</a></p>
"
"wms_enable_request" "*"
"wms_title" "Carrot rust fly (Psila rosae) temperature model"
"wms_getfeatureinfo_formatlist" "text/plain,text/html,text/xml"
"wms_accessconstraints" "none"
"wms_addresstype" ""
"wms_address" "Høgskoleveien 7"
"wms_city" "Ås"
"wms_stateorprovince" "Ås"
"wms_postcode" "1430"
"wms_country" "Norway"
"wms_contactelectronicmailaddress" "vips@nibio.no"
"wms_feature_info_mime_type" "text/html"
"wms_contactperson" "Berit Nordskog"
"wms_contactposition" "owner"
"wms_contactorganization" "Norsk institutt for bioøkonomi (NIBIO)"
END
END #web
############################# Start of legend #########################################################
# The legend configuration uses the CLASSITEM information in each layer to generate colour icons and labels
LEGEND
STATUS ON
KEYSIZE 16 12
LABEL
TYPE TRUETYPE
SIZE 10
COLOR 0 0 0
OFFSET 0 -3
END
END
# This mapfile is generated using Jinja2 templates
#
# Copyright (C) 2023 NIBIO <https://www.nibio.no/>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
NAME "VIPS.PSILARTEMP"
# WGS84
EXTENT -1.5831861262936526 52.4465003983706595 39.2608060398730458 71.7683216082912736
UNITS DD
CONFIG "MS_ERRORFILE" "/disks/data01/mapserver/log/PSILARTEMP.log"
PROJECTION
"init=epsg:4326"
END
WEB
IMAGEPATH "/disks/data01/mapserver/tmp/"
IMAGEURL "/tmp/"
# List of standard metadata: https://mapserver.org/ogc/wms_server.html#web-object-metadata
# i18n support: https://mapserver.org/ogc/inspire.html#inspire-multi-language-support
METADATA
"wms_keywordlist" "VIPS model Carrot Rust Fly (PSILARTEMP)"
"wms_inspire_capabilities" "embed"
"wms_languages" "en,nb" # The first is the default
"wms_abstract.nb" "
<h2>Modellbeskrivelse</h2>
<p>Varslingsmodellen &laquo;Gulrotflue svermetidspunkt&raquo; er basert p&aring; en finsk, temperaturbasert modell (Markkula <em>et al</em>, 1998; Tiilikkala &amp; Ojanen, 1999; Markkula <em>et al</em>, 2000). Modellen beregner tidspunkt for sverming av 1. generasjon og 2. generasjon av gulrotflue basert p&aring; akkumulering av graddager (d&oslash;gngrader) over en basistemperatur p&aring; 5 &deg;C. I VIPS benyttes modellen kun for 1. generasjon.</p>
<p>Det er standard lufttemperatur (temperatur m&aring;lt 2 m over bakken) som benyttes i modellen. Graddager er her definert som summen av differansen mellom en basistemperatur p&aring; 5 &deg;C og d&oslash;gnmiddeltemperatur for alle d&oslash;gn med temperatur &gt;5 &deg;C dvs. summen av (d&oslash;gnmiddeltemperatur - 5 &deg;C) fra 1. mars (fra det er telefritt i jorda).</p>
<h2>Tolking av varsel</h2>
<p>Gr&oslash;nne bokser betyr at svermingen enda ikke har begynt. Akkumulering av d&oslash;gngrader er &lt; 260 graddager (d&oslash;gngrader).</p>
<p>Gule bokser betyr svermingen er i startfasen og at man m&aring; v&aelig;re obs p&aring; at det kan komme innflyvere i &aring;keren. Akkumulering av d&oslash;gngrader er &ge; 260 graddager (d&oslash;gngrader).</p>
<p>R&oslash;de bokser betyr svermingen er p&aring; sitt mest aktive. Akkumulering av d&oslash;gngrader er &ge; 360 graddager (d&oslash;gngrader).</p>
<p>Gr&aring; bokser betyr at svermingen av 1. generasjon er over og varslingen er avsluttet. Akkumulering av d&oslash;gngrader er &ge; 560 graddager (d&oslash;gngrader).</p>
<p>V&aelig;r klar over at i omr&aring;der med dekke (plast, enkel og dobbel fiberduk el. lign.) ved tidligproduksjon (enten p&aring; samme jorde eller nabojorder) &aring;ret f&oslash;r, kan svermingen starte tidligere p&aring; grunn av h&oslash;yere jordtemperatur under dekket.</p>
<h2>Varslingssesong &ndash; oppstart og avslutning av varsel</h2>
<p>Starttidspunkt: Vises i VIPS fra 1. april (startdato for akkumulering av graddager fra det er telefritt) i jorda.</p>
<p>Sluttidspunkt: N&aring;r modellen har n&aring;dd kravet til d&oslash;gngrader for avsluttet sverming av 1. generasjon (560 d&oslash;gngrader).</p>
<h2>Utpr&oslash;ving og validering av modellen</h2>
<h3>Nasjonalt</h3>
<p>Modellen har v&aelig;rt testet og evaluert for norske forhold i perioden 2011-2015. Valideringen har vist at modellen stemte ganske bra for de fleste steder for 1. generasjon. Modellen stemte imidlertid d&aring;rlig for 2. generasjon for mange lokaliteter og var direkte feil for J&aelig;ren-distriktet. P&aring; bakgrunn av resultatene fra valideringen har vi derfor valgt &aring; fjerne varsling av 2. generasjon gulrotflue med denne modellen.</p>
<h3>Internasjonalt</h3>
<p>Modellen er i bruk i Finland. Det er usikkert hvor omfattende modellen er validert i Finland, men det er utf&oslash;rt en validering sommeren 1997. Denne valideringen tilsa at modellen stemte noks&aring; bra, men at terskeltemperatursummen burde reduseres til 255 graddager for svermingsstart (mot 260 graddager i den opprinnelige modellen) og 355 graddager for svermetoppen (mot 360 daggrader i den opprinnelige modellen) (Tiilikkala &amp; Ojanen, 1999).</p>
<h2>Referanser</h2>
<ul>
<li>Markkula, I., H. Ojanen and K. Tiilikkala. 1998. Forecasting and monitoring of the carrot fly (Psila rosae) in Finland. The 1998 Brighton Conference: Pests and Diseases: Conference Proceedings, Volume 2, pages 657-662.</li>
<li>Tiilikkala, K. and H. Ojanen. 1999. Use of a geographical information system (GIS) for forecasting the activities of carrot fly and cabbage root fly. IOBC/WPRS Bulletin 22 (5): 15-24.</li>
<li>Markkula, I., A. Hannukkala, A. Lehtinen, I. Mattila, H. Ojanen, S. Raisjio, P. Reijonen and K. Tiilikkala. 2000. Pest warnings and forecasts sent as SMS messages from models into &quot;farmer's pocket&quot;. In publication: Pests &amp; Diseases 2000. Proceedings of an international conference held at the Brighton Hilton Metropole Hotel, UK, 13-16 November 2000. BCPC Conference Proceedings pages 285-290.</li>
"
"wms_abstract.en" "
<p>The warning system model &laquo;Carrot rust fly temperature&raquo; is based on a Finnish temperature-based model (Markkula <em>et al</em>, 1998; Tiilikkala &amp; Ojanen, 1999; Markkula <em>et al</em>, 2000). The model determines the start of the flight period for the 1st and 2nd generation of carrot rust fly based on accumuleted degree-days (day-degrees) over a base temperature of 5,0 &deg;C. VIPS uses the model for the 1st generation only.</p>
<p>Standard air temperature (temperature measured 2 m above ground) is used in the model. Degree-days are defined for this model as the sum of the difference between a base temperature of 5,0 &deg;C and the mean temperature for all days with a temperature &gt;5,0 &deg;C, in other words (daily mean temperature &ndash; 5,0 &deg;C) from 1 March (beginning when the ground has thawed).</p>
<h3>Interpretation of the warning</h3>
<p>Green rectangles indicate that the flight period has not yet begun. The accumulated day-degrees are &lt; 260 degree-days (day-degrees).</p>
<p>Yellow rectangles indicate that the flight period is beginning and that flies can be coming into the field. The accumulated day-degrees are &ge; 260 degree-days (day-degrees).</p>
<p>Red rectangles indicate peak flight period. The accumulated day-degrees are &ge; 360 degree-days (day-degrees).</p>
<p>Grey rectangles indicate that the flight period of the 1st generation is over. The accumulated day-degrees are &ge; 560 degree-days (day-degrees).</p>
<p>Be aware that in areas with field covers (plastic, single or double non-woven covers, etc.) with early crops the preceding season (either on the current field or neighboring fields), the flight period can start earlier due to higher soil temperature under the covers.</p>
<p>The graphic presentation shows the progress of the day-degree calculation that is the basis for the green, yellow and red warnings (the line: &laquo;Accumulated day-degrees with the base temperature of 5 degrees C&raquo;). The graph show straight horizontal lines for the threshold values. &laquo;Day-degree threshold for low likelihood of attack&raquo; corresponds to when the warning changes from green to yellow (260 day-degrees). &laquo;Day-degree threshold for high likelihood of attack &raquo; corresponds to when the warning changes from yellow to red (360 day-degrees). &laquo;Day-degree threshold for end of flight period&raquo; corresponds to when the warning changes from red to grey (560 day-degrees) and the flight period for the 1st generation is considered to be over. When the line &laquo; Accumulated day-degrees with the base temperature of 5 degrees C&raquo; intersects one of the lines for the day-degree threshold, the warning will advance to the next level and the color of the warning rectangle will change. The graph also shows the daily mean temperature for the relevant weather station. The graph is dynamic and the user can choose which parameters that are shown by clicking on the explanation below the graph.</p>
<h3>Warning season &ndash; start and end of the warning</h3>
<p>Starting time: Shown in VIPS from 1 April (starting date for accumulation of degree-days beginning from when the ground has thawed).<br /> Ending time: When the model has reached the requirement for the end of the flight period for the 1st generation (560 day-degrees).</p>
<h3>Testing and validation of the model</h3>
<h4>National</h4>
<p>The model has been tested for Norwegian conditions in the period of 2011-2015. Validation has shown that the model was accurate for most locations for the 1st generation. The model was, however, inaccurate for the 2nd generation for many locations and was totally incorrect for the district of J&aelig;ren. Based on the validation results, we have therefore chosen to remove warning of the 2nd generation of carrot rust fly from this model.</p>
<h4>International</h4>
<p>The model is in use in Finland. The extent to which the model has been validated in Finland is uncertain, but a validation was done in the summer of 1997. This validation showed that the model was quite accurate, but that the threshold temperature sm should be lowered to 255 day-degrees for the start of the flight period (as opposed to 260 degree-days in the original model) and 355 degree-days forthe peak flight period (as opposed to 360 degree-days in the original model) (Tiilikkala &amp; Ojanen, 1999).</p>
<h3>Literature</h3>
<p>Markkula, I., H. Ojanen and K. Tiilikkala. 1998. Forecasting and monitoring of the carrot fly (<em>Psila rosae</em>) in Finland. The 1998 Brighton Conference: Pests and Diseases: Conference Proceedings, Volume 2, pages 657-662.</p>
<p>Tiilikkala, K. and H. Ojanen. 1999. Use of a geographical information system (GIS) for forecasting the activities of carrot fly and cabbage root fly. IOBC/WPRS Bulletin 22 (5): 15-24.</p>
<p>Markkula, I., A. Hannukkala, A. Lehtinen, I. Mattila, H. Ojanen, S. Raisjio, P. Reijonen and K. Tiilikkala. 2000. Pest warnings and forecasts sent as SMS messages from models into \"farmer's pocket\". In publication: Pests &amp; Diseases 2000. Proceedings of an international conference held at the Brighton Hilton Metropole Hotel, UK, 13-16 November 2000. BCPC Conference Proceedings pages 285-290.</p>
<p>&nbsp;</p>
<p><strong>Contacts</strong></p>
<p>Annette Folkedal Schj&oslash;ll <a href=\"mailto:annette.folkedal.schjoll@nibio.no\">annette.folkedal.schjoll@nibio.no</a><br />Tor J. Johansen <a href=\"mailto:tor.johansen@nibio.no\">tor.johansen@nibio.no</a></p>
"
"wms_enable_request" "*"
"wms_title.en" "Carrot rust fly (Psila rosae) temperature model"
"wms_title.nb" "Gulrotflue svermetidspunktmodell"
"wms_getfeatureinfo_formatlist" "text/plain,text/html,text/xml"
"wms_accessconstraints" "none"
"wms_addresstype" ""
"wms_address" "Høgskoleveien 7"
"wms_city" "Ås"
"wms_stateorprovince" "Ås"
"wms_postcode" "1430"
"wms_country" "Norway"
"wms_contactelectronicmailaddress" "vips@nibio.no"
"wms_feature_info_mime_type" "text/html"
"wms_contactperson" "Berit Nordskog"
"wms_contactposition" "owner"
"wms_contactorganization" "Norsk institutt for bioøkonomi (NIBIO)"
END
END #web
############################# Start of legend #########################################################
# The legend configuration uses the CLASSITEM information in each layer to generate colour icons and labels
LEGEND
STATUS ON
KEYSIZE 16 12
LABEL
TYPE TRUETYPE
SIZE 10
COLOR 0 0 0
OFFSET 0 -3
END
END
LAYER
NAME "PSILARTEMP.WARNING_STATUS.2023-04-01"
DATA "/disks/data01/mapserver/data/PSILARTEMP/result_WARNING_STATUS_2023-04-01.tif"
TEMPLATE "/disks/data01/mapserver/wms/PSILARTEMP/query_template.xml" TOLERANCE 1 TOLERANCEUNITS PIXELS
TYPE RASTER
PROCESSING "BANDS=1" # WARNING_STATUS band on top (others invisible, but band values are available in the query template)
PROCESSING "NODATA=-1"
STATUS ON
METADATA
"wms_title" "Carrot rust fly (Psila rosae) temperature model 2023-04-01"
"wms_abstract.en" "
<ul style=\"list-style: none; padding: 0;\">
<li style=\"margin-bottom: 5px;\"><span style=\"background-color: #707070;\">&nbsp;&nbsp;&nbsp;</span> No forecast</li>
<li style=\"margin-bottom: 5px;\"><span style=\"background-color: #00B457;\">&nbsp;&nbsp;&nbsp;</span> No risk</li>
<li style=\"margin-bottom: 5px;\"><span style=\"background-color: #FFCC00;\">&nbsp;&nbsp;&nbsp;</span> Possible risk</li>
<li><span style=\"background-color: #FF0000;\">&nbsp;&nbsp;&nbsp;</span> High risk</li>
</ul>
"
"wms_abstract.nb" "
<ul style=\"list-style: none; padding: 0;\">
<li style=\"margin-bottom: 5px;\"><span style=\"background-color: #707070;\">&nbsp;&nbsp;&nbsp;</span> Varsel beregnes ikke</li>
<li style=\"margin-bottom: 5px;\"><span style=\"background-color: #00B457;\">&nbsp;&nbsp;&nbsp;</span> Ingen infeksjonsrisikok</li>
<li style=\"margin-bottom: 5px;\"><span style=\"background-color: #FFCC00;\">&nbsp;&nbsp;&nbsp;</span> Mulig fare for angrep</li>
<li><span style=\"background-color: #FF0000;\">&nbsp;&nbsp;&nbsp;</span> Høy fare for angrep</li>
</ul>
"
END
CLASSITEM "[pixel]"
# class using simple string comparison, equivalent to ([pixel] = 0)
LAYER
NAME "PSILARTEMP.WARNING_STATUS.2023-04-01"
DATA "/disks/data01/mapserver/data/PSILARTEMP/result_WARNING_STATUS_2023-04-01.tif"
TEMPLATE "/disks/data01/mapserver/wms/PSILARTEMP/query_template.xml" TOLERANCE 1 TOLERANCEUNITS PIXELS
TYPE RASTER
PROCESSING "BANDS=1" # WARNING_STATUS band on top (others invisible, but band values are available in the query template)
PROCESSING "NODATA=-1"
STATUS ON
METADATA
"wms_title" "Carrot rust fly (Psila rosae) temperature model 2023-04-01"
END
CLASSITEM "[pixel]"
# class using simple string comparison, equivalent to ([pixel] = 0)
CLASS
NAME "Model not running"
EXPRESSION ([pixel] >= 0 AND [pixel] < 2)
STYLE
COLOR 112 112 112
END
CLASS
NAME "Model not running"
EXPRESSION ([pixel] >= 0 AND [pixel] < 2)
STYLE
COLOR 112 112 112
END
CLASS
NAME "No infection risk"
EXPRESSION ([pixel] >= 2 AND [pixel] < 3)
STYLE
COLOR 0 180 87
END
END
CLASS
NAME "No infection risk"
EXPRESSION ([pixel] >= 2 AND [pixel] < 3)
STYLE
COLOR 0 180 87
END
CLASS
NAME "Possible infection risk"
EXPRESSION ([pixel] >= 3 AND [pixel] < 4)
STYLE
COLOR 255 204 0
END
END
CLASS
NAME "Possible infection risk"
EXPRESSION ([pixel] >= 3 AND [pixel] < 4)
STYLE
COLOR 255 204 0
END
CLASS
NAME "High infection risk"
EXPRESSION ([pixel] >= 4)
STYLE
COLOR 255 0 0
END
END
CLASS
NAME "High infection risk"
EXPRESSION ([pixel] >= 4)
STYLE
COLOR 255 0 0
END
END # Layer
LAYER
NAME "PSILARTEMP.DD.2023-04-01"
DATA "/disks/data01/mapserver/data/PSILARTEMP/result_2023-04-01.tif"
TEMPLATE "/disks/data01/mapserver/wms/PSILARTEMP/query_template_DD.xml" TOLERANCE 1 TOLERANCEUNITS PIXELS
TYPE RASTER
#PROCESSING "BANDS=1" # DD band on top (others invisible, but band values are available in the query template)
#PROCESSING "SCALE=AUTO"
#PROCESSING "NODATA=-1"
STATUS ON
METADATA
"wms_title" "Carrot rust fly (Psila rosae) temperature model Day Degrees 2023-04-01"
END
CLASSITEM "[pixel]"
CLASS
NAME "Day degrees"
#EXPRESSION ([pixel] >= 0 AND [pixel] <= 72)
STYLE
DATARANGE 0 1000
COLORRANGE 0 0 255 255 0 0
END
END
END # Layer
END
END # Layer
LAYER
NAME "PSILARTEMP.WARNING_STATUS.2023-04-02"
DATA "/disks/data01/mapserver/data/PSILARTEMP/result_WARNING_STATUS_2023-04-02.tif"
TEMPLATE "/disks/data01/mapserver/wms/PSILARTEMP/query_template.xml" TOLERANCE 1 TOLERANCEUNITS PIXELS
TYPE RASTER
PROCESSING "BANDS=1" # WARNING_STATUS band on top (others invisible, but band values are available in the query template)
PROCESSING "NODATA=-1"
LAYER
NAME "PSILARTEMP.DD.2023-04-01"
DATA "/disks/data01/mapserver/data/PSILARTEMP/result_2023-04-01.tif"
TEMPLATE "/disks/data01/mapserver/wms/PSILARTEMP/query_template_DD.xml" TOLERANCE 1 TOLERANCEUNITS PIXELS
TYPE RASTER
STATUS ON
METADATA
"wms_title" "Carrot rust fly (Psila rosae) temperature model Day Degrees 2023-04-01"
"wms_abstract.en" "
<ul style=\"list-style: none; padding: 0;\">
<li style=\"margin-bottom: 5px;\"><span style=\"display: inline-block; width: 25px; background: linear-gradient(to right, #0000FF, #FF0000);\">&nbsp;</span> Day degrees</li>
</ul>
"
STATUS ON
METADATA
"wms_title" "Carrot rust fly (Psila rosae) temperature model 2023-04-02"
END
CLASSITEM "[pixel]"
# class using simple string comparison, equivalent to ([pixel] = 0)
CLASS
NAME "Model not running"
EXPRESSION ([pixel] >= 0 AND [pixel] < 2)
STYLE
COLOR 112 112 112
END
END
CLASS
NAME "No infection risk"
EXPRESSION ([pixel] >= 2 AND [pixel] < 3)
STYLE
COLOR 0 180 87
END
END
CLASS
NAME "Possible infection risk"
EXPRESSION ([pixel] >= 3 AND [pixel] < 4)
STYLE
COLOR 255 204 0
END
END
CLASS
NAME "High infection risk"
EXPRESSION ([pixel] >= 4)
STYLE
COLOR 255 0 0
END
"wms_abstract.nb" "
<ul style=\"list-style: none; padding: 0;\">
<li style=\"margin-bottom: 5px;\"><span style=\"display: inline-block; width: 25px; background: linear-gradient(to right, #0000FF, #FF0000);\">&nbsp;</span> Døgngrader</li>
</ul>
"
END
CLASSITEM "[pixel]"
CLASS
NAME "Day degrees"
STYLE
DATARANGE 0 1000
COLORRANGE 0 0 255 255 0 0
END
END # Layer
END
END # Layer
LAYER
NAME "PSILARTEMP.WARNING_STATUS.2023-04-02"
DATA "/disks/data01/mapserver/data/PSILARTEMP/result_WARNING_STATUS_2023-04-02.tif"
TEMPLATE "/disks/data01/mapserver/wms/PSILARTEMP/query_template.xml" TOLERANCE 1 TOLERANCEUNITS PIXELS
TYPE RASTER
PROCESSING "BANDS=1" # WARNING_STATUS band on top (others invisible, but band values are available in the query template)
PROCESSING "NODATA=-1"
LAYER
NAME "PSILARTEMP.DD.2023-04-02"
DATA "/disks/data01/mapserver/data/PSILARTEMP/result_2023-04-02.tif"
TEMPLATE "/disks/data01/mapserver/wms/PSILARTEMP/query_template_DD.xml" TOLERANCE 1 TOLERANCEUNITS PIXELS
TYPE RASTER
#PROCESSING "BANDS=1" # DD band on top (others invisible, but band values are available in the query template)
#PROCESSING "SCALE=AUTO"
#PROCESSING "NODATA=-1"
STATUS ON
METADATA
"wms_title" "Carrot rust fly (Psila rosae) temperature model Day Degrees 2023-04-02"
END
STATUS ON
METADATA
"wms_title" "Carrot rust fly (Psila rosae) temperature model 2023-04-02"
"wms_abstract.en" "
<ul style=\"list-style: none; padding: 0;\">
<li style=\"margin-bottom: 5px;\"><span style=\"background-color: #707070;\">&nbsp;&nbsp;&nbsp;</span> No forecast</li>
<li style=\"margin-bottom: 5px;\"><span style=\"background-color: #00B457;\">&nbsp;&nbsp;&nbsp;</span> No risk</li>
<li style=\"margin-bottom: 5px;\"><span style=\"background-color: #FFCC00;\">&nbsp;&nbsp;&nbsp;</span> Possible risk</li>
<li><span style=\"background-color: #FF0000;\">&nbsp;&nbsp;&nbsp;</span> High risk</li>
</ul>
"
"wms_abstract.nb" "
<ul style=\"list-style: none; padding: 0;\">
<li style=\"margin-bottom: 5px;\"><span style=\"background-color: #707070;\">&nbsp;&nbsp;&nbsp;</span> Varsel beregnes ikke</li>
<li style=\"margin-bottom: 5px;\"><span style=\"background-color: #00B457;\">&nbsp;&nbsp;&nbsp;</span> Ingen infeksjonsrisikok</li>
<li style=\"margin-bottom: 5px;\"><span style=\"background-color: #FFCC00;\">&nbsp;&nbsp;&nbsp;</span> Mulig fare for angrep</li>
<li><span style=\"background-color: #FF0000;\">&nbsp;&nbsp;&nbsp;</span> Høy fare for angrep</li>
</ul>
"
END
CLASSITEM "[pixel]"
CLASS
NAME "Day degrees"
#EXPRESSION ([pixel] >= 0 AND [pixel] <= 72)
STYLE
DATARANGE 0 1000
COLORRANGE 0 0 255 255 0 0
END
END
END # Layer
# class using simple string comparison, equivalent to ([pixel] = 0)
LAYER
NAME "PSILARTEMP.WARNING_STATUS.2023-04-03"
DATA "/disks/data01/mapserver/data/PSILARTEMP/result_WARNING_STATUS_2023-04-03.tif"
TEMPLATE "/disks/data01/mapserver/wms/PSILARTEMP/query_template.xml" TOLERANCE 1 TOLERANCEUNITS PIXELS
TYPE RASTER
PROCESSING "BANDS=1" # WARNING_STATUS band on top (others invisible, but band values are available in the query template)
PROCESSING "NODATA=-1"
STATUS ON
METADATA
"wms_title" "Carrot rust fly (Psila rosae) temperature model 2023-04-03"
END
CLASSITEM "[pixel]"
# class using simple string comparison, equivalent to ([pixel] = 0)
CLASS
NAME "Model not running"
EXPRESSION ([pixel] >= 0 AND [pixel] < 2)
STYLE
COLOR 112 112 112
END
CLASS
NAME "Model not running"
EXPRESSION ([pixel] >= 0 AND [pixel] < 2)
STYLE
COLOR 112 112 112
END
CLASS
NAME "No infection risk"
EXPRESSION ([pixel] >= 2 AND [pixel] < 3)
STYLE
COLOR 0 180 87
END
END
CLASS
NAME "No infection risk"
EXPRESSION ([pixel] >= 2 AND [pixel] < 3)
STYLE
COLOR 0 180 87
END
CLASS
NAME "Possible infection risk"
EXPRESSION ([pixel] >= 3 AND [pixel] < 4)
STYLE
COLOR 255 204 0
END
END
CLASS
NAME "Possible infection risk"
EXPRESSION ([pixel] >= 3 AND [pixel] < 4)
STYLE
COLOR 255 204 0
END
CLASS
NAME "High infection risk"
EXPRESSION ([pixel] >= 4)
STYLE
COLOR 255 0 0
END
END
CLASS
NAME "High infection risk"
EXPRESSION ([pixel] >= 4)
STYLE
COLOR 255 0 0
END
END # Layer
LAYER
NAME "PSILARTEMP.DD.2023-04-03"
DATA "/disks/data01/mapserver/data/PSILARTEMP/result_2023-04-03.tif"
TEMPLATE "/disks/data01/mapserver/wms/PSILARTEMP/query_template_DD.xml" TOLERANCE 1 TOLERANCEUNITS PIXELS
TYPE RASTER
#PROCESSING "BANDS=1" # DD band on top (others invisible, but band values are available in the query template)
#PROCESSING "SCALE=AUTO"
#PROCESSING "NODATA=-1"
STATUS ON
METADATA
"wms_title" "Carrot rust fly (Psila rosae) temperature model Day Degrees 2023-04-03"
END
CLASSITEM "[pixel]"
CLASS
NAME "Day degrees"
#EXPRESSION ([pixel] >= 0 AND [pixel] <= 72)
STYLE
DATARANGE 0 1000
COLORRANGE 0 0 255 255 0 0
END
END
END # Layer
END
END # Layer
LAYER
NAME "PSILARTEMP.DD.2023-04-02"
DATA "/disks/data01/mapserver/data/PSILARTEMP/result_2023-04-02.tif"
TEMPLATE "/disks/data01/mapserver/wms/PSILARTEMP/query_template_DD.xml" TOLERANCE 1 TOLERANCEUNITS PIXELS
TYPE RASTER
STATUS ON
METADATA
"wms_title" "Carrot rust fly (Psila rosae) temperature model Day Degrees 2023-04-02"
"wms_abstract.en" "
<ul style=\"list-style: none; padding: 0;\">
<li style=\"margin-bottom: 5px;\"><span style=\"display: inline-block; width: 25px; background: linear-gradient(to right, #0000FF, #FF0000);\">&nbsp;</span> Day degrees</li>
</ul>
"
END #map
\ No newline at end of file
"wms_abstract.nb" "
<ul style=\"list-style: none; padding: 0;\">
<li style=\"margin-bottom: 5px;\"><span style=\"display: inline-block; width: 25px; background: linear-gradient(to right, #0000FF, #FF0000);\">&nbsp;</span> Døgngrader</li>
</ul>
"
END
CLASSITEM "[pixel]"
CLASS
NAME "Day degrees"
STYLE
DATARANGE 0 1000
COLORRANGE 0 0 255 255 0 0
END
END
END # Layer
END #map
\ No newline at end of file
......@@ -123,6 +123,97 @@ LAYER
```
This will result in correct color presentation in the map, and the availability of a legend for the map (see the upper right corner in the screenshot above)
### Multi language support
Mapserver supports the &language=[language code] query parameter. Read more about the specifics [here](https://mapserver.org/ogc/inspire.html). Through this, we have been able to add language specific titles and abstracts. See an example below
```mapserver
MAP
[...]
WEB
METADATA
[...]
"wms_inspire_capabilities" "embed"
"wms_title.en" "Carrot rust fly (Psila rosae) temperature model"
"wms_title.nb" "Gulrotflue svermetidspunktmodell"
END
END
END
```
#### Hacking i18n of mapserver generated legends
The auto generated legends from these mapserver sections do not support internationalization:
```mapserver
CLASS
NAME "Model not running"
EXPRESSION ([pixel] >= 0 AND [pixel] < 2)
STYLE
COLOR 112 112 112
END
END
CLASS
NAME "No infection risk"
EXPRESSION ([pixel] >= 2 AND [pixel] < 3)
STYLE
COLOR 0 180 87
END
END
CLASS
NAME "Possible infection risk"
EXPRESSION ([pixel] >= 3 AND [pixel] < 4)
STYLE
COLOR 255 204 0
END
END
CLASS
NAME "High infection risk"
EXPRESSION ([pixel] >= 4)
STYLE
COLOR 255 0 0
END
END
```
We have hacked this by using the `"wms_abstract"` metadata option for each layer. For example:
```mapserver
LAYER
NAME "PSILARTEMP.WARNING_STATUS.2023-04-01"
[...]
METADATA
"wms_abstract.en" "
<ul style=\"list-style: none; padding: 0;\">
<li style=\"margin-bottom: 5px;\"><span style=\"background-color: #707070;\">&nbsp;&nbsp;&nbsp;</span> No forecast</li>
<li style=\"margin-bottom: 5px;\"><span style=\"background-color: #00B457;\">&nbsp;&nbsp;&nbsp;</span> No risk</li>
<li style=\"margin-bottom: 5px;\"><span style=\"background-color: #FFCC00;\">&nbsp;&nbsp;&nbsp;</span> Possible risk</li>
<li><span style=\"background-color: #FF0000;\">&nbsp;&nbsp;&nbsp;</span> High risk</li>
</ul>
"
"wms_abstract.nb" "
<ul style=\"list-style: none; padding: 0;\">
<li style=\"margin-bottom: 5px;\"><span style=\"background-color: #707070;\">&nbsp;&nbsp;&nbsp;</span> Varsel beregnes ikke</li>
<li style=\"margin-bottom: 5px;\"><span style=\"background-color: #00B457;\">&nbsp;&nbsp;&nbsp;</span> Ingen infeksjonsrisikok</li>
<li style=\"margin-bottom: 5px;\"><span style=\"background-color: #FFCC00;\">&nbsp;&nbsp;&nbsp;</span> Mulig fare for angrep</li>
<li><span style=\"background-color: #FF0000;\">&nbsp;&nbsp;&nbsp;</span> Høy fare for angrep</li>
</ul>
"
END
END
```
The client must then check if the layer abstract exists in the requested language. If not, default to the auto generated legend. For example like this (using OpenLayers):
```javascript
// See if there is a language specific legend available
if(currentLayer.Abstract != undefined)
{
document.getElementById("layerLegend").innerHTML=currentLayer.Abstract;
}
else // Fallback to auto generated legend
{
document.getElementById("layerLegend").innerHTML='<img id="layerLegendImg" src="' + currentLayer.Style[0].LegendURL[0].OnlineResource + '"/>';
}
```
### Example Mapserver file
For your reference, please see the file `examples/PSILARTEMP.map` in this repository.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment