.. _community_wpsrendereddownload: Rendered map/animation download processes ========================================= These processes allow download large maps and animations. The rendered download processes ------------------------------- The map and animation downloads work off a set of common parameters: * ``bbox`` : a geo-referenced bounding box, controlling both output area and desired projection * ``decoration`` : the name of a decoration layout to be added on top of the map * ``decorationEnvironment`` : a valid value for the ``env`` parameter used when painting the decoration. Used for :ref:`dynamic decoration layouts`. * ``time`` : a WMS ``time`` specification used to drive the selection of times across the layers in the map, and to control the frame generation in the animation * ``width`` and ``height`` : size of the output map/animation (and in combination with bounding box, also controls the output map scale) * ``layer``: a list of layer specifications, from a client side point of view (thus, a layer can be composed of multiple server side layers). When dwn:DecorationName layer option is used, it allows to define a specific layout that will be used when decorations are applied to the layer. It allows to render more than one Legend on the resulting image, when having more than one Layer declared. * ``headerheight`` : height size of a header space allocated at top of rendered map. It's an optional parameter, that forces to shrink the maps view height in order to avoid overlapping header over the maps. In combination with the use of layer specification options allows to group decorators at the top of resulting image. The layer specification ----------------------- A layer specification is a XML structure made of three parts: * Name: a comma separated list of layer names (eventually just one) * Capabilities: link to a capabilities document (optional, used when targetting remote WMS layers) * Parameter (key, value): an extra parameter to be added in the WMS request represented by this layer (e.g., ``elevation``, ``CQL_FILTER``, ``env``) * Opacity: an optional parameter, ranging from 0 to 100, that controls the layer image level of translucency during the merge process. When not set the layer image is fully opaque. Note that this is seperate from the overall map ``transparent`` boolean parameter. For example: .. code-block:: xml http://demo.geo-solutions.it/geoserver/ows?service=wms&version=1.1.1&request=GetCapabilities topp:states 1000000]]> 37 Decoration Layout ----------------- The ``decoration`` parameter specifies the file name (without extension) of the layout to be used to decorate the map. The layout is a list of decorators that should draw on top of the requested image. The decorators draw on the image one after the other, so the order of the decorators in the layout file is important: the first decorator output will appear under the others. Decorators are described in detail in the :ref:`wms_decorations` section. It is also possible to use :ref:`dynamic decoration layouts`, in this case the environment parameters for the decoration will be provided using ``dwn:Parameter``, e.g.: .. code-block:: xml theLayer theDynamicDecoration sla:top,right;bg:#FF0000 Map Download Process -------------------- In addition to the common parameters, the MapDownloadProcess sports an extra boolean parameter, ``transparent``, which can be either true or false, determining if the output map has a transparent or a solid background (animation lacks this parameter, as videos need solid background). The ``transparent`` parameter defaults to ``false`` [#f1]_. Also, unlike animation, in the map download process the ``time`` parameter is optional. The map download process uses the WMS machinery to produce the output, but it's not subject to the WMS service limits (width and height in this process can be limited using the WPS process security). Sample DownloadMap requests ++++++++++++++++++++++++++++ A download map issued against a set of local layers can look as follows: .. code-block:: xml gs:DownloadMap bbox 0.237 40.562 14.593 44.55 time 2008-10-31T00:00:00.000Z width 200 height 80 layer giantPolygon giantPolygon.0 layer watertemp result For this example the layers could have been a single one, with a "Name" equal to "giantPolygon,watertermp". Secondary output: map metadata ++++++++++++++++++++++++++++++ The process offers also a secondary output, called ``metadata``, which can be used to determine if there were any issue related to the requested times. The warnings are issued when the layer has a "nearest match" behavior activated, with an eventual search range. In case the requested time could not be matched exactly, a warning will be issued that might contain: - An indication that a nearby time has been used, and which time that is. - An indication that no time was found, that was sufficiently close to the requested one, according to the search range specification in the layer "nearest match" configuration. In order to get both outputs, the following response form is recommended, which requires a reference (a link) for the map, while the warnings are included inline: .. code-block:: xml gs:DownloadMap result metadata A sample response, reporting warnings, follows: .. code-block:: xml gs:DownloadMap Map Download Process Builds a large map given a set of layer definitions, area of interest, size and eventual target time. Process succeeded. result The output map metadata map metadata, including dimension match warnings sf:bmtime time 2004-02-01T00:00:00.000Z Nearest true Animation Download Process -------------------------- The download animation has all the basic parameters with the following variants/additions: * time: The time parameter is required and can be provided either as range with periodicity, ``start/stop/period``, or as a comma separated list of times,``t1,t2,...,tn`` * fps: Frame per seconds (defaults to one) Sample DownloadAnimation request ++++++++++++++++++++++++++++++++ A sample animation request can look as follows: .. code-block:: xml gs:DownloadAnimation bbox -180 -90 180 90 decoration formattedTimestamper time 2004-02-01,2004-03-01,2004-04-01,2004-05-01 width 271 height 136 fps 0.5 layer sf:bmtime result The ``formattedTimestamper`` decoration ensures the frame time is included in the output animation, and looks as follows: .. code-block:: xml Secondary output: animation metadata ++++++++++++++++++++++++++++++++++++ The process offers also a secondary output, called ``metadata``, which can be used to determine if there were any issue related to the requested times. The warnings are issued when the layer has a "nearest match" behavior activated, with an eventual search range. In case the requested time could not be matched exactly, a warning will be issued that might contain: - An indication that a nearby time has been used, and which time that is. - An indication that no time was found, that was sufficiently close to the requested one, according to the search range specification in the layer "nearest match" configuration. In order to get both outputs, the following response form is recommended, which requires a reference (a link) for the animation, while the warnings are included inline: .. code-block:: xml gs:DownloadAnimation result metadata A sample response, reporting warnings and the frame count where they happened, follows: .. code-block:: xml gs:DownloadAnimation Animation Download Process Builds an animation given a set of layer definitions, area of interest, size and a series of times for animation frames. Process succeeded. result The animation metadata Animation metadata, including dimension match warnings sf:bmtime time 2004-02-01T00:00:00.000Z Nearest 0 sf:bmtime time FailedNearest 1 sf:bmtime time 2004-04-01T00:00:00.000Z Nearest 2 sf:bmtime time 2004-05-01T00:00:00.000Z Nearest 3 true In the above output, frames 0, 2 and 3 were nearest matched to an available time, being specified in the ``Value`` field, while the time requested for frame number 1 was too far away from any available time, resulting in a ``NearestFail``. The frame is still present in the animation, but will likely be blank. In case multiple time based layers are requested in the animation, there might be multiple warnings for each frame. .. rubric:: Footnotes .. [#f1] The default value of ``transparent`` can be flipped using a system variable, e.g. ``-DDOWNLOAD_MAP_TRANSPARENT=true``