.. _wcs_server: ***************************************************************************** WCS Server ***************************************************************************** :Author: Jeff McKenna :Contact: jmckenna at gatewaygeomatics.com :Last Updated: 2010-10-19 .. contents:: Table of Contents :depth: 2 :backlinks: top Introduction ============ A WCS (or Web Coverage Service) allows for the publication of "coverages"- digital geospatial information representing space-varying phenomena. In the MapServer world it allows for unfiltered access to raster data. Conceptually it is easy think of WCS as a raster equivalent of WFS. The following documentation is based on the `Open GIS Consortium's (OGC) Web Coverage Server Interfaces Implementation Specification version 1.0.0`_. Links to WCS-Related Information -------------------------------- - `WCS 1.0.0 specification`_ - `WCS 1.1.1c1 specification`_ - :ref:`WMS Server HowTo ` Software Requirements --------------------- In order to enable MapServer to serve WCS data, it MUST be compiled against certain libraries: - PROJ.4: The reprojection library. Version 4.4.3 or greater is required. - GDAL: raster support library. - MapServer: version >= 4.4 (tested with 5.0.2 while updating this document) For WCS 1.1.x support (MapServer 5.2) there is an additional requirement: - libxml2: An xml parser and generation library. Please see the :ref:`MapServer UNIX Compilation and Installation HowTo ` for detailed instructions on compiling MapServer with support for these libraries and features. For Windows users, `MapServer for Windows (MS4W)`_ comes WCS Server support. Configuring Your Mapfile to Serve WCS Layers ============================================ Much as in the WMS and WFS support, WCS publishing is enabled by adding certain magic METADATA keyword/value pairs to a .map file. MapServer will serve and include in its WCS capabilities only the layers that meet the following conditions: - Data source is a raster, which is processed using GDAL (e.g GeoTIFF, Erdas Imagine, ...) - LAYER NAME must be set - LAYER TYPE is set to RASTER - LAYER DUMP parameter set to TRUE - WEB metadata "wcs_label" must be set - LAYER metadata "wcs_label" must be set - LAYER metadata "wcs_rangeset_name" must be set - LAYER metadata "wcs_rangeset_label" must be set Example WCS Server Mapfile -------------------------- The following is an example of a simple WCS Server mapfile. Note the comments for the required parameters. .. code-block:: mapfile NAME WCS_server STATUS ON SIZE 400 300 SYMBOLSET "../etc/symbols.txt" EXTENT -2200000 -712631 3072800 3840000 UNITS METERS SHAPEPATH "../data" IMAGECOLOR 255 255 255 FONTSET "../etc/fonts.txt" # # Start of web interface definition # WEB IMAGEPATH "/ms4w/tmp/ms_tmp/" IMAGEURL "/ms_tmp/" METADATA "wcs_label" "GMap WCS Demo Server" ### required "wcs_description" "Some text description of the service" "wcs_onlineresource" "http://127.0.0.1/cgi-bin/mapserv.exe?" ### recommended "wcs_fees" "none" "wcs_accessconstraints" "none" "wcs_keywordlist" "wcs,test" "wcs_metadatalink_type" "TC211" "wcs_metadatalink_format" "text/plain" "wcs_metadatalink_href" "http://someurl.com" "wcs_address" "124 Gilmour Street" "wcs_city" "Ottawa" "wcs_stateorprovince" "ON" "wcs_postcode" "90210" "wcs_country" "Canada" "wcs_contactelectronicmailaddress" "blah@blah" "wcs_contactperson" "me" "wcs_contactorganization" "unemployed" "wcs_contactposition" "manager" "wcs_contactvoicetelephone" "613-555-1234" "wcs_contactfacimiletelephone" "613-555-1235" "wcs_service_onlineresource" "http://127.0.0.1/cgi-bin/mapserv.exe?" END END PROJECTION "init=epsg:42304" END LAYER NAME bathymetry METADATA "wcs_label" "Elevation/Bathymetry" ### required "wcs_rangeset_name" "Range 1" ### required to support DescribeCoverage request "wcs_rangeset_label" "My Label" ### required to support DescribeCoverage request END TYPE RASTER ### required STATUS ON DATA bath_mapserver.tif PROJECTION "init=epsg:42304" END DUMP TRUE ### required END END # Map File Test Your WCS 1.0 Server ======================== Validate the Capabilities Metadata ---------------------------------- OK, now that we've got a mapfile, we have to check the XML capabilities returned by our server to make sure nothing is missing. Using a web browser, access your server's online resource URL to which you add the parameters "SERVICE=WCS&VERSION=1.0.0&REQUEST=GetCapabilities" to the end, e.g. :: http://my.host.com/cgi-bin/mapserv?map=mywcs.map&SERVICE=WCS&VERSION=1.0.0&REQUEST=GetCapabilities If you get an error message in the XML output then take necessary actions. Common problems and solutions are listed in the FAQ at the end of this document. If everything went well, you should have a complete XML capabilities document. Search it for the word "WARNING"... MapServer inserts XML comments starting with "