Fix for issue #800: Earth weather (temporal globebrowsing data) not caching. (#861)

This commit is contained in:
Gene Payne
2019-05-16 12:27:07 -06:00
committed by GitHub
parent 8bb70e328d
commit 66379fe095
@@ -445,14 +445,21 @@ void RawTileDataReader::initialize() {
GlobeBrowsingModule& module = *global::moduleEngine.module<GlobeBrowsingModule>();
std::string content = _datasetFilePath;
if (module.isCachingEnabled() && FileSys.fileExists(_datasetFilePath)) {
// Only replace the 'content' if the dataset is an XML file and we want to do
// caching
std::ifstream t(_datasetFilePath);
std::string c(
(std::istreambuf_iterator<char>(t)),
std::istreambuf_iterator<char>()
);
if (module.isCachingEnabled()) {
std::string c;
if (FileSys.fileExists(_datasetFilePath)) {
// Only replace the 'content' if the dataset is an XML file and we want to do
// caching
std::ifstream t(_datasetFilePath);
c.append(
(std::istreambuf_iterator<char>(t)),
std::istreambuf_iterator<char>()
);
}
else {
//GDAL input case for configuration string (e.g. temporal data)
c = _datasetFilePath;
}
if (c.size() > 10 && c.substr(0, 10) == "<GDAL_WMS>") {
// We know that _datasetFilePath is an XML file, so now we add a Cache line