Home | Docs | Issue Tracker | FAQ | Download | |
A map file may have zero, one or more OUTPUTFORMAT object declarations, defining available output formats supported including formats like PNG, GIF, JPEG, GeoTIFF, SVG, PDF and KML.
If OUTPUTFORMAT sections declarations are not found in the map file, the following implicit declarations will be made. Only those for which support is compiled in will actually be available. The GeoTIFF depends on building with GDAL support, and the PDF and SVG depend on building with cairo support.
OUTPUTFORMAT
NAME "png"
DRIVER AGG/PNG
MIMETYPE "image/png"
IMAGEMODE RGB
EXTENSION "png"
FORMATOPTION "GAMMA=0.75"
END
OUTPUTFORMAT
NAME "gif"
DRIVER GD/GIF
MIMETYPE "image/gif"
IMAGEMODE PC256
EXTENSION "gif"
END
OUTPUTFORMAT
NAME "png8"
DRIVER AGG/PNG8
MIMETYPE "image/png; mode=8bit"
IMAGEMODE RGB
EXTENSION "png"
FORMATOPTION "QUANTIZE_FORCE=on"
FORMATOPTION "QUANTIZE_COLORS=256"
FORMATOPTION "GAMMA=0.75"
END
OUTPUTFORMAT
NAME "jpeg"
DRIVER AGG/JPEG
MIMETYPE "image/jpeg"
IMAGEMODE RGB
EXTENSION "jpg"
FORMATOPTION "GAMMA=0.75"
END
OUTPUTFORMAT
NAME "svg"
DRIVER CAIRO/SVG
MIMETYPE "image/svg+xml"
IMAGEMODE RGB
EXTENSION "svg"
END
OUTPUTFORMAT
NAME "pdf"
DRIVER CAIRO/PDF
MIMETYPE "application/x-pdf"
IMAGEMODE RGB
EXTENSION "pdf"
END
OUTPUTFORMAT
NAME "GTiff"
DRIVER GDAL/GTiff
MIMETYPE "image/tiff"
IMAGEMODE RGB
EXTENSION "tif"
END
OUTPUTFORMAT
NAME "kml"
DRIVER KML
MIMETYPE "application/vnd.google-earth.kml.xml"
IMAGEMODE RGB
EXTENSION "kml"
END
OUTPUTFORMAT
NAME "kmz"
DRIVER KMZ
MIMETYPE "application/vnd.google-earth.kmz"
IMAGEMODE RGB
EXTENSION "kmz"
END
OUTPUTFORMAT
NAME "cairopng"
DRIVER CAIRO/PNG
MIMETYPE "image/png"
IMAGEMODE RGB
EXTENSION "png"
END
Provides a driver or format specific option. Zero or more FORMATOPTION statement may be present within a OUTPUTFORMAT declaration. (optional)
AGG/PNG: “COMPRESSION=n” is used to determine the ZLIB compression applied to the png creation. n is expected to be an integer value from 0 to 9, with 0 meaning no compression (not recommended), 1 meaning fastest compression, and 9 meaning best compression. The compression levels come at a cost (be it in terms of cpu processing or file size, chose the setting that suits you most). The default is COMPRESSION=6.
AGG/PNG supports quantizing from 24/32 bits to 8bits, in order to reduce the final image size (and therefore save bandwidth) (see also http://trac.osgeo.org/mapserver/ticket/2436#comment:4 for strategies when applying these options):
“PALETTE=/path/to/palette.txt” is used to define the absolute path where palette colors can be found. This file must contain 256 entries of r,g,b triplets for RGB imagemodes, or r,g,b,a quadruplets for RGBA imagemodes. The expected format is one triplet (or quadruplet) per line, each value separated by commas, and each triplet/quadruplet on a single line. If you want to use transparency with a palette, it is important to have these two colors in the palette file: 0,0,0,0 and 255,255,255,255.
Note
0,0,0,0 is important if you have fully transparent areas. 255,255,255,255 is opaque white. The important colors to have in your palette really depend on your actual map, although 0,0,0,0 , 0,0,0,255 , and 255,255,255,255 are very likely to show up most of the time.
CAIRO/PDF:
“GEO_ENCODING=ISO32000” or “GEO_ENCODING=OGC_BP”: Geospatial PDF will be generated. Requires GDAL 2.0 with PDF driver. See the GDAL Geospatial PDF documentation for requirements.
New in version 6.2.
“METADATA_ITEM:option=value”: Additional PDF options can be provided using the METADATA_ITEM prefix. The following options are available: AUTHOR, CREATOR, CREATION_DATE, KEYWORDS, PRODUCER, SUBJECT, TITLE.
New in version 6.2.
Example:
OUTPUTFORMAT
NAME pdf
DRIVER "CAIRO/PDF"
MIMETYPE "application/x-pdf"
IMAGEMODE RGB
EXTENSION "pdf"
FORMATOPTION "GEO_ENCODING=ISO32000"
FORMATOPTION "METADATA_ITEM:CREATOR=MapServer, with GDAL trunk"
FORMATOPTION "METADATA_ITEM:PRODUCER=MapServer, with GDAL trunk"
END
Selects the imaging mode in which the output is generated. Does matter for non-raster formats like Flash. Not all formats support all combinations. For instance GD supports only PC256. (optional)