0

I am creating an ImageMosaic data store by selecting a top level folder. In the folder there are potentially thousands of folders and millions of files, most of which are not TIFF files.

Is there a way to tell GeoServer to look for a certain named sub folder (i.e. AerialImages that contains just TIFFs that I want to use in the ImageMosaic) and grab the TIFFs from within this sub folder?

It is obviously impractical for GeoServer to scan all thousands and millions of files, especially as there are also millions of JPEG files too within different sub folders that I do not want to use in the ImageMosaic (GeoServer looks for world transform files for the JPEGs).

I am unable to move the TIFFs unfortunately to their own top level folder.

I was hoping to use a Reg Ex but not sure if possible.

Sample structure of the data:

  • TopLevelFolder

    • Part1Data

      • Part1SubFolder1 (contains thousands of sub folders and millions of files but no TIFFs)
      • Part1SubFolder2 (contains several sub folders/files but no TIFFs)
      • Part1SubFolder3 (contains several sub folders/files but no TIFFs)
      • Part1SubFolder4
        • AerialImages (this sub folder contains the TIFFs I need for ImageMosaic)
    • Part2Data

      • Part2SubFolder1 (contains thousands of sub folders and millions of files but no TIFFs)
      • Part2SubFolder2 (contains several sub folders/files but no TIFFs)
      • Part2SubFolder3 (contains several sub folders/files but no TIFFs)
      • Part1SubFolder4
        • AerialImages (this sub folder contains the TIFFs I need for ImageMosaic)
    • Part3Data

      • and so on as above

There could be up to 20 "Parts" of data. It is the highlighted sub folders I need to target for extracting the TIFFs from.

enter image description here

1

The following suggestion require you to setup a indexer.properties configuration files outside of the UI. See: https://docs.geoserver.org/stable/en/user/data/raster/imagemosaic/configuration.html

If you can enumerate in advance which directories you want to grab files from, use IndexingDirectories.

In case you know which file extensions are images, use Wildcard, other files will be listed, but at the very least GeoServer won't scan its plugin system looking for a read that can open them, this should speedup the indexing process quite a bit.

0

No, that is not possible. I'm not sure how easy it would be to add to the existing code either but I suspect it would be quite difficult.

An easy solution if you really can't move the files is to use symbolic links to create a image mosaic dataset as GeoServer is expecting. use ln -s on Linux and mklnk on Windows. If you have a regexp then it should be reasonable easy to generate this.

-2

I am bearing suggestions from @Andrea and @Ian in mind. I have been fortunate enough to be able to move the TIFFs into a new directory and all works as expected.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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