[MapServer-users] uvraster using vrt files from tileitem fails: GDALRasterIO() failed
Trygve Aspenes
trygve at aspenes.priv.no
Wed Oct 29 06:04:55 PDT 2025
Sorry
Somehow I managed to send the email before I had completed it.
Here is all again
> Hello
>
> I have a layer using uvraster as connectiontype, with the data comming
> from a helper layer via tileitem.
>
> So the helper layer is like this:
>
> LAYER
> PROJECTION
> "init=epsg:3857"
> END
> STATUS ON
> NAME "time_idx_vrt"
> TYPE POLYGON
> PROCESSING "CLOSE_CONNECTION=DEFER"
> DATA "geom from (select * from <table>) as foo using unique id using
> srid=3857"
> METADATA
> "wms_title" "x_timeindex"
> "wms_timeextent" "<time extent>"
> "wms_timeitem" "time"
> "wms_timedefault" "<default_time>"
> "wms_enable_request" "!*"
> "wms_srs" "EPSG:3857"
> END
> CONNECTIONTYPE postgis
> CONNECTION "<connection parametes"
> END
>
>
> And the layer:
> LAYER
> DEBUG 5
> NAME "TestLayer"
> METADATA
> "wms_title" "Test Layer"
> "wms_srs" "EPSG:3857"
> "wms_timeextent" "<extent>"
> "wms_enable_request" "*"
> "wms_include_items" "all"
> END
> VALIDATION
> "TIME" "^[-0-9TZ:]{20}$"
> "DEFAULT_TIME" "<default time>"
> END
> TILEITEM "filename"
> TILEINDEX "time_idx_vrt"
>
> PROCESSING "BANDS=1,2"
> TYPE POINT
> STATUS ON
> CONNECTIONTYPE uvraster
> PROJECTION
> "init=EPSG:3857"
> END
>
> <all the class definition>
> END
Here is what I get for that Layer in GetCapabilities:
<Layer queryable="0" opaque="0" cascaded="0">
<Name>TestLayer</Name>
<Title>Test Layer</Title>
<CRS>EPSG:3857</CRS>
<EX_GeographicBoundingBox>
<westBoundLongitude>-0.628279</westBoundLongitude>
<eastBoundLongitude>7.561219</eastBoundLongitude>
<southBoundLatitude>69.874435</southBoundLatitude>
<northBoundLatitude>71.893538</northBoundLatitude>
</EX_GeographicBoundingBox>
<BoundingBox CRS="EPSG:3857"
minx="-69939.7" miny="1.1028e+07" maxx="841711"
maxy="1.17149e+07" />
<Dimension name="time" units="ISO8601"
nearestValue="0">2025-10-28T17:04:48Z</Dimension>
<MetadataURL type="TC211">
<Format>text/xml</Format>
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:type="simple" xlink:href="https://<path to
server>/wms?request=GetMetadata&layer=TestLayer"/>
</MetadataURL>
<Style>
<Name>default</Name>
<Title>default</Title>
<LegendURL width="127" height="320">
<Format>image/png</Format>
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:type="simple" xlink:href="https://<path to
server>/wms?version=1.3.0&service=WMS&request=GetLegendGraphic&sld_version=1.1.0&layer=TestLayer&format=image/png&STYLE=default"/>
</LegendURL>
</Style>
</Layer>
Looks good to me. It gets the extents, so it clearly reads the vrt file.
So here is what I get when I try a getMap request:
<?xml version='1.0' encoding="UTF-8" standalone="no" ?>
<ServiceExceptionReport version="1.3.0"
xmlns="http://www.opengis.net/ogc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/ogc
http://schemas.opengis.net/wms/1.3.0/exceptions_1_3_0.xsd">
<ServiceException>
msDrawMap(): Image handling error. Failed to draw layer named
'TestLayer'.
msUVRASTERLayerWhichShapes(): General error message. Unable to draw
raster data.
msDrawRasterLayerGDAL_RawMode(): Unable to access file. GDALRasterIO()
failed: NETCDF:<path to netcdf file>:<variable_name>: No such file or
directory
</ServiceException>
</ServiceExceptionReport>
So it clearly gets the vrt file from the tileitem, open the vrt and find
the file name of the first band. Then when mapserver tries to read some
of the data from netcdf file it says no such file or directory.
And here is the problem. The file is cleary there. If I try with
gdalinfo on both the vrt file, and the netcdf file I get what I expect.
So what can be different in mapserver compared to what gdalinfo sees?
In the past I have seen problems with shapepath, but I have set
shapefile "" ( ie empty) in the map file to avoid this. But still the
problems.
Any idea what I can to fix this?
Trygve Aspenes
More information about the MapServer-users
mailing list