1

I am trying to configure MapServer in order to serve a vector layer with 2 dimensions (time and depth) using a tileindex shapefile.

In the mapfile I define the main layer and the tileindex layer as below:

  # *********************************************************
  # MAIN LAYER
  # *********************************************************
  LAYER
    NAME "Currents-Vector"
    STATUS OFF
    CONNECTIONTYPE UVRASTER
    DEBUG 5

    METADATA
      "wms_name"    "Currents-Vector"
      "wms_title"   "Currents-Vector"
      
      "wms_enable_request"          "GetCapabilities GetMap GetLegendGraphic"
      "wms_server_version"          "1.3.0"
      "wms_feature_info_mime_type"  "text/html text/xml application/json"
      "gml_include_items"           "all"
      "wms_srs"                     "EPSG:3857"
      "wms_extent"                  "-180 -90 180 90"
      "ows_srs"                     "EPSG:3857"
      "ows_extent"                  "-180 -90 180 90"
      
      "wms_dimensionlist"           "time, depth"
      "wms_timeitem"                "time"
      "wms_timeextent"              "2021-12-27T00:00:00Z/2022-01-21T23:00:00Z/PT1H"
      "wms_timeformat"              "YYYY-MM-DDTHH:MM:SSZ"

      "wms_depth_item"              "depth"
      "wms_depth_extent"            "0, 30, 130, 360, 1000"
      "wms_depth_units"             "meters"
      
    END # METADATA

    TILEINDEX "idx_07"
    TILEITEM "location"

    PROCESSING "BANDS=1,2"
    PROCESSING "UV_SPACING=28"
    PROCESSING "UV_SIZE_SCALE=100"

    PROJECTION
      "proj=latlong"
    END # PROJECTION
    
    
    TYPE POINT
    UNITS METERS
    CLASS
      STYLE
        ANGLE [uv_angle]
        COLOR 20 20 20
        GEOMTRANSFORM "end"
        MAXSIZE 30
        MINSIZE 15
        SIZE [uv_length]
        SYMBOL "vectorSymbol"
      END # STYLE
    END # CLASS
  END # LAYER
  
  # *********************************************************
  # TILEINDEX LAYER
  # *********************************************************    
  LAYER
    NAME "idx_07"
    DATA "index_07"      # -> path to shapefile used as tileindex 
    METADATA
      "wms_enable_request"  "*"
    END # METADATA
    
    STATUS OFF
    TILEITEM "location"
    TYPE TILEINDEX
    UNITS METERS
  END # LAYER

Each row in the Tileindex Shapfile table has 3 attributes, similar to the following:

LOCATION: NETCDF:"/test-app-v2/data/20211227_05_07_1000_h.nc":curr
TIME:     2021-12-27T05:00:00Z      
DEPTH:    1000

The GetCapabilities request to Mapserver returns a correct answer, showing the 2 dimensions (time and depth):

<Layer queryable="0" opaque="0" cascaded="0">
   <Name>Currents-Vector</Name>
   <Title>Currents-Vector</Title>
   <CRS>EPSG:3857</CRS>
   <EX_GeographicBoundingBox>
      <westBoundLongitude>-180</westBoundLongitude>
      <eastBoundLongitude>180</eastBoundLongitude>
      <southBoundLatitude>-90</southBoundLatitude>
      <northBoundLatitude>90</northBoundLatitude>
   </EX_GeographicBoundingBox>
   <BoundingBox CRS="EPSG:3857" minx="-2.00375e+07" miny="-2.00375e+07" maxx="2.00375e+07" maxy="2.00375e+07" />
   <Dimension name="time" units="ISO8601" nearestValue="0">2021-12-27T00:00:00Z/2022-01-21T23:00:00Z/PT1H</Dimension>
   <Dimension name="depth" units="meters"  multipleValues="1"  nearestValue="0">0, 30, 130, 360, 1000</Dimension>
   <MetadataURL type="TC211">
      <Format>text/xml</Format>
      <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="https://test-app-v2/cgi-bin/mapserv?map=APP&amp;request=GetMetadata&amp;layer=Currents-Vector"/>
   </MetadataURL>
</Layer>

The problem is that a GetMap request like this:

https://test-app-v2/cgi-bin/mapserv?bbox=-626172.1357121639,4304933.433021129,-547900.6187481434,4383204.949985149&service=WMS&request=GetMap&layers=Currents-Vector&time=2022-01-19T10:00:00&dim_depth=360&styles=&format=image%2Fpng&transparent=true&version=1.3.0&width=256&height=256&map=/test-app-v2/APP.map&crs=EPSG%3A3857

causes an error in the log file:

msUVRASTERLayerInitItemInfo(): OGR error. Invalid Field name: depth

and no tiles is returned.

3
  • Could this be a CASE issue. In the data is the depth data actually in field called DEPTH?
    – nmtoken
    Feb 15, 2022 at 11:35
  • Hi @nmtoken, thanks for your comment. It is not a CASE issue, I tried both uppercase and lowercase. About data, absolutely not, there is no "depth" field But According to my understanding the link should be in the Tileindex shapefile where each line looks like similar to this: (LOCATION: NETCDF: "/test-app-v2/data/20211227_05_07_1000_h.nc":curr, TIME: 2021-12-27T05:00:00Z, DEPTH:1000) So, when I ask for data with the parameters (time: 2021-12-27T05:00:00Z depth: 1000) Mapserver should understand that the data file is -> NETCDF: "/test-app-v2/data/20211227_05_07_1000_h.nc":curr
    – Giuseppe
    Mar 8, 2022 at 11:35
  • Similar issue ~ lists.osgeo.org/pipermail/mapserver-users/2014-June/076552.html ~ msOGRLayerInitItemInfo(): OGR error. Invalid Field name: Time".
    – nmtoken
    Mar 15, 2022 at 13:59

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.