[MapServer-users] UVRASTER reprojection
Rousseau Lambert,Louis-Philippe (ECCC)
Louis-Philippe.RousseauLambert at ec.gc.ca
Mon Oct 6 04:04:45 PDT 2025
Hi,
I am tagging along this thread as I’m also very interested to see if there is a simple answer to fix this behaviour 😊 This is also an issue we had with using UVRaster connection in MapServer with non-global weather models on our side.
Luckily for us, we also have access to the wind direction and wind speed variables for our non-global models and ending up using those variables instead, because the wind speed and direction are corrected properly to be relative to the North instead of using the wind vector components (U and V) which are always relative to the model’s grid axis.
For this we needed to update the styles, we were using though as it is not the regular use for the UVRaster connection type. Because we are passing the wind direction and speed directly and variables, we are using the U and V values accordingly for the styles. In our case U becomes the speed and V the direction instead of using uv_length and uv_angle.
MapServer class example:
CLASS
NAME "0 - 5 kts"
EXPRESSION ([v] > 0.00 AND [v] <= 5)
STYLE
COLOR 0 0 127
SYMBOL "arrow_wind"
ANGLE [u]
SIZE 12
END
END
For your curiosity, here is a layer example using this method in our viewer MSC AniMet<https://eccc-msc.github.io/msc-animet/?layers=RDPS_10km_Winds_10m;0.75;0;1;WindBarbs_Sfc;1&extent=-9741945,4535177,-6122844,8024751&overlays=Boundaries&range=84,5,l,PT1H>
Maybe this could also be useful on your side ?
LP
--
Louis-Philippe Rousseau-Lambert, B.Sc.
Spécialiste en géomatique / Geomatics Specialist
Systèmes de données géospatiales et ouvertes
Geospatial and Open Data Systems
Service Météorologique du Canada
Meteorological Service of Canada
Environnement et Changement Climatique Canada
Environment and Climate Change Canada
louis-philippe.rousseaulambert at ec.gc.ca
(438) 801-0599
From: MapServer-users <mapserver-users-bounces at lists.osgeo.org> On Behalf Of Alistair Everett via MapServer-users
Sent: Monday, October 6, 2025 6:17 AM
To: Seth G <sethg at geographika.co.uk>
Cc: MapServer Users <mapserver-users at lists.osgeo.org>
Subject: Re: [MapServer-users] UVRASTER reprojection
Hi Seth,
Thanks for your reply, we're just reprojecting the data. I'll take a closer look at the test case too, since it seems like that should be reprojecting from stereographic to geographic. I should also be able to pull together some test data in the next few days too, I can open an issue with it when I've put it together.
Here are a couple of example requests:
One in EPSG:4326
localhost:8000/wms?REQUEST=GetMap&SERVICE=WMS&VERSION=1.3.0&FORMAT=image%2Fpng&STYLES=wind_barb&TRANSPARENT=TRUE&TIME=2025-10-06T07%3A00%3A00Z&DIM_PRESSURE=50.0&DIM_REFERENCE_TIME=2025-10-06T03%3A00%3A00Z&LAYERS=wind_pl_vector_meps_det_vdiv_2_5km_calculations&WIDTH=1304&HEIGHT=1504&CRS=EPSG%3A3857&BBOX=-2460529.2703191666%2C4596419.518351211%2C6809846.057963322%2C15288631.55342549
https://pasteboard.co/jI1eMKaj3PT1.png
This is one in EPSG:3411:
localhost:8000/wms?REQUEST=GetMap&SERVICE=WMS&VERSION=1.3.0&FORMAT=image%2Fpng&STYLES=wind_barb&TRANSPARENT=TRUE&TIME=2025-10-06T16%3A00%3A00Z&DIM_PRESSURE=50.0&DIM_REFERENCE_TIME=2025-10-06T03%3A00%3A00Z&LAYERS=wind_pl_vector_meps_det_vdiv_2_5km_calculations&WIDTH=1438&HEIGHT=1504&CRS=EPSG%3A3411&BBOX=404935.5094684181%2C-3769428.4764078585%2C4977748.7994076125%2C1013263.5876175575
https://pasteboard.co/IHZjgXibtLyJ.png
Thanks,
Alistair
On Sun, 5 Oct 2025 at 10:00, Seth G <sethg at geographika.co.uk<mailto:sethg at geographika.co.uk>> wrote:
Hi Alistair,
Could you give an example request (I presume it is WMS?)? Are you rotating your map at all, or is it just the projection?
There are some tests which reproject a UVRASTER LAYER at https://github.com/MapServer/MapServer/blob/29e4ae81620a2c50201101c763df0b9d8d540b67/msautotest/wxs/wms_uvraster_map_reprojection.map
It sounds like an oversight, so if you are able to create a standalone test case, it would be worth opening an issue.
Seth
--
web:https://geographika.net<https://geographika.net/> & https://mapserverstudio.net<https://mapserverstudio.net/>
mastodon: @geographika at mastodon.social<mailto:geographika at mastodon.social>
On Fri, Oct 3, 2025, at 11:59 AM, Alistair Everett via MapServer-users wrote:
Hi all,
I'm trying to use the UVRASTER connection to plot wind barbs. I noticed if I request the layer in a different projection the location of the arrows are reprojected but the angle, and presumably vector components, are not - rather they remain in the same direction relative to my screen. It's a little unclear from the documentation if this is the expected behaviour for UVRASTER or not? I included a pasteboard link to a screenshot to show what I mean, compare for example vectors in the corners of the data and you will see they point in the same direction relative to my screen, rather than being rotated to match the projection.
If this is expected, does anyone have any suggested ways of working around this?
If this is not expected, does anyone have any ideas what I've done wrong? I can provide some sample data if someone wants to try to reproduce.
I'm using: MapServer version 8.4.0 PROJ version 9.4 GDAL version 3.11 OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=OGCAPI_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS SUPPORTS=PBF INPUT=JPEG INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE INPUT=FLATGEOBUF
Screenshot: https://pasteboard.co/WTgbexDmQaAe.png
Example mapfile: https://pastebin.com/ibPc6gVK
Thanks,
Alistair
-----------------------------
Dr Alistair Everett
Senioringeniør / Senior Software Engineer
Avdeling for Geoutvikling
Phone: +47 939 68 985
Email: alistair.everett at met.no<mailto:alistair.everett at met.no>
Meteorologisk Institutt,
Henrik Mohns plass 1,
0313 Oslo
-----------------------------
Dr Alistair Everett
Senioringeniør / Senior Software Engineer
Avdeling for Geoutvikling
Phone: +47 939 68 985
Email: alistair.everett at met.no<mailto:alistaire at met.no>
Meteorologisk Institutt,
Henrik Mohns plass 1,
0313 Oslo
_______________________________________________
MapServer-users mailing list
MapServer-users at lists.osgeo.org<mailto: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/20251006/69879073/attachment-0001.htm>
More information about the MapServer-users
mailing list