Hi all

I try to use a shapefile to handle time. But he trick is my data source is a netcdf file. For this I need the gdal netcdf driver.

My shapefile looks like this:
ogrinfo points.shp points
--------------------------------
INFO: Open of `points.shp'
      using driver `ESRI Shapefile' successful.

Layer name: points
Metadata:
  DBF_DATE_LAST_UPDATE=2023-08-31
Geometry: Polygon
Feature Count: 67
Extent: (-18.100000, 49.800000) - (54.200000, 75.200000)
Layer SRS WKT:
GEOGCRS["WGS 84",
    DATUM["World Geodetic System 1984",
        ELLIPSOID["WGS 84",6378137,298.257223563,
            LENGTHUNIT["metre",1]]],
    PRIMEM["Greenwich",0,
        ANGLEUNIT["degree",0.0174532925199433]],
    CS[ellipsoidal,2],
        AXIS["latitude",north,
            ORDER[1],
            ANGLEUNIT["degree",0.0174532925199433]],
        AXIS["longitude",east,
            ORDER[2],
            ANGLEUNIT["degree",0.0174532925199433]],
    ID["EPSG",4326]]
Data axis to CRS axis mapping: 2,1
location: String (112.0)
time: String (80.0)
OGRFeature(points):0
  location (String) = NETCDF:<path to netcdf file>:<parameter name>
  time (String) = 2023-08-31T00:00:00Z
  POLYGON ((-18.1 49.8,-18.1 75.2,54.2 75.2,54.2 49.8,-18.1 49.8))
...
etc for all the time stamps
--------------------------------------------------

The setup mapfile like this first with a time idx helper layer:
  LAYER
    STATUS ON
    NAME "time_idx"
    TYPE POLYGON
    DATA "points"
    METADATA
      "wms_title" "TIME INDEX"
      "wms_srs" "EPSG:4326"
      "wms_extent" "-18.1 49.8 54.2 75.2"
      "wms_timeextent" "2023-08-31T00:00:00Z/2023-08-02T18:00:00Z/PT1H"
      "wms_timeitem" "time"
      "wms_timedefault" "2023-08-31T12:00:00Z"
      "wms_enable_request" "*"
    END
    CONNECTION "points.shp"
    CONNECTIONTYPE OGR
  END

and the layer itself:
  LAYER
    NAME "layer_name"
    STATUS ON
    TYPE raster

    PROCESSING   "BANDS=1"

    PROJECTION
      <proj data>
    END
    TILEINDEX "time_idx"
    TILEITEM "location"

    METADATA
        "wms_title" "layer_title"
"wms_timeextent" "2023-08-31T00:00:00Z/2023-09-01T18:00:00Z/PT1H"
        "wms_timeitem" "time"
        "wms_enable_request" "*"
    END
  END


Now requesting this layer I get:
<?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 &#39;<layer name>&#39;. msDrawRasterLayerLow(): Unable to access file. Corrupt, empty or missing file &#39;./NETCDF:<path to netcdf file>:<parameter name>&#39; for layer &#39;<layer name>&#39;. ./NETCDF:<path to netcdf file>:<parameter name>: No such file or directory
</ServiceException>
</ServiceExceptionReport>

So for some reason the data is handled as a file name( prepending ./ to the location in my shapefile), and not using gdal driver netcdf to open the file.

Is there a way to tell mapserver to handle this correctly using the gdal netcdf driver opening the file?

Trygve Aspenes
_______________________________________________
MapServer-users mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to