[mapserver-users] GRIB2 WCS GetCoverage request fails with custom EPSG file

Rousseau Lambert,Louis-Philippe (ECCC) Louis-Philippe.RousseauLambert at ec.gc.ca
Wed Jul 14 11:51:40 PDT 2021


Hi all,


I have an issue with the GRIB2 WCS GetCoverage output using MapServer and a custom EPSG file. I'm using MapServer version 7.6.2, GDAL 3.1.3 and proj 7.2.0.



I have a Mapfile using a GRIB2 file as input data (with DATA in the mapfile) and I am trying to do a WCS 2.0.1 GetCoverage request for a subset of the layer related to the GRIB2. You can get a raw file example here using curl (command: curl -o tmp.grib2 "https://dd.weather.gc.ca/model_gem_global/15km/grib2/lat_lon/12/006/CMC_glb_TMP_TGL_2_latlon.15x.15_2021071412_P006.grib2")



I know my layer works fine in WMS and in WCS using the NetCDF and GeoTIFF output. Here is a small mapfile that shows this behavior as well as the EPSG file I'm using.
mapfile: https://pastebin.com/Pq06D0LQ
EPSG file: https://pastebin.com/7wfCjVdb



I also tested the file with shp2img (command: shp2img -m grib2.map -o ttt.png -all_debug 5)  and it outputs a valid image (see valid image here: https://ibb.co/mRD5YyC)

Here are WCS GetCoverage mapserv commands that outputs a valid subset of my GRIB2 layer in GeoTIFF and NetCDF:


*         mapserv -nh "QUERY_STRING=map=grib2.map&SERVICE=WCS&VERSION=2.0.1&REQUEST=GetCoverage&COVERAGEID=TEST&SUBSETTINGCRS=EPSG:4326&SUBSET=x(-120,-85)&SUBSET=y(48,66)&RESOLUTION=x(0.24)&RESOLUTION=y(0.24)&FORMAT=image/tiff" > tmp.tiff

*         mapserv -nh "QUERY_STRING=map=grib2.map&SERVICE=WCS&VERSION=2.0.1&REQUEST=GetCoverage&COVERAGEID=TEST&SUBSETTINGCRS=EPSG:4326&SUBSET=x(-120,-85)&SUBSET=y(48,66)&RESOLUTION=x(0.24)&RESOLUTION=y(0.24)&FORMAT=image/netcdf" > tmp.nc


The problem is the following: If I use the same request to output a GRIB2 file, I get an error:

Request
mapserv -nh "QUERY_STRING=map=grib2.map&SERVICE=WCS&VERSION=2.0.1&REQUEST=GetCoverage&COVERAGEID=TEST&SUBSETTINGCRS=EPSG:4326&SUBSET=x(-120,-85)&SUBSET=y(48,66)&RESOLUTION=x(0.24)&RESOLUTION=y(0.24)&FORMAT= application/x-grib2"

Error
<ows:ExceptionText>msWCSWriteFile20(): General error message. msSaveImage() failed
msSaveImageGDAL(): General error message. Failed to create output GRIB file.
Unsupported or missing spatial reference system</ows:ExceptionText>


Here are the debug MapServer lines: https://pastebin.com/pT9WHvGP. I know there are a lot of debugs errors showing "PROJ: Debug: proj_create: Cannot find proj.db" but this does not seem to cause issues with other formats then GRIB2 or in WMS requests.

This error only appears when doing a WCS request for GRIB2 output. Also, if I comment out the line CONFIG "PROJ_LIB" "./" , I get a valid GRIB2 file as output. I tried using a proj.db file instead and point to it in my CONFIG line, but it also fail with the same error.

Any ideas why only the GRIB2 WCS GetCoverage request fails with my custom EPSG file while the other WMS requests or WCS output formats work fine ?

Thanks

LP
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20210714/75ab8c08/attachment.htm>


More information about the MapServer-users mailing list