ThinkGeo.com    |     Documentation    |     Premium Support

GeoTiffRasterSource does not work with TIFF files with separate planes and multiple strips

When I try to display a TIFF file with separate planes and multiple strips, I just get “Index was outside the bounds of the array”. (Apparently, PhotoShop likes to generate such files.)

    private void MapView_Loaded(object sender, RoutedEventArgs e)
    {
        mapView.MapUnit = GeographyUnit.Meter;

        var layersOverlay = new LayerOverlay();
        mapView.Overlays.Add(layersOverlay);

        var extent = new RectangleShape(0, 123, 123, 0);
        var layer = new GeoTiffRasterLayer("tile.tif", extent);
        layersOverlay.Layers.Add(layer);

        mapView.CurrentExtent = extent;
    }

tile.tif.zip (23.9 KB)

>tiffinfo tile.tif
TIFF Directory at offset 0x587c (22652)
  Image Width: 256 Image Length: 256
  Bits/Sample: 8
  Compression Scheme: AdobeDeflate
  Photometric Interpretation: palette color (RGB from colormap)
  FillOrder: msb-to-lsb
  Orientation: row 0 top, col 0 lhs
  Samples/Pixel: 1
  Rows/Strip: 128
  Planar Configuration: separate image planes
  Page Number: 0-1
  Color Map: (present)

Hi Clemens,

Thanks for the report with detailed description, I have reproduce the error on my side, we are working on it now, It may be a bug in managed code. I’m not sure which version you are using, could you please try the Unmanaged version - ThinkGeo.UnmanagedGeoTiff? The API is very similar to GeoTiffRasterLayer.

Thanks,
Johnny

With UnmanagedGeoTiffRasterLayer (both 12.3.10 and latest prerelease), it displays the image, but with wrong colors (apparently, grayscale without palette).

Clemens,

Thanks for the further information, I will dig into more details later, it should be the issues in our SDK. It may need some time, but I will keep you updated if any progress.

Regards,
Johnny

Clemens,

We spent some hours on the issue today, but still in progress, now the image can be shown up without any error, but has some differences, the below half of the picture is incorrect.

We will keep working on it.

Thanks,
Johnny

Clemens,

Just let you know we are still working on it, and almost be finished.

Thanks,
Johnny

Hi @Clemens_Ladisch,

After several days development, the multiple-strip based tiff file has been supported by ThinkGeo SDK now, could you please pull the latest version 13.0.0-beta277 or higher from NuGet https://www.nuget.org/packages/ThinkGeo.Core to have a try?

Thanks,
Johnny