[GIS] Failed to seed layer in GWC of GeoServer when Zoom Start is selected greater than 4 using a user-defined Grid Set

geoserver

Everybody,

I'm undergoing development on a application which is constructed by GeoServer and OpenLayers. Considering that there is a large set of layers (8 layer groupS and totally 121 layers) to display, we decided that user access the map in the cache way rather than dynamic generating. Because there are only 2 optional Grid Set in GeoWebCache from, I searched from google to create a new user-defined Grid Set 'EPSG:2326' which is aimed for HongKong, following are steps I did:

1, Newly added a Grid Set in 'geowebcache.xml' which is under path 'data_dir/gwc':

  <gridSets>
    <gridSet>
      <name>EPSG:2326</name>
      <srs>
        <number>2326</number>
      </srs>
      <extent>
        <coords>
          <double>806677.9759</double>
          <double>802420.9858</double>
          <double>8876817.5647</double>
          <double>853384.7903</double>
        </coords>
      </extent>
      <scaleDenominators>
        <double>25000000</double>
        <double>1000000</double>
        <double>100000</double>
        <double>25000</double>
      </scaleDenominators>
      <tileHeight>256</tileHeight>
      <tileWidth>256</tileWidth>
    </gridSet>
  </gridSets>
  <layers>

2, Added new optional Grid Set into layer group's XML config file which is under the path 'data_dir/sample_group' and named for 'sample_group.xml':

<entry key="GWC.gridSets">EPSG:4326,EPSG:900913,EPSG:2326</entry>

Finally, I go to the GWC Seed Form page to generate cache png, and seeding task can done successfully only on the condition that Stop Zoom is lower 4, otherwise will be failed and below is the related error message:

java.lang.IllegalStateException: Found no range bounds for z level 4: {0=[J@16a4cf2, 1=[J@1e1b0e7, 2=[J@2516dc, 3=[J@1000323}
        at org.geowebcache.storage.TileRange.rangeBounds(TileRange.java:169)
        at org.geowebcache.seed.SeedTask.tileCount(SeedTask.java:217)
        at org.geowebcache.seed.SeedTask.doActionInternal(SeedTask.java:107)
        at org.geowebcache.seed.GWCTask.doAction(GWCTask.java:76)
        at org.geowebcache.seed.MTSeeder.call(MTSeeder.java:36)
        at org.geowebcache.seed.MTSeeder.call(MTSeeder.java:25)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)

I guess that means no Bound Box for Zoom Level 4, I'm now confused and hope anybody out there give me some ideas?

Thanks a lot.

Best Answer

This issue is caused by 'scaleDenominators' configuration is not completed.

  <scaleDenominators>
    <double>25000000</double>
    <double>1000000</double>
    <double>100000</double>
    <double>25000</double>
  </scaleDenominators>

You should add all possible scaleDenominators OR keep it null to use the default.