usage.rst 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. .. _geopkgoutput.usage:
  2. Using the GeoPackage Output Extension
  3. -------------------------------------
  4. The GeoPackage Output Extension adds support to WFS and WMS to request ``GetFeature`` and ``GetMap`` results in GeoPackage Format.
  5. WFS
  6. ^^^
  7. Add ``&outputFormat=geopkg`` to your request. The result will be a GeoPackage (MIME type ``application/geopackage+sqlite3``) containing the requested features.
  8. .. code-block::
  9. curl "http://localhost:8080/geoserver/wfs?service=wfs&version=2.0.0&request=GetFeature&typeNames=ws:layername&outputFormat=geopkg" \
  10. -o wfs.gpkg
  11. You can use `geopkg`, `geopackage`, or `gpkg` as the output format in the request. Use `1.0.0`, `1.1.0`, or `2.0.0` as ``version=`` to specify which WFS version to use.
  12. .. note::
  13. GeoPackages always have the ordinates in X,Y (``EAST_NORTH``) format.
  14. WFS Output Configuration
  15. ^^^^^^^^^^^^^^^^^^^^^^^^
  16. GeoPackage output format configuration properties are available. For information on use of configuration properties see :ref:`running in a production environment <production_config>` instructions.
  17. geopackage.wfs.indexed
  18. ''''''''''''''''''''''
  19. By default a spatial index is generated when generating GeoPackage output.
  20. Use java system property ``-Dgeopackage.wfs.indexed=false`` to suppress the generation of a spatial index in generated geopackage output.
  21. geopackage.wfs.tempdir
  22. ''''''''''''''''''''''
  23. The GeoPackage file format is an SQLite database which can only be managed as a file locally. To produce a GeoPackage GeoServer makes use of a temporary file created in ``java.io.tmpdir`` location. This temporary file is removed once the response is completed.
  24. Some container environments recommend use of a network share for their ``java.io.tmpdir`` location. This approach is not compatible with SQLite database driver which requires a local disk location and file lock.
  25. To override the temporary file location used for GeoPackage output format file generation use property ``-Dgeopackage.wfs.tempdir=<path location>`` to provide an alternate path.
  26. WMS
  27. ^^^
  28. Add ``&format=geopkg`` to your request. The result will be a GeoPackage (MIME type `application/geopackage+sqlite3`) containing the requested tiles.
  29. Using WMS 1.1.0 to access tiled image geopkg:
  30. .. code-block::
  31. curl "http://localhost:8080/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=ws:layername&bbox=-123.43670607166865%2C48.3956835%2C-123.2539813%2C48.5128362547052&width=1536&height=984&srs=EPSG%3A4326&styles=&format=geopkg" \
  32. -o wms.gpkg
  33. Using WMS 1.3.0 to access tiled image geopkg:
  34. .. code-block::
  35. curl "http://localhost:8080/geoserver/wms?service=WMS&version=1.3.0&request=GetMap&layers=ws:layername&bbox=48.3956835,-123.43670607166865,48.5128362547052,-123.2539813&width=768&height=492&srs=EPSG%3A4326&styles=&format=geopkg" \
  36. -o wms.gpkg
  37. You can use ``format=geopkg``, ``format=geopackage``, or ``format=gpkg`` as the output format in the request. Use WMS ``version=1.1.0``, or ``version=1.3.0`` to specify which WMS version to use, keeping in mind axis order for ``bbox`` differences.
  38. .. note::
  39. Regardless of WMS axis order used for ``bbox`` the resulting GeoPackages always have the ordinates in X,Y (``EAST_NORTH``) order as required by the specification.
  40. WMS Format options
  41. ''''''''''''''''''
  42. You can also add format options (``format_options=param1:value1;param2:value2;...``) to the request. With all default values, you will get a GeoPackage with PNG tiles of multiple resolutions. There will be a little more than 255 total tiles - all occupying the area in the request's bbox.
  43. .. list-table:: Format Options
  44. :widths: auto
  45. :header-rows: 1
  46. * - Parameter
  47. - Description
  48. * - min_zoom
  49. - Grid Zoom level for tiles to start.
  50. default: zoom level based on a single tile covering the bbox area.
  51. * - max_zoom
  52. - Grid Zoom level for tiles to end.
  53. default: zoom where there's >255 tiles in total in the geopkg (could be a bit more)
  54. * - num_zooms
  55. - Number of zoom levels in the geopkg.
  56. If present then `max_zoom = min_zoom + num_zooms`
  57. * - format
  58. - Format for the image tiles in the geopkg.
  59. default: PNG
  60. * - tileset_name
  61. - Name of tile set ("layer") used in the geopkg.
  62. default: based on the layer names given in the request ('_' separated)
  63. * - min_column
  64. - First column number (from the gridset) to use.
  65. default: use request bbox to determine which tiles to produce
  66. * - max_column
  67. - Last column number (from the gridset) to use.
  68. default: use request bbox to determine which tiles to produce
  69. * - min_row
  70. - First row number (from the gridset) to use.
  71. default: use request bbox to determine which tiles to produce
  72. * - max_row
  73. - Last row number (from the gridset) to use.
  74. default: use request bbox to determine which tiles to produce
  75. * - gridset
  76. - Name of the gridset (from GWC GridSetBroker) to uses.
  77. default: find based on request SRS
  78. * - flipy
  79. - Do NOT set.
  80. default: TRUE (required for GeoPackage - `The tile coordinate (0,0) always refers to the tile in the upper left corner of the tile matrix...`)