GeoTools
  1. GeoTools
  2. GEOT-1448

MosaicIndexBuilder writes wrong filenames in the .shp file

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.3.4
    • Fix Version/s: 2.7.5, 8.0-RC1
    • Component/s: coveragetools
    • Labels:
      None
    • Environment:
      ubuntu feisty, java 1.6

      Description

      I was experiencing a strange behavior for some source paths.. in my case MosaicIndexBuilder was called from PyramidBuilder for a source file:

      "/home/stefan/EigeneDateien/Desktop/NoSync/bigGeoTiff/some.tiff"

      the filenames in the .shp then looked like "iff/0/mosai" which later cashed the creation process

      i suppose the error only appears, when getCanonicalPath() returns something shorter/longer than the "normal" path.

      I figured the bug to be in MosaicIndexBuilder.run() around line 295, where a validFilename is build up...
      This is a proposal for a fix:

      validFileName = validFileName.replace('
      ', '/');
      // = /home/stefan/EigeneDateien/Desktop/NoSync/bigGeoTiff/pyramid/0/mosaic_0.tiff

      // Just for paranoia...
      if (validFileName.endsWith("/"))
      validFileName = validFileName.substring(0,validFileName.length()-1);

      validFileName = validFileName.substring( validFileName.lastIndexOf('/')+1);
      // mosaic_0.tiff

      Before if was:
      validFileName = validFileName.replace('
      ', '/');
      validFileName = validFileName.substring(locationPath.length() + 1,
      fileBeingProcessed.getAbsolutePath().length());

      Greetings,
      steve

        Activity

        Hide
        Simone Giannecchini added a comment -
        setting to minor since we don't need to go through the path of the MosaicIndexBuilder anymore
        Show
        Simone Giannecchini added a comment - setting to minor since we don't need to go through the path of the MosaicIndexBuilder anymore
        Hide
        Stefan Alfons Tzeggai added a comment -
        Who is "we", and which is the way to go now?
        Show
        Stefan Alfons Tzeggai added a comment - Who is "we", and which is the way to go now?
        Hide
        Simone Giannecchini added a comment -
        http://docs.geoserver.org/1.7.x/en/user/tutorials/image_mosaic_plugin/imagemosaic.html

        You can simply point to ImageMosaicReader to a directory and it will create index and properties files by itself. I will write down more docs for geotools as well next week.
        Show
        Simone Giannecchini added a comment - http://docs.geoserver.org/1.7.x/en/user/tutorials/image_mosaic_plugin/imagemosaic.html You can simply point to ImageMosaicReader to a directory and it will create index and properties files by itself. I will write down more docs for geotools as well next week.

          People

          • Assignee:
            Stefan Alfons Tzeggai
            Reporter:
            Stefan Alfons Tzeggai
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: