1

I have MapServer 6.0.3 installed and running in my local machine. The same for Apache HTTP Server 2.2.22

I have created a .map file using NOTEPAD++ for a WCS service that I want to access using either QGIS and ArcMap as CLIENTS.

1.- When I use the URL:

http://localhost:80/cgi-bin/mapserv.exe?map=/ms4w/apps/raster.map

QGIS CAN list the service (see it), fine, but when I try to add the layer into the canvas it reports:

WCS provider: Cannot get test dataset.
Raster layer: Provider is not valid (provider: wcs, URI: cache=PreferNetwork&
crs=EPSG:4326&format=GTiff&identifier=gebco&url=http://localhost:80/cgi-bin
/mapserv.exe?map%3D/ms4w/tmp/raster.map

If I try adding a GDAL DRIVER (xml file), see below, as a RASTER file:

<WCS_GDAL>
  <ServiceURL>http://localhost:80/cgi-bin/mapserv.exe?map=/ms4w/app/raster.map</ServiceURL>
  <version>1.0.0</version>
  <CoverageName>gebco</CoverageName>
  <supportedCRSs>EPSG:4326</supportedCRSs>
  <PreferredFormat>gtiff</PreferredFormat>
</WCS_GDAL>

I get the following error:

msLoadMap(): Regular expression error. MS_DEFAULT_MAPFILE_PATTERN validation failed.
msEvalRegex(): Regular expression error. String failed expression test. 

2.- ArcMap only list (but again not displaying it) the image by adding just:

http://localhost:80/cgi-bin/mapserv.exe?map=/ms4w/apps/raster.map

So, the same problem as using QGIS..

3.- The only thing which seems to be working so far is adding the following URL into the browser:

http://localhost:80/cgi-bin/mapserv.exe?map=/ms4w/apps/raster.map
&SERVICE=wc‌s
&VERSION=1.0.0
&REQUEST=GetCoverage
&coverage=gebco
&CRS=EPSG:4326
&BBOX=32.4434100,‌​-28.0,55.0017433,0.0
&WIDTH=2707&HEIGHT=3360
&FORMAT=GTiff

After that a pop-up window ask you to download a tiFF into your computer.

But again using either ArcMap or QGIS as clients I am not able to display the raster using MapServer.

My MAP FILE:

MAP  
  NAME WCS_server  
  STATUS ON  
  DEBUG ON
  SIZE 2707 3360
  PROJECTION
    "init=epsg:4326"
  END
  EXTENT 32.4434100 -27.9999999974 55.0017433333 2.63999311301e-009
  UNITS DD
  SHAPEPATH "/ms4w/apps"
  CONFIG "MS_ERRORFILE" "/ms4w/tmp/ms_error.txt"
  MAXSIZE 3361

  OUTPUTFORMAT
    NAME GEOTIFF_16
    DRIVER "GDAL/GTiff"
    MIMETYPE "image/tiff"
    IMAGEMODE INT16
    EXTENSION "tif"
  END

  WEB
    IMAGEPATH "C:/ms4w/tmp/ms_tmp/" 
    IMAGEURL "/ms_tmp/"
    METADATA
      "wcs_label" "GMap WCS Demo Server"                    
      "wcs_onlineresource" "http://localhost:80/cgi-bin/mapserv.exe?" 
      "wcs_enable_request" "*"                          
    END
  END

  LAYER
    NAME gebco
    METADATA
      "wcs_label" "gebco_blue"
      "wcs_rangeset_name" "Range 1"
      "wcs_rangeset_label" "My Label"
    END
    TYPE RASTER
    STATUS ON
    DATA gebco.tif
    PROJECTION
      "init=epsg:4326"
    END
  END
END

Checking the ms_error.txt for errors, it reports the following when accessing the service using QGIS:

[Wed Feb 26 11:41:55 2014].129000 CGI Request 1 on process 4936
[Wed Feb 26 11:41:55 2014].129000 msWCSParseRequest20(): WCS server error. Parameter
'Version' is already set.
[Wed Feb 26 11:41:55 2014].129000 msWCSDispatch20(): Parse error occurred.
[Wed Feb 26 11:41:55 2014].209000 CGI Request 1 on process 1900
[Wed Feb 26 11:41:55 2014].209000 msWCSDispatch20(): version and service are not
compliant with WCS 2.0.0
[Wed Feb 26 11:41:55 2014].209000 msWCSParseRequest(): request is KVP.

And when trying to add the layer to the map (QGIS):

[Wed Feb 26 11:54:05 2014].220000 CGI Request 1 on process 4472
[Wed Feb 26 11:54:05 2014].220000 msWCSParseRequest20(): WCS server error. Parameter
'Version' is already set.
[Wed Feb 26 11:54:05 2014].220000 msWCSDispatch20(): Parse error occurred.
[Wed Feb 26 11:54:08 2014].904000 CGI Request 1 on process 5892
[Wed Feb 26 11:54:08 2014].904000 msWCSParseRequest20(): WCS server error. Parameter
'Version' is already set.
[Wed Feb 26 11:54:08 2014].904000 msWCSDispatch20(): Parse error occurred.
[Wed Feb 26 11:54:08 2014].994000 CGI Request 1 on process 6072
[Wed Feb 26 11:54:08 2014].994000 msWCSDispatch20(): version and service are not
compliant with WCS 2.0.0
[Wed Feb 26 11:54:08 2014].994000 msWCSParseRequest(): request is KVP.
[Wed Feb 26 11:54:09 2014].84000 CGI Request 1 on process 5944
[Wed Feb 26 11:54:09 2014].84000 msWCSParseRequest20(): WCS server error. Parameter
'Version' is already set.
[Wed Feb 26 11:54:09 2014].84000 msWCSDispatch20(): Parse error occurred.

Now, when connecting the service via ArcGIS:

[Wed Feb 26 11:57:32 2014].802000 CGI Request 1 on process 5832
[Wed Feb 26 11:57:32 2014].802000 msWCSDispatch20(): version and service are not
compliant with WCS 2.0.0
[Wed Feb 26 11:57:32 2014].802000 msWCSParseRequest(): request is KVP.
[Wed Feb 26 11:57:32 2014].822000 Format 'png24' ignored since mimetype 'image/png'
duplicates another outputFormatObj.
[Wed Feb 26 11:57:32 2014].822000 Format 'GTiff' ignored since mimetype 'image/tiff'
duplicates another outputFormatObj.
[Wed Feb 26 11:57:32 2014].932000 CGI Request 1 on process 3540
[Wed Feb 26 11:57:32 2014].932000 msWCSDispatch20(): version and service are not
compliant with WCS 2.0.0
[Wed Feb 26 11:57:32 2014].932000 msWCSParseRequest(): request is KVP.
[Wed Feb 26 11:57:32 2014].932000 msWCSParseRequest(): Whole String: gebco
[Wed Feb 26 11:57:32 2014].932000 msLoadProjectionString(): Projection library error.
Unrecognised OGC CRS def 'urn:ogc:def:crs:OGC::imageCRS'.

And finally, when trying to display the image in ArcGIS:

[Wed Feb 26 12:00:57 2014].16000 CGI Request 1 on process 4632
[Wed Feb 26 12:00:57 2014].16000 msWCSDispatch20(): version and service are not
compliant with WCS 2.0.0
[Wed Feb 26 12:00:57 2014].16000 msWCSParseRequest(): request is KVP.
[Wed Feb 26 12:00:57 2014].16000 msWCSParseRequest(): Whole String: gebco
[Wed Feb 26 12:00:57 2014].16000 msLoadProjectionString(): Projection library error.
Unrecognised OGC CRS def 'urn:ogc:def:crs:OGC::imageCRS'.
[Wed Feb 26 12:00:58 2014].166000 CGI Request 1 on process 4440
[Wed Feb 26 12:00:58 2014].166000 msWCSDispatch20(): version and service are not
compliant with WCS 2.0.0
[Wed Feb 26 12:00:58 2014].166000 msWCSParseRequest(): request is KVP.
[Wed Feb 26 12:00:58 2014].166000 msWCSParseRequest(): Whole String: gebco
[Wed Feb 26 12:00:58 2014].166000 msWCSGetCoverageBands11(): WCS server error.
RangeSubset field name malformed, expected 'Range 1', got RangeSubset=Range

So, there are many things to have a look at, and obviously the errors in the ms_error.txt file gives us a clue, how to solve them?. But for instance, why it says:

version and service are not compliant with WCS 2.0.0?

When I am using VERSION=1.0.0 in the requests?

3
  • I've added two further suggestions to my answer. What does tell the /ms4w/tmp/ms_error.txt file? Feb 26, 2014 at 11:23
  • Analysing your further edits, I see that the Service URL you use in QGIS contains the GetCoverage request and the coverage name, but it shouldn't. Then, the GDAL WCS driver is incomplete, because the CoverageName and eventually the Version tags are missing. Also, png24 is not a suitable OUTPUTFORMAT for a WCS coverage and GTiff seems to be a duplicate. Feb 26, 2014 at 14:24
  • I have removed GetCoverage and the coverage name when use QGIS, and not working either (see above). I have updated the GDAL driver (see above) and not working either. About the png24 and GTiff (ms_error.txt), I don't know what they are doing there, in the log file, because in my map file I do not include them at all. Would it be that my current version of Map Server only understand wcs 2.0?. By the way, thanks a lot for your support and ideas. Feb 26, 2014 at 16:23

2 Answers 2

1

It seems that the WCS support is not fully working in QGIS 2.2 yet. In the meanwhile, in order to test your WCS service in QGIS, you can write a GDAL WCS driver (e.g. CoverageName.xml) and then load it as a raster layer. It should be something like the following (requesting version 1.0.0):

<WCS_GDAL>
  <ServiceURL>http://localhost:80/cgi-bin/mapserv.exe?map=MYMAPFILE.map&</ServiceURL>
  <CoverageName>name</CoverageName>
  <Version>1.0.0</Version>
</WCS_GDAL>

Otherwise, there are other WCS clients that work with version 1.0.0, like gvSIG. Hope this helps.


EDIT

Following the Output Formats examples for WCS Server Mapfile on the MapServer site, I'd try to refine the OUTPUTFORMAT in this way, because the MIMETYPE is missing:

OUTPUTFORMAT
  NAME GEOTIFF_16
  DRIVER "GDAL/GTiff"
  MIMETYPE "image/tiff"
  IMAGEMODE INT16
  EXTENSION "tif"
END

And, above all, change the value of the "wcs_onlineresource" WEB metadata because is recommended (change accordingly to your configuration):

"wcs_onlineresource"  "http://127.0.0.1/cgi-bin/mapserv.exe?" ### recommended
3
  • Save the content of the GDAL WCS driver in a XML file and load it as a raster layer. Feb 24, 2014 at 10:52
  • It seems that there's something wrong with the Server URL. Try adding a final & to the URL and eventually read also the answer to this question: gis.stackexchange.com/questions/11443/… Feb 24, 2014 at 17:08
  • I suggest to add this further info to your question. Also the mapfile (or directly the WCS URL, if publicly available) can be useful to understand where is the issue. Feb 26, 2014 at 8:35
1

WCS client may read the GetCapabilities response and use the GetCoverage address that is announced there. You mapfile is configured as

 "wcs_onlineresource" "http://localhost:80/cgi-bin/mapserv.exe?" while correctly it is
  "wcs_onlineresource" "http://localhost:80/cgi-bin/mapserv.exe?map=/ms4w/apps/raster.map"

You seem to have typo in GDAL XML ...?map=/ms4w/app/raster.map... but you may also need to use url-encoding or xml-encoding inside the GDAL config file.

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.