Commit 9f3fe8e6 authored by Cédric Traizet's avatar Cédric Traizet
Browse files

BUG: make GetDEMValue thread safe

parent 761da804
Pipeline #5639 passed with stages
in 104 minutes and 34 seconds
......@@ -30,6 +30,8 @@
// TODO : RemoveOSSIM
#include <otbOssimDEMHandler.h>
#include <mutex>
#include "ogr_spatialref.h"
namespace otb {
......@@ -68,8 +70,12 @@ std::vector<std::string> GetFilesInDirectory(const std::string & directoryPath)
return fileList;
}
std::mutex demMutex;
boost::optional<double> GetDEMValue(double lon, double lat, GDALDataset& ds)
{
const std::lock_guard<std::mutex> lock(demMutex);
#if GDAL_VERSION_NUM >= 3000000
auto srs = ds.GetSpatialRef();
#else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment