output.rst 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. GeoPackage WPS Process
  2. ======================
  3. A custom GeoPackage can be created with any number of tiles and features layers using the ``GeoPackage`` WPS Process (see :ref:`wps_processes`).
  4. .. warning:: While the process generates a compliant GeoPackage, some abilities like generalization, style and part of the metadata export
  5. are based on unofficial extensions discussed in the `Testbed 16 GeoPackage engineering report <http://docs.opengeospatial.org/per/20-019r1.html>`_.
  6. The WPS process takes in one parameter: ``contents`` which is an XML schema that represents the desired output.
  7. General outline of a ``contents`` scheme:
  8. .. code-block:: xml
  9. <geopackage name="mygeopackage" xmlns="http://www.opengis.net/gpkg">
  10. <features name="myfeaturelayer" identifier="L01">
  11. <description>describe the layer</description>
  12. <srs>EPSG:4216</srs>
  13. <bbox>
  14. <minx>-180</minx>
  15. <miny>-90</miny>
  16. <maxx>180</maxx>
  17. <maxy>90</maxy>
  18. </bbox>
  19. <!-- ... -->
  20. </features>
  21. <tiles name="mytileslayer" identifier="L02">
  22. <description>describe the layer</description>
  23. <srs>..</srs>
  24. <bbox>..</bbox>
  25. <!-- ... -->
  26. </tiles>
  27. </geopackage>
  28. Each GeoPackage has a mandatory ``name``, which will be the name of the file (with the extension .gpkg added).
  29. Each layer (features or tiles) has the following properties:
  30. * ``name`` (mandatory): the name of the layer in the GeoPackage;
  31. * ``identifier`` (optional): an identifier for the layer;
  32. * ``description`` (optional): a description for the layer;
  33. * ``srs`` ( mandatory for tiles, optional for features): coordinate reference system; for features the default is the SRS of the feature type;
  34. * ``bbox`` ( mandatory for tiles, optional for features): the bounding box; for features the default is the bounding box of the feature type.
  35. Outline of the features layer:
  36. .. code-block:: xml
  37. <features name="myfeaturelayer" identifier="L01">
  38. <description>..</description>
  39. <srs>..</srs>
  40. <bbox>..</bbox>
  41. <featuretype>myfeaturetype</featuretype>
  42. <propertynames>property1, property2</propertynames>
  43. <filter>..</filter>
  44. <indexed>true</indexed>
  45. <styles>true</styles>
  46. <metadata>true</metadata>
  47. <overviews>...</overviews>
  48. <sort xmlns:fes="http://www.opengis.net/fes/2.0">
  49. <fes:SortProperty>
  50. <fes:ValueReference>theGeom</fes:ValueReference>
  51. </fes:SortProperty>
  52. </sort>
  53. </features>
  54. Each features layer has the following properties:
  55. * ``featuretype`` (mandatory): the feature type
  56. * ``propertynames`` (optional): list of comma-separated names of properties in feature type to be included (default is all properties)
  57. * ``filter`` (optional): any OGC filter that will be applied on features before output
  58. * ``indexed`` (optional): include spatial indexes in the output (true/false)
  59. * ``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 <http://docs.opengeospatial.org/per/20-019r1.html#_portrayal>`_
  60. * ``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.
  61. * ``overviews`` (optional): adds overview tables that can speed up rendering. See more at :ref:`overviews`
  62. * ``sort`` (optional): a filter encoding ``fes:SortByType`` which allows sorting the table contents on one or more attributes. If the chosen attribute
  63. is a geometry, the table will be sorted on its GeoHash, `improving access locality <http://docs.opengeospatial.org/per/20-019r1.html#record_sorting>`_
  64. when using spatial indexes.
  65. Outline of the tiles layer:
  66. .. code-block:: xml
  67. <tiles name="mytileslayer" identifier="L02">
  68. <description>...</description>
  69. <srs>..</srs>
  70. <bbox>..</bbox>
  71. <layers>layer1, layer2</styles>
  72. <styles>style1, style2</styles>
  73. <sld>path/to/file.sld</sld>
  74. <sldBody>..</sldBody>
  75. <format>mime/type</format>
  76. <bgcolor>ffffff</bgcolor>
  77. <transparent>true</transparent>
  78. <coverage>
  79. <minZoom>5</minZoom>
  80. <maxZoom>50</maxZoom>
  81. <minColumn>6</minColumn>
  82. <maxColumn>60</maxColumn>
  83. <minRow>7</minRow>
  84. <maxRow>70</maxRow>
  85. </coverage>
  86. <gridset>
  87. ...
  88. </gridset>
  89. <parameters>
  90. <parameter name="...">value</parameter>
  91. <parameters>
  92. </tiles>
  93. Each tiles layer has the following properties:
  94. * ``layers`` (mandatory): comma-separated list of layers that will be included
  95. * ``styles``, ``sld``, and ``sldbody`` are mutually exclusive, having one is mandatory
  96. * ``styles``: list of comma-separated styles to be used
  97. * ``sld``: path to SLD style file
  98. * ``sldbody``: inline SLD style file
  99. * ``format`` (optional): mime-type of image format of tiles (image/png or image/jpeg)
  100. * ``bgcolor`` (optional): background colour as a six-digit hexadecimal RGB value
  101. * ``transparent`` (optional): transparency (true or false)
  102. * ``coverage`` (optional)
  103. * ``minzoom``, ``maxzoom``, ``minColumn``, ``maxColumn``, ``minRow``, ``maxRow`` (all optional): set the minimum and maximum zoom level, column, and rows
  104. * ``gridset`` (optional): see below
  105. * ``parameters`` (optional): list of other parameters that can be used in a GetMap to produce tiles (open to all GeoServer vendor parameters)
  106. Gridset can take on two possible (mutually exclusive) forms:
  107. .. code-block:: xml
  108. <gridset>
  109. <name>mygridset</name>
  110. </gridset>
  111. where the ``name`` of a known gridset is specified; or a custom gridset may be defined as follows:
  112. .. code-block:: xml
  113. <gridset>
  114. <grids>
  115. <grid>
  116. <zoomlevel>1</zoomlevel>
  117. <tileWidth>256</tileWidth>
  118. <tileHeight>256</tileHeight>
  119. <matrixWidth>4</matrixWidth>
  120. <matrixHeight>4</matrixHeight>
  121. <pixelXSize>0.17</pixelXSize>
  122. <pixelYSize>0.17</pixelYSize>
  123. </grid>
  124. <grid>...</grid>
  125. <!-- ... -->
  126. </grids>
  127. </gridset>
  128. .. _overviews:
  129. Creating generalized tables
  130. ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  131. The process can create generalized tables, as described in `Testbed 16 generalized tables
  132. extension <http://docs.opengeospatial.org/per/20-019r1.html#im_generalized_tables_extension>`_.
  133. Generalized tables are sidecar tables that typically contain less records than the original
  134. table, with the option to also generalize their geometry. These are created by adding
  135. a list of ``overview`` directives in a feature layer description, each one containing:
  136. * ``name`` (mandatory): the generalized table name
  137. * ``distance`` (optional): the generalization distance to create simplified geometries
  138. * ``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
  139. * ``filter`` (optional): an OGC filter removing features that are not meant to be rendered at the target scale denominator
  140. Here is an example:
  141. .. code-block:: xml
  142. <features name="woodland" identifier="woodland">
  143. <description>woodland</description>
  144. <srs>EPSG:27700</srs>
  145. <featuretype>oszoom:woodland</featuretype>
  146. <indexed>true</indexed>
  147. <styles>true</styles>
  148. <overviews>
  149. <overview>
  150. <name>woodland_g1</name>
  151. <scaleDenominator>80000</scaleDenominator>
  152. <filter xmlns:fes="http://www.opengis.net/fes/2.0">
  153. <fes:Or>
  154. <fes:PropertyIsEqualTo>
  155. <fes:ValueReference>type</fes:ValueReference>
  156. <fes:Literal>National</fes:Literal>
  157. </fes:PropertyIsEqualTo>
  158. <fes:PropertyIsEqualTo>
  159. <fes:ValueReference>type</fes:ValueReference>
  160. <fes:Literal>Regional</fes:Literal>
  161. </fes:PropertyIsEqualTo>
  162. </fes:Or>
  163. </filter>
  164. </overview>
  165. <overview>
  166. <name>woodland_g2</name>
  167. <scaleDenominator>320000</scaleDenominator>
  168. <filter xmlns:fes="http://www.opengis.net/fes/2.0">
  169. <fes:PropertyIsEqualTo>
  170. <fes:ValueReference>type</fes:ValueReference>
  171. <fes:Literal>National</fes:Literal>
  172. </fes:PropertyIsEqualTo>
  173. </filter>
  174. </overview>
  175. </overviews>
  176. </features>