[mapserver-commits] r12672 - in trunk/docs/en: include mapcache

svn at osgeo.org svn at osgeo.org
Tue Oct 18 09:00:16 EDT 2011


Author: tbonfort
Date: 2011-10-18 06:00:16 -0700 (Tue, 18 Oct 2011)
New Revision: 12672

Added:
   trunk/docs/en/mapcache/formats.txt
Modified:
   trunk/docs/en/include/labels.inc
   trunk/docs/en/mapcache/caches.txt
   trunk/docs/en/mapcache/index.txt
   trunk/docs/en/mapcache/install.txt
Log:
add docs for geotiff creation support, and image formats



Modified: trunk/docs/en/include/labels.inc
===================================================================
--- trunk/docs/en/include/labels.inc	2011-10-18 11:56:28 UTC (rev 12671)
+++ trunk/docs/en/include/labels.inc	2011-10-18 13:00:16 UTC (rev 12672)
@@ -77,6 +77,10 @@
 	management                     :ref:`File Management <management>`
 	map                            :ref:`MAP <map>`
 	map_context                    :ref:`Map Context <map_context>`
+	mapcache_formats               :ref:`MapCache Image Formats <mapcache_formats>`
+	mapcache_jpeg_format           :ref:`MapCache JPEG Format <mapcache_jpeg_format>`
+	mapcache_png_format            :ref:`MapCache PNG Format <mapcache_png_format>`
+	mapcache_mixed_format          :ref:`MapCache Mixed PNG+JPEG Format <mapcache_mixed_format>`
 	mapcache_caches                :ref:`MapCache Cache Backends <mapcache_caches>`
 	mapcache_grids                 :ref:`MapCache Tile Grids <mapcache_grids>`
 	mapcache_cache_sqlite          :ref:`MapCache Sqlite Caches <mapcache_cache_sqlite>`

Modified: trunk/docs/en/mapcache/caches.txt
===================================================================
--- trunk/docs/en/mapcache/caches.txt	2011-10-18 11:56:28 UTC (rev 12671)
+++ trunk/docs/en/mapcache/caches.txt	2011-10-18 13:00:16 UTC (rev 12672)
@@ -195,7 +195,7 @@
 
 .. _mapcache_cache_tiff:
 
-TIFF Caches
+(Geo)TIFF Caches
 --------------------------------------------------------------------------------
 
 TIFF caches are the most recent addition to the family of caches, and use the 
@@ -209,15 +209,18 @@
 raster formats, and be served up with high performance for tile access.
 
 The TIFF cache should be considered read-only for the time being. Write access
-is already possible but not ready for production, and is missing basic
-functionality (such as choosing the JPEG compression level, or adding the
-geotiff referencing).
+is already possible but should be considered experimental as there might be
+some file corruption issues, notably on network file-systems. Note that until
+all the tiles in a given tiff file have been seeded/created, the TIFF file is
+said to be "sparse" in the sense that it is missing a number of jpeg tiles. As
+such most non-gdal based programs will have problems opening these incomplete
+files.
 
 Note that the tiff tile structure must
 exactly match the structure of the grid used by the tileset, and the tif file
 names must follow strict naming rules.
 
-There are three parameters to configure a TIFF cache:
+There are three mandatory parameters to configure a TIFF cache:
 
 - <xcount> the number of tiles stored along the x (horizontal) direction of
   the TIFF file.
@@ -242,16 +245,54 @@
   {inv_y} and {inv_div_y} will find some usage for people who prefer to index
   their TIFF files from top to bottom rather than bottom to top.
 
+An additional optional parameter defines which JPEG compression should be 
+applied to the tiles when saved into the TIFF file:
 
+- <format> the name of the (jpeg) format to use
+
+.. seealso:: :ref:`mapcache_jpeg_format`
+
 .. code-block:: xml
 
    <cache name="tiff" type="tiff">
       <template>/data/tiffs/{tileset}/{grid}/L{z}/R{inv_y}/C{x}.tif</template>
       <xcount>64</xcount>
       <ycount>64</ycount>
+      <format>myjpeg</format>
    </cache>
 
 In this example, assuming a grid using 256x256 tiles, the files that are read
 to load the tiles are tiled TIFFs with jpeg compression, who's size are
 16384x16384. The number of files to store on disk is thus reduced 4096 times
 compared to the basic disk cache.
+
+
+If compiled with GeoTiff and write support, MapCache will add referencing
+information to the TIFF files it creates, so that the TIFF files can be used
+in any geotiff- enabled software. Write support does not produce full geotiffs
+with the definition of the projection used, but only the pixel scale and
+tie-points, i.e.  what is usually found in .tfw files.
+
+For reference, here is the gdalinfo output on a TIFF file created by MapCache
+when compiled with geotiff support:
+
+::
+
+   LOCAL_CS["unnamed",
+       UNIT["metre",1,
+           AUTHORITY["EPSG","9001"]]]
+   Origin = (-20037508.342789247632027,20037508.342789247632027)
+   Pixel Size = (156543.033928040997125,-156543.033928040997125)
+   Metadata:
+     AREA_OR_POINT=Area
+   Image Structure Metadata:
+     COMPRESSION=YCbCr JPEG
+     INTERLEAVE=PIXEL
+     SOURCE_COLOR_SPACE=YCbCr
+   Corner Coordinates:
+   Upper Left  (-20037508.343,20037508.343) 
+   Lower Left  (-20037508.343,-20037508.343) 
+   Upper Right (20037508.343,20037508.343) 
+   Lower Right (20037508.343,-20037508.343) 
+   Center      (   0.0000000,   0.0000000)
+

