GeoPackage WPS Process ====================== A custom GeoPackage can be created with any number of tiles and features layers using the ``GeoPackage`` WPS Process (see :ref:`wps_processes`). .. warning:: While the process generates a compliant GeoPackage, some abilities like generalization, style and part of the metadata export are based on unofficial extensions discussed in the `Testbed 16 GeoPackage engineering report `_. The WPS process takes in one parameter: ``contents`` which is an XML schema that represents the desired output. General outline of a ``contents`` scheme: .. code-block:: xml describe the layer EPSG:4216 -180 -90 180 90 describe the layer .. .. Each GeoPackage has a mandatory ``name``, which will be the name of the file (with the extension .gpkg added). Each layer (features or tiles) has the following properties: * ``name`` (mandatory): the name of the layer in the GeoPackage; * ``identifier`` (optional): an identifier for the layer; * ``description`` (optional): a description for the layer; * ``srs`` ( mandatory for tiles, optional for features): coordinate reference system; for features the default is the SRS of the feature type; * ``bbox`` ( mandatory for tiles, optional for features): the bounding box; for features the default is the bounding box of the feature type. Outline of the features layer: .. code-block:: xml .. .. .. myfeaturetype property1, property2 .. true true true ... theGeom Each features layer has the following properties: * ``featuretype`` (mandatory): the feature type * ``propertynames`` (optional): list of comma-separated names of properties in feature type to be included (default is all properties) * ``filter`` (optional): any OGC filter that will be applied on features before output * ``indexed`` (optional): include spatial indexes in the output (true/false) * ``styles`` (optional): include styles in the output (true/false). The exported structure uses the portrayal and semantic annotation extensions, as described in `Testbed 16 E/R `_ * ``metadata`` (optional): embed metadata referred by the layer metadata links into the GeoPackage (true/false). The base metadata tables are filled with contents, while semantic annotations might be used to add extra information about the metadata itself. * ``overviews`` (optional): adds overview tables that can speed up rendering. See more at :ref:`overviews` * ``sort`` (optional): a filter encoding ``fes:SortByType`` which allows sorting the table contents on one or more attributes. If the chosen attribute is a geometry, the table will be sorted on its GeoHash, `improving access locality `_ when using spatial indexes. Outline of the tiles layer: .. code-block:: xml ... .. .. layer1, layer2 style1, style2 path/to/file.sld .. mime/type ffffff true 5 50 6 60 7 70 ... value Each tiles layer has the following properties: * ``layers`` (mandatory): comma-separated list of layers that will be included * ``styles``, ``sld``, and ``sldbody`` are mutually exclusive, having one is mandatory * ``styles``: list of comma-separated styles to be used * ``sld``: path to SLD style file * ``sldbody``: inline SLD style file * ``format`` (optional): mime-type of image format of tiles (image/png or image/jpeg) * ``bgcolor`` (optional): background colour as a six-digit hexadecimal RGB value * ``transparent`` (optional): transparency (true or false) * ``coverage`` (optional) * ``minzoom``, ``maxzoom``, ``minColumn``, ``maxColumn``, ``minRow``, ``maxRow`` (all optional): set the minimum and maximum zoom level, column, and rows * ``gridset`` (optional): see below * ``parameters`` (optional): list of other parameters that can be used in a GetMap to produce tiles (open to all GeoServer vendor parameters) Gridset can take on two possible (mutually exclusive) forms: .. code-block:: xml mygridset where the ``name`` of a known gridset is specified; or a custom gridset may be defined as follows: .. code-block:: xml 1 256 256 4 4 0.17 0.17 ... .. _overviews: Creating generalized tables ^^^^^^^^^^^^^^^^^^^^^^^^^^^ The process can create generalized tables, as described in `Testbed 16 generalized tables extension `_. Generalized tables are sidecar tables that typically contain less records than the original table, with the option to also generalize their geometry. These are created by adding a list of ``overview`` directives in a feature layer description, each one containing: * ``name`` (mandatory): the generalized table name * ``distance`` (optional): the generalization distance to create simplified geometries * ``scaleDenominator``: the scale denominator at which the table starts being used, in preference to the original table, and other tables with a lower scale denominator value * ``filter`` (optional): an OGC filter removing features that are not meant to be rendered at the target scale denominator Here is an example: .. code-block:: xml woodland EPSG:27700 oszoom:woodland true true woodland_g1 80000 type National type Regional woodland_g2 320000 type National