diff --git a/src/GDALTiler.cpp b/src/GDALTiler.cpp index 56d2bc0..041b77a 100644 --- a/src/GDALTiler.cpp +++ b/src/GDALTiler.cpp @@ -22,6 +22,7 @@ #include // std::abs #include // std::minmax #include // strlen +#include #include "gdal_priv.h" #include "gdalwarper.h" @@ -39,6 +40,11 @@ GDALTiler::GDALTiler(GDALDataset *poDataset, const Grid &grid, const TilerOption poDataset(poDataset), options(options) { + + // Transformed bounds can give slightly different results on different threads unless mutexed + static std::mutex mutex; + std::lock_guard lock(mutex); + // if the dataset is set we need to initialise the tile bounds and raster // resolution from it. if (poDataset != NULL) {