Copied: trunk/docs/en/mapcache/formats.txt (from rev 12671, trunk/docs/en/mapcache/featureinfo.txt)
===================================================================
--- trunk/docs/en/mapcache/formats.txt	                        (rev 0)
+++ trunk/docs/en/mapcache/formats.txt	2011-10-18 13:00:16 UTC (rev 12672)
@@ -0,0 +1,80 @@
+.. _mapcache_formats:
+
+********************************************************************************
+Image Formats
+********************************************************************************
+
+:Author: Thomas Bonfort
+:Contact: tbonfort at terriscope.fr
+
+MapCache allows you to configure how the image should be saved to a cache once
+it has been requested from a source. The JPEG format should mostly be used for
+raster imagery, whereas the PNG format is most usefull for vector based imagery
+where there are large uniform areas.
+
+.. _mapcache_jpeg_format:
+
+JPEG Format
+--------------------------------------------------------------------------------
+
+The JPEG format saves tiles to jpeg, you can configure the JPEG compression
+level (from 1 to 100) and the colorspace that should be used (rgb or ycbcr)
+
+.. code-block:: xml
+   
+   <format name="myjpeg" type="JPEG">
+      <quality>85</quality>
+      <photometric>ycbcr</photometric>
+   </format>
+
+- *quality*: this is the typical jpeg quality setting. Values under 50 produce
+  lighter images but with notable compression artifacts. 100 should be avoided
+  as it produces very heavy images
+- *photometric*: By default the YCbCr colorspace is used as it produces images
+  that tend to be 2 to 3 times lighter. Use rgb if you don't want the default.
+
+.. _mapcache_png_format:
+
+PNG Format
+--------------------------------------------------------------------------------
+
+The PNG format creates PNG images, with optional quantization (reduction of
+the number of colors to create an 8bit paletted PNG)
+
+.. code-block:: xml
+   
+   <format name="mypng" type="PNG">
+      <compression>fast</compression>
+      <colors>256</colors>
+   </format>
+
+- *compression*: choose which zlib compression to apply to the image data.
+  Recognized values are "fast" and "best". Omit the key to use the default
+  zlib compression.
+- *colors*: number of colors to use for quantization. Ommit this key to
+  produce 24 or 32 bit RGB/RGBA pngs, or set to a value between 2 and 256
+  to create an 8-bit paletted png. The quantization step is destructive, 
+  there is no guarantee that pixels will not have a noticable shift in color
+  in the case when the tile contains many colors.
+
+.. _mapcache_mixed_format:
+
+Mixed Format
+--------------------------------------------------------------------------------
+
+There is a third special format which mixes JPEG and PNG compression depending
+on the contents of the image. This format allows to create caches for raster
+imagery using JPEG compression (which is more efficient) on zones with imagery
+data, and PNG compression (which supports trasnparency) on zones with no 
+imagery or on a boundary between imagery and emptiness.
+
+.. code-block:: xml
+   
+   <format name="mymixed" type="MIXED">
+      <opaque>myjpeg</opaque>
+      <transparent>mypng</transparent>
+   </format>
+
+- *opaque*: the format to use when the image has only fully opaque pixels
+- *transparent*: the format to use if when the image has some transparent or
+  semi-opaque pixels.

Modified: trunk/docs/en/mapcache/index.txt
===================================================================
--- trunk/docs/en/mapcache/index.txt	2011-10-18 11:56:28 UTC (rev 12671)
+++ trunk/docs/en/mapcache/index.txt	2011-10-18 13:00:16 UTC (rev 12672)
@@ -20,6 +20,7 @@
    services
    seed
    caches
+   formats
    dimensions
    grids
    featureinfo

Modified: trunk/docs/en/mapcache/install.txt
===================================================================
--- trunk/docs/en/mapcache/install.txt	2011-10-18 11:56:28 UTC (rev 12671)
+++ trunk/docs/en/mapcache/install.txt	2011-10-18 13:00:16 UTC (rev 12672)
@@ -369,7 +369,17 @@
    :ref:`mapcache_cache_tiff`
 
 
+When writing TIFF files, mapcache can also optionally add georeferencing
+information if compiled with libtiff support. GeoTiff writing does not 
+produce the full tags needed for defining which preojection the grid is
+in, but will only produce those defining the pixel scale and the tiepoints
+(i.e. the equivalent information found in the accompanying .tfw files)
 
+.. code-block:: bash
+
+   --enable-geotiff[=yes|no|/path/to/libgeotiffprefix]
+    
+
 Native MapServer Mode
 ================================================================================
 



More information about the mapserver-commits mailing list