2

I have a set of layers that were created using the ImageMosaic plugin. All of them have the TIME dimension available, that we use to display animations on the front-end.

Our idea is to start caching all this layers using GeoWebCache, but we've found that when we send the requests for the tiles using the TIME=, in the response headers we get geowebcache-miss-reason: no parameter filter exists for TIME

Even though that we used the REST interface to pregenerate the cache specifying all the available TIME values. The following is the XML that we use to achieve this:

<?xml version="1.0" encoding="UTF-8"?>
<seedRequest>
  <name>rasterdata_service:__LAYER_NAME__</name>
  <bounds>
    <!--For now, only the bounding box of Catalonia-->
    <coords>
      <double>-2495667.977678598</double>
      <double>-2223677.196231552</double>
      <double>3291070.6104286816</double>
      <double>959189.3312465074</double>
    </coords>
  </bounds>

  <gridSetId>EPSG:900913</gridSetId>
  <zoomStart>6</zoomStart>
  <zoomStop>11</zoomStop>
  <format>image/png</format>

  <!-- type can be seed, reseed, or truncate -->
  <type>seed</type>

  <threadCount>1</threadCount>

  <parameters>
    <entry>
      <!--Generate the cached tiles for the specific TIME value-->
      <string>TIME</string>
      <string>2019-11-29T07:00:00.000Z</string>
    </entry>
  </parameters>
</seedRequest>

Also, in the GWC web interface, if we try to seed the cache manually, we don't see the option for specifying the TIME dimension (Even though it's mentioned in the documentation as one of the possible filters), only to select the Style: enter image description here

Also the TIME dimension appears correctly when we make a getCapabilties request:

<Dimension name="time" default="2019-11-27T14:00:00Z" units="ISO8601">2019-11-26T16:00:00.000Z,2019-11-26T17:00:00.000Z,2019-11-26T18:00:00.000Z,2019-11-26T19:00:00.000Z,2019-11-26T20:00:00.000Z,2019-11-26T21:00:00.000Z,2019-11-26T22:00:00.000Z,2019-11-26T23:00:00.000Z,2019-11-27T00:00:00.000Z,2019-11-27T01:00:00.000Z,2019-11-27T02:00:00.000Z,2019-11-27T03:00:00.000Z,2019-11-27T04:00:00.000Z,2019-11-27T05:00:00.000Z,2019-11-27T06:00:00.000Z,2019-11-27T07:00:00.000Z,2019-11-27T08:00:00.000Z,2019-11-27T09:00:00.000Z,2019-11-27T11:00:00.000Z,2019-11-27T12:00:00.000Z,2019-11-27T13:00:00.000Z,2019-11-27T14:00:00.000Z</Dimension>

Is there any option within the GeoWebCache that I'm not configuring correctly? Or does the GWC not support the ImageMosaic?


GeoServer version: 2.16.0 running from the official dockerfile (Linux)

1 Answer 1

5

You need to set a Parameter filter, the easy way to do this is to go to the Tile Caching tab of the Layer page.

enter image description here

TIME is available in the Add Filter combo box and then you can choose to add either a fixed list of times to be cached or a regex that selects several times. This is described in the GeoWebCache manual.

To work out what to put in a REST document, make the change once in the GUI and request the document from the GWC REST API, so an endpoint like:

http://localhost:8080/geoserver/gwc/rest/layers/cite:earthquakes.xml 

will give:

<?xml version="1.0"?>                                                           
<GeoServerLayer>                                                                
  <id>LayerInfoImpl--276dd878:16bd12b45fe:-7fb6</id>                            
  <enabled>true</enabled>                                                       
  <inMemoryCached>true</inMemoryCached>                                         
  <name>cite:earthquakes</name>                                                 
  <mimeFormats>                                                                 
    <string>image/png</string>                                                  
    <string>image/jpeg</string>                                                 
  </mimeFormats>                                                                
  <gridSubsets>                                                                 
    <gridSubset>                                                                
      <gridSetName>EPSG:4326</gridSetName>                                      
      <extent>                                                                  
        <coords>                                                                
          <double>-179.993</double>
...
<parameterFilters>                                                            
    <regexParameterFilter>                                                      
      <key>TIME</key>                                                           
      <defaultValue>2019</defaultValue>                                         
      <normalize>                                                               
        <locale/>                                                               
      </normalize>                                                              
      <regex>[\\d:-]+</regex>                                                   
    </regexParameterFilter>                                                     
    <styleParameterFilter>                                                      
      <key>STYLES</key>                                                         
      <defaultValue/>                                                           
    </styleParameterFilter>                                                     
  </parameterFilters>                                                           
  <gutter>0</gutter>                                                            
</GeoServerLayer>
6
  • Thank you, that was what I was missing. Now the requests are accepting the TIME parameter
    – CRE
    Nov 29, 2019 at 13:04
  • Just one side question about this, I'm trying to change this option using the REST API (though the web interface worked just fine) so that for all new layers this option is applied. But I'm having problems understanding how I can do this though the REST. To my understanding its though the coverage endpoint "workspaces/__WORKSPACE__/coveragestores/__LAYER__/coverages/__LAYER__" but I dont know what parameters exactly is expecting for the filter part
    – CRE
    Nov 29, 2019 at 15:41
  • 1
    do a get for one you have set in the GUI to see how it is encoded
    – Ian Turton
    Nov 29, 2019 at 15:43
  • Thanks for all the help, i've finally found it. For anyone facing the same issue, the correct endpoint to check this is "/gwc/rest/layers/<workspace>:<layer>.xml
    – CRE
    Nov 29, 2019 at 16:16
  • see my update for the path
    – Ian Turton
    Nov 29, 2019 at 16:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.