Hi Simo, Julian,
In short, the GDAL version is faster and supports more GeoTIFF variants, but it needs the native GDAL dependency and cannot work in some environments (for example on mobile). GeoTiffRasterLayer (ThinkGeo.Core) is the managed version: no native dependencies, but slower and supports fewer formats. Here are the details:
GeoTiffGdalRasterLayer (ThinkGeo.Gdal) asks GDAL for exactly the pixel window a tile needs, at the tile’s resolution. GDAL decodes only the blocks that window touches, uses the file’s internal overviews when zoomed out, and caches blocks, so it never decodes the whole image. That is why it feels instant on your 14 MB file. It also reads anything GDAL reads: BigTIFF, COG, JPEG/ZSTD/WebP/LERC compression, multi-band data, and it can warp to Web Mercator natively.
GeoTiffRasterLayer (ThinkGeo.Core) is a managed TIFF reader. It handles the classic TIFF codecs (LZW, Deflate, PackBits, JPEG, CCITT) with 8- or 16-bit samples. Its read path decodes the whole image to RGBA, and in 14.5.x that happened for every single tile. 14.5.5 removed an extra per-tile copy on top of that, which is why it got a bit faster but still costs seconds per view on a large compressed file.
We did make some changes to the managed version in the latest beta (and upcoming v15): the image is now decoded once and kept in a raster cache instead of being decoded per tile, the file’s overviews are read when the map is zoomed out instead of the full-resolution image, and the decoded bitmap is shared with the renderer rather than copied. Here are some test results, same 13 MB GeoTIFF, 20 tiles:
GeoTiffRasterLayer GeoTiffGdalRasterLayer
14.5.5 20.1 ms/tile 1.3 ms/tile
15.0.0-beta131 1.3 ms/tile 1.3 ms/tile
One note: our test file is uncompressed. A compressed file pays one bigger decode on the first tile in 15.0, then the same per-tile cost as above. If you need to stay on 14.5.x, GDAL is the practical choice for a file that size; TileType.SingleTile also helps there since it decodes once per view instead of once per tile.
Julian, I wrote this down regarding documentation improvements. We will make lots of improvements to the products (you will see next week) and the website for v15 release, and I’ll make sure to revisit this one.
Thanks,
Ben