No announcement yet.

TIFF file is missing a required tag StripOffsets

  • Filter
  • Time
  • Show
Clear All
new posts

  • TIFF file is missing a required tag StripOffsets

    Hello. There was such a problem: working with some * .tiff, when trying to get DataRaster [] using the readDataRaster () method, an exception is thrown:
    ERROR j.l.Throwable - TIFF file is missing a required tag StripOffsets
    Below is the code that works with * .tiff.
    private GeotiffReader reader;
    private ByteBufferRaster raster;
    reader = new GeotiffReader(file);
    DataRaster[] dataRaster = listDataRaster.get(iter);
    raster = (ByteBufferRaster)dataRaster[0];
    raster.setDoubleAtPosition(y, x, value);
    My task is to take the * .tiff ByteBufferRaster and then use setDoubleAtPosition to make changes to the grid after some calculations and rewrite * .tiff. How do I fix this error? And if not, are there other ways to accomplish my task?

  • #2
    Sending the tiff file over would help... too big ? Confidential data ?
    Remember also you can manipulate tiff files with the gdal tools.


    • #3

      Thank you all, we demand to solve this way via ExtendedGDALDataRaster

          DataRasterReaderFactory readerFactory = (DataRasterReaderFactory) WorldWind
          DataRasterReader dataRasterReader;
          DataRaster[] dataRasters = null;
          dataRasterReader = readerFactory.findReaderFor(file, null);
          dataRasters =, null);
          rasterGdal = (ExtendedGDALDataRaster) dataRasters[0];
          ElevationModel elevationModelFromGlobe = GLOBE.getElevationModel();    
          Sector boundingSector = rasterGdal.getSector();
          int[] heightAndWidth = new int[2];    
          // Method for creating an empty sector by analogy with the current one    
          recalculationHeightAndWidth (boundingSector, elevationModelFromGlobe, heightAndWidth);
          // Method to create default parameters for the sector
          AVList params = getParams(boundingSector, heightAndWidth[1], heightAndWidth[0]);
          raster = (ByteBufferRaster) ByteBufferRaster.createGeoreferencedRaster(params);
          Dataset dataset = rasterGdal.getBestSuitedDataset(heightAndWidth[1], heightAndWidth[0], rasterGdal.getSector());
          band = dataset.GetRasterBand(1);

      And then for you can get the value of the height of any point from * .tiff and change it to your discretion (it will be in data)

          float[] data = new float[1];
          band.ReadRaster(x, y, 1, 1, band.getDataType(), data);