[mapserver-users] WCS layer units question...

Carl Godkin cgodkin at gmail.com
Wed Jan 12 16:44:31 PST 2022


Hi Jukka,

Thanks for the documentation pointer.  I have attached a .map file in which
I have all three of the possibilities

      # Trying all three.  My single band is called "band"
      "wcs_band_uom"  "m"
      "ows_band_uom"  "m"
      "band_band_uom"  "m"

but I still only see

<swe:uom code="W.m-2.Sr-1"/>

from DescribeCoverage.  I am very curious to know what I've overlooked!

By the way, I'm running MapServer from the "camptocamp" docker image.  It
appears to by MapServer 7.7-dev.

Thanks so much,
carl

On Wed, Jan 12, 2022 at 9:47 AM Rahkonen Jukka (MML) <
jukka.rahkonen at maanmittauslaitos.fi> wrote:

> Hi,
>
>
>
> Sorry, I thought that our service is open. This should work
> https://demo.mapserver.org/cgi-bin/wcs?SERVICE=wcs&VERSION=2.0.0&REQUEST=DescribeCoverage&COVERAGEID=modis
>
>
>
> The default value of uom is documented in
> https://www.mapserver.org/ogc/wcs_server.html
>
> “If no specific or default value is given, the output is dependent on the
> metadata key. The UOM, for example will be set to ‘W.m-2.Sr-1’”
>
>
>
> WCS metadata keywords, including “{band_name}_band_uom” work for us. I am
> sure that you will make it to work as well but if you won’t, show us your
> mapfile.
>
>
>
> -Jukka Rahkonen-
>
>
>
>
>
> *Lähettäjä:* MapServer-users <mapserver-users-bounces at lists.osgeo.org> *Puolesta
> *Carl Godkin
> *Lähetetty:* keskiviikko 12. tammikuuta 2022 17.13
> *Vastaanottaja:* Mapserver-Users (mapserver-users at lists.osgeo.org) <
> mapserver-users at lists.osgeo.org>
> *Aihe:* Re: [mapserver-users] WCS layer units question...
>
>
>
> Thanks for the reply, Jukka.
>
>
>
> I found "wcs_band_uom" in the docs but I can't seem to make the value I
> put into my map file appear in the DescribeCoverage output.  (The link you
> sent doesn't work for me.)
>
>
>
> I do see this though:
>
>
>
> <swe:field name="band">
>
> <swe:Quantity>
>
> <swe:nilValues/>
>
> <swe:uom code="W.m-2.Sr-1"/>
>
> <swe:constraint>
>
> <swe:AllowedValues>
>
> <swe:interval>-3.4028e+38 3.4028e+38</swe:interval>
>
> <swe:significantFigures>12</swe:significantFigures>
>
> </swe:AllowedValues>
>
> </swe:constraint>
>
> </swe:Quantity>
>
> </swe:field>
>
>
>
> The "swe:uom code" would seem to be what I want to affect.  For some
> reason I see the value "watts per square meter per steradian" which appears
> nowhere in my map file so I wonder if it's some sort of default baked into
> the code or something.  (I had seen that before but hadn't bothered to try
> to figure out what it was until just now.  That's weird.)
>
>
>
> Thanks for your help,
>
>
>
> carl
>
>
>
>
>
>
>
> On Tue, Jan 11, 2022 at 11:57 PM Rahkonen Jukka (MML) <
> jukka.rahkonen at maanmittauslaitos.fi> wrote:
>
> Hi,
>
>
>
> WCS users are supposed to read the metadata with DescribeCoverage, for
> example
> https://avoin-visukuva.nls.fi/ortokuvat-ja-korkeusmallit/wcs/v1?service=WCS&version=2.0.1&request=DescribeCoverage&coverageID=ortokuva_vari
>
> The units can be configured in the mapfile with “wcs_band_uom”. I do not
> know if it is possible to configure the outputformat to write uom also into
> the TIFF. That is something that GDAL should do.
>
>
>
> -Jukka Rahkonen-
>
>
>
>
>
>
>
> *Lähettäjä:* MapServer-users <mapserver-users-bounces at lists.osgeo.org> *Puolesta
> *Carl Godkin
> *Lähetetty:* keskiviikko 12. tammikuuta 2022 3.58
> *Vastaanottaja:* Mapserver-Users (mapserver-users at lists.osgeo.org) <
> mapserver-users at lists.osgeo.org>
> *Aihe:* [mapserver-users] WCS layer units question...
>
>
>
> Hi,
>
>
>
> I have a local WCS & WMS server.
>
>
>
> I am trying to figure out if I can somehow define the Z units of a terrain
> layer I'm serving.
>
>
>
> The single band from the individual GeoTIFF files providing the terrain
> data looks like this (from gdalinfo):
>
>
>
> Band 1 Block=512x512 Type=Float32, ColorInterp=Gray
>   Description = Layer_1
>   NoData Value=-999999
>   Unit Type: m     <===================================== units are meters
>   Metadata:
>     LAYER_TYPE=athematic
>     RepresentationType=ATHEMATIC
>
>
>
> but when I download a GeoTIFF using a WCS GetCoverage request on this
> layer, the GeoTIFF's single band just looks like this:
>
>
>
> Band 1 Block=571x3 Type=Float32, ColorInterp=Gray
>
>
>
> without "Unit Type."
>
>
>
> I also tried using
>
>    UNITS Meters
>
> in my LAYER definition in my map file (copying an example I found among
> the case studies on the web site) but it didn't seem to have any effect.
>
>
>
> Is there some way to define and retrieve the Z units for a WCS server?
>
>
>
> Thanks very much.
>
>
>
> carl
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20220112/83075980/attachment-0001.html>
-------------- next part --------------
MAP
  NAME "example"  # Short name prepended to map, legend and scalebar filenames 
  STATUS OFF
  SIZE 800 600
  EXTENT -180 -90 180 90
  UNITS DD
  # Path to folder holding the tile index shapefiles
  SHAPEPATH "data"
  IMAGECOLOR 255 255 255    # Background color for transparency

  MAXSIZE 8192

  #CONFIG "MS_ERRORFILE" "tmp/ms_error.txt"
  # 0-5: 0=Off, 1-5=level of detail written to ms_error.txt
  DEBUG 5

  WEB
    # Path for temp files; must be writable by www-data
    IMAGEPATH "tmp/" 
    IMAGEURL "/ms_tmp/"             # Base URL for IMAGEPATH. 
    METADATA
      "ows_abstract"        "WMS & WCS Elevation Service"
      "ows_contactfacsimiletelephone" ""
      "ows_contactinstructions"       ""
      "ows_enable_request"  "*"
      "ows_hoursofservice"            ""
      "ows_onlineresource"  "http://localhost:8080/"
      "ows_role"                      ""
      "ows_srs"             "EPSG:4326 EPSG:4269 EPSG:3857"
      "ows_updatesequence"  "2015-02-27T16:26:00Z"

      "wcs_accessconstraints"    "none"

      "wcs_description"          "Terrain server"
      "wcs_enable_request"       "*"
      "wcs_fees"                 "none"
      "wcs_keywordlist"          "wcs,test"
      "wcs_label"                "P2 WCS Server" ### required
      "wcs_metadatalink_format"  "text/plain"
      "wcs_metadatalink_type"    "TC211"
      "wcs_onlineresource"       "http://localhost:8080/" ### recommended

      "wcs_service_onlineresource"   "http://localhost:8080/"
   
      "wms_rootlayer_name"   ""   # Suppresses root layer in gdalinfo

      # Trying all three.  My single band is called "band"
      "wcs_band_uom"  "m"
      "ows_band_uom"  "m"
      "band_band_uom"  "m"
    END

  END

  #define your output projection
  PROJECTION
    "init=epsg:4269"
  END

  #define output formats

  OUTPUTFORMAT
    NAME GEOTIFF
    DRIVER "GDAL/GTiff"
    MIMETYPE "image/geotiff"
    IMAGEMODE RGB
    EXTENSION "tif"
  END

  OUTPUTFORMAT
    NAME "GEOTIFF_32"
    DRIVER "GDAL/GTiff"
    MIMETYPE "image/tiff"
    IMAGEMODE FLOAT32
    EXTENSION "tif"
 END

  #
  # Start of layer definitions
  #

  LAYER
    PROCESSING "RESAMPLE=BILINEAR"
    NAME USGS_13as_elevation
    METADATA
      "wms_title"           "USGS - 1/3 arc-second grid (western US)" 
      "ows_extent"          "-126 30.999444 -110.999444 50.000556"
      "wms_include_items"   "x,y,value_0"

      "wcs_label"           "USGS - 1/3 arc-second grid"  ### required
      "wcs_rangeset_name"   "Range 1"  ### required to support DescribeCoverage request
      "wcs_rangeset_label"  "USA" ### required to support DescribeCoverage request

      "wcs_resolution" "0.000092592592593 0.000092592592593"
      "wcs_bandcount" "1"
      "wcs_srs" "EPSG:4269"
    END

    TYPE RASTER ### required
    UNITS Meters
    STATUS ON
    TILEINDEX "usgs_13as_elevation-index.shp" # Path is relative to SHAPEPATH
    TILEITEM "Location"
    TEMPLATE "../template.html"
    PROJECTION
      "init=epsg:4269"
    END
  END

END


More information about the MapServer-users mailing list