Using GDAL WMS Driver
Chris Helm
chelm at WAPA.GOV
Mon Nov 19 13:04:13 PST 2007
Hi All,
I'm searching for any use cases of using the new GDAL WMS driver within
MapServer. The goal is to use the GDAL WMS .xml file (below) as the raster
image in a mapserver layer definition (also below). I can use the xml file
successfully within QGIS 9.0 and also convert it into other formats on the
command line via gdal_translate. I've re-compiled MapServer to read the new
GDAL install and am getting a "format not recognized" error (below) from
MapServer.
MapServer Layer Def:
LAYER
NAME "gdal_wms_test"
STATUS OFF
TYPE RASTER
DATA "/local/path/to/gdal_wms.xml"
PROJECTION
"init=epsg:4326"
END
END
GDAL XML File:
<GDAL_WMS>
<Service name="WMS">
<Version>1.0.0</Version>
<ServerUrl>http://localhost/cgi-bin/wms_server?</ServerUrl>
<SRS>EPSG:4326</SRS>
<ImageFormat>image/png</ImageFormat>
<Layers>wms_test_layer</Layers>
<Styles></Styles>
</Service>
<DataWindow>
<UpperLeftX>-105.003889</UpperLeftX>
<UpperLeftY>40.412778</UpperLeftY>
<LowerRightX>-104.98333</LowerRightX>
<LowerRightY>40.399722</LowerRightY>
<SizeX>580</SizeX>
<SizeY>480</SizeY>
</DataWindow>
<Projection>EPSG:4326</Projection>
<BandsCount>3</BandsCount>
</GDAL_WMS>
Here's the output of gdalinfo on the above xml file:
>>$ gdalinfo gdal_wms.xml
Driver: WMS/OGC Web Map Service
Files: gdal_wms.xml
Size is 580, 480
Coordinate System is:
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0,
AUTHORITY["EPSG","8901"]],
UNIT["degree",0.01745329251994328,
AUTHORITY["EPSG","9122"]],
AUTHORITY["EPSG","4326"]]
Origin = (-105.003889000000001,40.412778000000003)
Pixel Size = (0.000035446551724,-0.000027200000000)
Corner Coordinates:
Upper Left (-105.0038890, 40.4127780) (105d 0'14.00"W, 40d24'46.00"N)
Lower Left (-105.0038890, 40.3997220) (105d 0'14.00"W, 40d23'59.00"N)
Upper Right (-104.9833300, 40.4127780) (104d58'59.99"W, 40d24'46.00"N)
Lower Right (-104.9833300, 40.3997220) (104d58'59.99"W, 40d23'59.00"N)
Center (-104.9936095, 40.4062500) (104d59'36.99"W, 40d24'22.50"N)
Band 1 Block=1024x1024 Type=Byte, ColorInterp=Undefined
Band 2 Block=1024x1024 Type=Byte, ColorInterp=Undefined
Band 3 Block=1024x1024 Type=Byte, ColorInterp=Undefined
The MapServer Error:
msDrawMap(): Image handling error. Failed to draw layer named 'gdal_wms_test'.
msDrawRaster(): Image handling error. Unrecognized or unsupported image format
drawEPP(): Image handling error. EPPL7 support is not available.
Any help is appreciated, thank you.
Chris
More information about the MapServer-users
mailing list