XMP Metadata Support¶
New in version 6.2.
XMP is the “extensible metadata platform” which allows the embedding of metadata information across a wide range of document and image formats: PNG, GIF, JPEG, PDF, etc. XMP was originally developed by Adobe and is supported across their product line. It is now being increasingly included in other standards for metadata embedding and supported by tools for viewing image information (e.g. exiftools).
Because XMP is generic and extensible, any metadata can be embedded in it. Creative Commons has standards for using XMP to embed commons licensing in images and other documents, including a specific Creative Commons schema. There is also a standard schema for Dublin Core metadata.
In order to use XMP metadata you will need to
ensure that XMP support is built into MapServer.
You can test for XMP support in an existing mapserv program by running mapserver -v and looking for SUPPORTS=XMP in the return line.
use the GDAL output driver to produce your images.
To build MapServer with XMP support, you will need to first install the exempi library on your system.
Download libexempi from http://libopenraw.freedesktop.org/wiki/Exempi
Configure MapServer using the –with-exempi option, and re-build
To use the GDAL output driver, for each format you want to output you will need to set up an OUTPUTFORMAT that uses the GDAL driver. Here is an example of a GDAL output for PNG images:
OUTPUTFORMAT NAME png DRIVER "GDAL/PNG" MIMETYPE "image/png" IMAGEMODE RGB EXTENSION "png" END
For more examples of GDAL output formats, see the OUTPUTFORMAT reference.
Using XMP Metadata¶
There can be one XMP package per image, so the XMP metadata for a map is set in the top level of the map file, in the WEB object’s METADATA section.
The METADATA key for each XMP entry is of the form xmp_<namespace>_<tag>, so for example setting just the Dublin Core “Title” would look like:
WEB METADATA "xmp_dc_Title" "Super Map" END END
Note that the Dublin Core schema is specified using the code “dc”, and the tag is specified using the fully spelled out tag name (“Title”). The following schema codes are supported by default:
“meta” which is the standard XMP tag set
“cc” which is the Creative Commons tag set
“dc” which is the Dublin Core tag set
“rights” which is the standard XMP Rights tag set
“exif” which is the EXIF tags set
“tiff” which is the TIFF tags set
“crs” which is the Photoshop Camera Raw Schema
“photoshop” which is the Photoshop tag set
For a listing of the valid tags within each namespace, see http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/XMP.html.
Here is an example of setting several tags using the default namespaces:
WEB METADATA "xmp_rights_Marked" "true" "xmp_cc_License" "http://creativecommons.org/licenses/by-sa/2.0/" "xmp_cc_AttributionURL" "http://www.landgate.wa.gov.au/corporate.nsf/web/About+Us" "xmp_cc_AttributionName" "Landgate (landgate.wa.gov.au)" END END
It is also possible to define a new namespace and place any tags you like within it. Here is an example:
WEB METADATA "xmp_lightroom_namespace" "http://ns.adobe.com/lightroom/1.0/" "xmp_lightroom_PrivateRTKInfo" "My Information Here" END END
The first tag, of the form “xmp_<namespace>_namespace” defines the unique URI for the XML namespace, which will be declared in the XMP document. The following tags can then reference the namespace the same way they reference the default namespaces.