pgraster.rst 4.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. .. _community_pgraster:
  2. PGRaster
  3. ========
  4. The PGRaster geoserver module adds the ability to simplify the configuration of a PostGis Raster based ImageMosaic-JDBC store.
  5. Before proceeding, make sure to take a look to the :geotools:`PostGis Raster plugin documentation
  6. <library/coverage/pgraster.html>` for background information. Note that configuration files, table creations and raster imports explained in that documentation, will be automatically handled by this module.
  7. **This module allows to do the following steps automatically:**
  8. #. use raster2pgsql (optionally) to import raster tiles previously configured with gdal_retile
  9. #. create a metadata table (optionally) referring to tiles tables created through raster2pgsql
  10. #. create the imageMosaic JDBC XML configuration containing PostGis database connection parameters, attributes mapping and coverage configuration.
  11. #. configure the imageMosaic JDBC on top of the newly configured XML.
  12. Requirements
  13. ------------
  14. * You must have a PostGIS 2.0 database where your raster tiles will be stored.
  15. * Raster tiles should have been previously created using ``gdal_retile`` since this module will simply import them and configure the store. The ImageMosaic JDBC setup example documentation provides :geotools:`examples <library/coverage/jdbc/prepare.html>` of how to do that.
  16. * In case you want to perform automatic import of the raster tiles into the database, you need to have raster2pgsql and psql executables installed on your machine and configured on your ``PATH``. (In case your PostGIS 2.0 installation is on the same machine where you will run GeoServer, the executables should be already available).
  17. Installation
  18. ------------
  19. #. Download the pgraster community module for your version of GeoServer from the `pre 2.20 download page <https://build.geoserver.org/geoserver/master/community-latest/>`_
  20. or from the `2.20+ download page <https://build.geoserver.org/geoserver/main/community-latest/>`_.
  21. #. Unzip the archive into the WEB-INF/lib directory of the GeoServer installation.
  22. .. note:: On Windows, make sure to add a ``RASTER2PGSQL_PATH=Drive:\Path\to\bin\folder\containing_raster2pgsqlExecutable`` property to the ``JAVA_OPTS`` as an instance: ``JAVA_OPTS=-DRASTER2PGSQL_PATH=C:\work\programs\PostgreSQL\9.2\bin``
  23. #. Restart GeoServer.
  24. Usage
  25. -----
  26. #. As for any other store configuration, go to Stores->Add new Store
  27. #. Select ImageMosaicJDBC. You will see the usual "Add Raster Data Source" form.
  28. .. figure:: imagemosaicjdbcstore.png
  29. For backward compatibility, you may still configure an ImageMosaicJDBC in the old-way, by specifying the URL of a valid
  30. XML configuration file, as done in the past (Where all the components of the ImageMosaicJDBC need to be configured by hand by the user).
  31. #. Notice the presence of a checkBox which allows to proceed with the PGRaster automatic configuration parameters specification.
  32. Once Clicking on it, you will see a set of new parameters for the automatic configuration step. When enabling that checkBox, the URL parameter needs to point to the main folder containing the rasters which have been previously produced using gdal_retile.
  33. .. figure:: pgrasterparams.png
  34. Other parameters are explained below:
  35. .. list-table::
  36. :widths: 40 80
  37. :header-rows: 1
  38. * - Name
  39. - Description
  40. * - PostGIS server
  41. - The PostGIS server IP
  42. * - PostGIS port
  43. - The PostGIS server port
  44. * - User
  45. - The PostGIS DB user
  46. * - Password
  47. - The PostGIS DB password
  48. * - Database
  49. - The PostGIS Database (should have already been created)
  50. * - Schema
  51. - The schema where the table will be created (default is public. The schema need to be already defined into the Database before the import)
  52. * - Table
  53. - The name of the metadata table which contains all the references to
  54. * - File extension
  55. - The extension of the raster files to be imported (such as ``png``). It may not be specified when raster tiles have been already manually imported into the database by the user
  56. * - raster2pgsql import options
  57. - The raster2pgsql script importing options (as an instance "-t 128x128" for raster tiles of 128x128). It may not be specified when raster tiles have been already manually imported into the database by the user
  58. * - EPSG Code
  59. - The EPSG code which will be configured in the coverage configuration xml. (Default is 4326)
  60. Limitations
  61. -----------
  62. Right now it doesn't allow to import data folders which have been created with the gdal_retile's ``useDirForEachRow`` option.