Skip to content

Commit

Permalink
Add LIBERTIFF driver: native thread-safe read-only GeoTIFF reader
Browse files Browse the repository at this point in the history
This driver is based on the libertiff library for IFD and tag parsing.
It uses in a very controlled (and isolated) way internal libtiff LZW,
PackBits and LERC codecs (even if using external libtiff for the GTiff
driver). For Deflate/GZip, LZMA, ZSTD, it defers to GDAL
cpl_compressor.h API. For JPEG, WEBP, JPEGXL, it uses the corresponding
GDAL drivers to open strip/tile blobs as temporary datasets.

Note that at current time the driver isn't necessarily optimized to
minimize the number of network requests for COG layout.

The driver supports most TIFF formulations, but not necessarily the most
exotic ones that the GTiff libtiff based might support. In particular it
does not support non-power-of-two BitsPerSample value (could be added
with extra coding). On the plus side, JPEGXL is supported as soon as the
JPEGXL driver is available at runtime (contrary to the GTiff driver which requires
using internal libtiff since the tif_jxl.c codec hasn't been upstreamed
to libtiff yet).

As noted in the documentation, no side-car file at all are currently
used by this driver.
  • Loading branch information
rouault committed Dec 17, 2024
1 parent 5759dfd commit 334e852
Show file tree
Hide file tree
Showing 30 changed files with 4,412 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Supported Formats: (ro:read-only, rw:read-write, +:update, v:virtual-I/O s:subda
SNAP_TIFF -raster- (rov): Sentinel Application Processing GeoTIFF
GTiff -raster- (rw+vs): GeoTIFF (*.tif, *.tiff)
COG -raster- (wv): Cloud optimized GeoTIFF generator (*.tif, *.tiff)
LIBERTIFF -raster- (rov): GeoTIFF (using LIBERTIFF library) (*.tif, *.tiff)
NITF -raster- (rw+vs): National Imagery Transmission Format (*.ntf)
RPFTOC -raster- (rovs): Raster Product Format TOC format (*.toc)
ECRGTOC -raster- (rovs): ECRG TOC format (*.xml)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Supported Formats: (ro:read-only, rw:read-write, +:update, v:virtual-I/O s:subda
SNAP_TIFF -raster- (rov): Sentinel Application Processing GeoTIFF
GTiff -raster- (rw+vs): GeoTIFF (*.tif, *.tiff)
COG -raster- (wv): Cloud optimized GeoTIFF generator (*.tif, *.tiff)
LIBERTIFF -raster- (rov): GeoTIFF (using LIBERTIFF library) (*.tif, *.tiff)
NITF -raster- (rw+vs): National Imagery Transmission Format (*.ntf)
RPFTOC -raster- (rovs): Raster Product Format TOC format (*.toc)
ECRGTOC -raster- (rovs): ECRG TOC format (*.xml)
Expand Down
13 changes: 7 additions & 6 deletions alg/gdal_interpolateatpoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,18 @@
using DoublePointsCache =
lru11::Cache<uint64_t, std::shared_ptr<std::vector<double>>>;

class GDALDoublePointsCache
class CPL_DLL GDALDoublePointsCache
{
public:
std::unique_ptr<DoublePointsCache> cache{};
};

bool GDALInterpolateAtPoint(GDALRasterBand *pBand,
GDALRIOResampleAlg eResampleAlg,
std::unique_ptr<DoublePointsCache> &cache,
const double dfXIn, const double dfYIn,
double *pdfOutputReal, double *pdfOutputImag);
bool CPL_DLL GDALInterpolateAtPoint(GDALRasterBand *pBand,
GDALRIOResampleAlg eResampleAlg,
std::unique_ptr<DoublePointsCache> &cache,
const double dfXIn, const double dfYIn,
double *pdfOutputReal,
double *pdfOutputImag);

/*! @endcond */

Expand Down
Binary file added autotest/gcore/data/gtiff/byte_coord_epoch.tif
Binary file not shown.
Binary file added autotest/gcore/data/gtiff/cint32_big_endian.tif
Binary file not shown.
Binary file added autotest/gcore/data/gtiff/int16_big_endian.tif
Binary file not shown.
Binary file added autotest/gcore/data/gtiff/miniswhite.tif
Binary file not shown.
Binary file not shown.
Binary file added autotest/gcore/data/gtiff/sparse_nodata_one.tif
Binary file not shown.
Binary file added autotest/gcore/data/gtiff/sparse_tiled_contig.tif
Binary file not shown.
Binary file added autotest/gcore/data/gtiff/sparse_tiled_separate.tif
Binary file not shown.
Loading

0 comments on commit 334e852

Please sign in to comment.