[mapserver-users] How to get a single-part ASCII Grid result from WCS

Rahkonen Jukka (MML) jukka.rahkonen at maanmittauslaitos.fi
Mon Aug 30 02:58:29 PDT 2021


Hi,

I have been trying to configure a GDAL AAIGrid outputformat for WCS 2.0. The format works, but I can only get the response as a mime multipart attachment.  I would like to get just the ASCII grid part as simple text.  I can see that with the OGR outputformats https://mapserver.org/output/ogr_output.html the FORM option can be used:

"FORM=simple/zip/multipart
Indicates whether the result should be a simple single file (simple), a mime multipart attachment (multipart) or a zip file (zip). "zip" is the default."

FORM=simple is what I would like to have and FORM=zip might be acceptable. But unfortunately it seems that FORM is not supported for GDAL raster drivers. Could anybody suggest a good workaround?

My outputformat with FORM experiments looks like this

OUTPUTFORMAT
NAME AAIGRID
DRIVER "GDAL/AAIGRID"
#MIMETYPE "application/x-ascii-grid"
MIMETYPE "text/plain"
IMAGEMODE FLOAT32
EXTENSION "txt"
FORMATOPTION "SIGNIFICANT_DIGITS=5"
FORMATOPTION "FORM=simple"
FORMATOPTION "FILENAME=result.txt"
END

and the response, that my MS4W server sends named as "mapserv.exe" looks like this

--wcs
Content-Type: text/plain
Content-Description: coverage data
Content-Transfer-Encoding: binary
Content-ID: coverage/result.txt
Content-Disposition: INLINE; filename=result.txt

ncols        50
nrows        50
xllcorner    212000.000000000000
yllcorner    6762000.000000000000
cellsize     2.000000000000
10.2 10.253 10.339 10.645 11.
...rest of the data

--wcs
Content-Type: application/octet-stream
Content-Description: coverage data
Content-Transfer-Encoding: binary
Content-ID: coverage/result.prj
Content-Disposition: INLINE; filename=result.prj

PROJCS["ETRS89_TM35FIN_E_N",GEOGCS["GCS_ETRS_1989",DATUM["D_ETRS_1989",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",27],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["Meter",1]]
--wcs
Content-Type: application/octet-stream
Content-Description: coverage data
Content-Transfer-Encoding: binary
Content-ID: coverage/result.txt.aux.xml
Content-Disposition: INLINE; filename=result.txt.aux.xml

<PAMDataset>
  <Metadata>
    <MDI key="TIFFTAG_RESOLUTIONUNIT">2</MDI>
    <MDI key="TIFFTAG_XRESOLUTION">72.000000</MDI>
    <MDI key="TIFFTAG_YRESOLUTION">72.000000</MDI>
  </Metadata>
</PAMDataset>

--wcs-



-Jukka Rahkonen-





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20210830/46d93435/attachment.htm>


More information about the MapServer-users mailing list