[GIS] Geoserver – ImagePyramid plugin problem

gdalgeoservergeotiff-tiff

I have a huge Geotiff file , and i've tiled it ..
I've created the tiles using gdal_retile.py tool , but i'm getting the following error from Geoserver while linking the layer with the tiles folder : Could not list layers for this store, an error occurred retrieving them: This plugin accepts only File, URL and String pointing to a file any suggestion?

Best Answer

I ran into this same problem and in my case it was caused by GeoServer not having write permission for the pyramid data directory, i.e., the directory I passed to gdal_retile.py as the -targetDir argument.

The stack trace in the log included:

Caused by: java.lang.IllegalArgumentException: This plugin accepts only File, URL and String pointing to a file
    at org.geotools.gce.imagepyramid.ImagePyramidReader.<init>(ImagePyramidReader.java:182)

The message was misleading, though. The connection URL I passed was a valid file URL, but it specified a directory structure that was read-only for the tomcat user.

In my particular case, I had run gdal_retile.py with a sudo command and so the pyramid directory was owned by root. I was able to fix the problem by changing the directory's owner and group to tomcat with the command chmod -R tomcat:tomcat <pyramid root dir>.

This allowed the ImagePyramid plugin to:

  • create a new directory named 0 under pyramid
  • move all tiff files in pyramid into 0
  • create an image mosaic in all sub-directories (shapefile index plus property file)
  • create the root property file describing the whole pyramid structure
Related Question