imagemosaic_time-elevationseries.rst 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. .. _tutorial_imagemosaic_timeelevationseries:
  2. Using the ImageMosaic plugin for raster with time and elevation data
  3. ====================================================================
  4. Introduction
  5. ------------
  6. This tutorial is the following of :ref:`tutorial_imagemosaic_timeseries` and explains how manage an ImageMosaic using both **Time** and **Elevation** attributes.
  7. The dataset used is a set of raster images used in weather forecast, representing the temperature in a certain zone at different times and elevations.
  8. All the steps explained in chapter *Configurations* of :ref:`data_imagemosaic` section are still the same.
  9. This tutorial explains just how to configure the **elevationregex.properties** that is an additional configuration file needed, and how to modify the **indexer.properties**.
  10. The dataset used is different so also a fix to the **timeregex.properties** used in the previous tutorial is needed.
  11. Will be shown also how query GeoServer asking for layers specifying both time and elevation dimensions.
  12. The dataset used in the tutorial can be downloaded :download:`Here <temperatureLZWdataset.zip>`
  13. Configuration examples
  14. ----------------------
  15. The additional configurations needed in order to handle also the elevation attributes are:
  16. * Improve the previous version of the *indexer.properties* file
  17. * Add the *elevationregex.properties file* in order to extract the elevation dimension from the filename
  18. indexer.properties:
  19. """""""""""""""""""
  20. Here the user can specify the information that needs GeoServer for creating the table in the database.
  21. In this case the time values are stored in the column ingestion as shown in the previous tutorial but now is mandatory specify the elevation column too.
  22. .. literalinclude:: src/indexerWithElevation.properties
  23. elevationregex.properties:
  24. """"""""""""""""""""""""""
  25. Remember that every tif file must follow this naming convention::
  26. {coveragename}_{timestamp}_[{elevation}].tif
  27. As in the timeregex property file the user must specify the pattern that the elevation in the file name looks like. In this example it consists of 4 digits, a dot '.' and other 3 digits.
  28. an example of filename, that is used in this tutorial is::
  29. gfs50kmTemperature20130310T180000000Z_0600.000_.tiff
  30. The GeoServer ImageMosaic plugin scans the filename and search for the first occurrence that match with the pattern specified. Here the content of **elevationregex.properties**:
  31. .. literalinclude:: src/elevationregex.properties
  32. timeregex.properties:
  33. """"""""""""""""""""""""""
  34. As you can see the time in this dataset is specified as ISO8601 format::
  35. 20130310T180000000Z
  36. Instead of the form **yyyymmdd** as in the previous tutorial. So the regex to specify in timeregex.properties is:
  37. .. literalinclude:: src/timeregexForElevation.properties
  38. Coverage based on filestore
  39. ---------------------------
  40. Once the mosaic configuration is ready the store mosaic could be loaded on GeoServer.
  41. The steps needed are the same shown the previous chapter. After the store is loaded and a layer published note the differences in WMS Capabilities document and in the table on postgres.
  42. WMS Capabilities document
  43. """""""""""""""""""""""""
  44. The WMS Capabilities document is a bit different, now there is also the dimension **elevation**. In this example both time and elevation dimension are set to **List** .
  45. .. code-block:: xml
  46. <Dimension name="time" default="current" units="ISO8601">
  47. 2013-03-10T00:00:00.000Z,2013-03-11T00:00:00.000Z,2013-03-12T00:00:00.000Z,2013-03-13T00:00:00.000Z,2013-03-14T00:00:00.000Z,2013-03-15T00:00:00.000Z,2013-03-16T00:00:00.000Z,2013-03-17T00:00:00.000Z,2013-03-18T00:00:00.000Z
  48. </Dimension>
  49. <Dimension name="elevation" default="200.0" units="EPSG:5030" unitSymbol="m">
  50. 200.0,300.0,500.0,600.0,700.0,850.0,925.0,1000.0
  51. </Dimension>
  52. The table on postgres
  53. """""""""""""""""""""
  54. With the elevation support enabled the table on postgres has, for each image, the field **elevation** filled with the elevation value.
  55. .. figure:: img/elevationTable.png
  56. :align: center
  57. .. note:: The user must create manually the index on the table in order to speed up the search by attribute.
  58. Query layer on timestamp:
  59. `````````````````````````````````
  60. In order to display a snapshot of the map at a specific time instant and elevation you have to pass in the request those parameters.
  61. * **&time=** < **pattern** > , as shown before,
  62. * **&elevation=** < **pattern** > where you pass the value of the elevation.
  63. For example if an user wants to obtain the temperature coverage images for the day **2013-03-10 at 6 PM** at elevation **200 meters** must append to the request::
  64. &time=2013-03-10T00:00:00.000Z&elevation=200.0
  65. .. figure:: img/temperature1.png
  66. :align: center
  67. Same day at elevation **300.0 meters**::
  68. &time=2013-03-10T00:00:00.000Z&elevation=300.0
  69. .. figure:: img/temperature2.png
  70. :align: center
  71. Note that if just the time dimension is append to the request will be displayed the elevation **200 meters** (if present) because of the **default** attribute of the tag ``<Dimension name="elevation" ...`` in the WMS Capabilities document is set to **200**