mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-13 17:09:05 -05:00
Remove TileDataset with GDALDataset parameter as GDALOpen can take raw XML
This commit is contained in:
@@ -31,6 +31,8 @@
|
||||
#include <modules/globebrowsing/other/tileprovider.h>
|
||||
#include <modules/globebrowsing/geodetics/angle.h>
|
||||
|
||||
|
||||
|
||||
namespace {
|
||||
const std::string _loggerCat = "TileDataset";
|
||||
}
|
||||
@@ -42,17 +44,16 @@ namespace openspace {
|
||||
// INIT THIS TO FALSE AFTER REMOVED FROM TILEPROVIDER
|
||||
bool TileDataset::GdalHasBeenInitialized = false;
|
||||
|
||||
TileDataset::TileDataset(const std::string& fileName, int minimumPixelSize, GLuint dataType)
|
||||
TileDataset::TileDataset(const std::string& gdalDatasetDesc, int minimumPixelSize, GLuint dataType)
|
||||
: _minimumPixelSize(minimumPixelSize)
|
||||
{
|
||||
|
||||
if (!GdalHasBeenInitialized) {
|
||||
GDALAllRegister();
|
||||
GdalHasBeenInitialized = true;
|
||||
}
|
||||
|
||||
_dataset = (GDALDataset *)GDALOpen(absPath(fileName).c_str(), GA_ReadOnly);
|
||||
ghoul_assert(_dataset != nullptr, "Failed to load dataset: " << fileName);
|
||||
_dataset = (GDALDataset *)GDALOpen(gdalDatasetDesc.c_str(), GA_ReadOnly);
|
||||
ghoul_assert(_dataset != nullptr, "Failed to load dataset:\n" << gdalDatasetDesc);
|
||||
_dataLayout = DataLayout(_dataset, dataType);
|
||||
|
||||
_depthTransform = calculateTileDepthTransform();
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
|
||||
#include "gdal_priv.h"
|
||||
|
||||
|
||||
#include <memory>
|
||||
#include <set>
|
||||
#include <queue>
|
||||
@@ -88,12 +89,22 @@ namespace openspace {
|
||||
|
||||
class TileDataset {
|
||||
public:
|
||||
|
||||
// Default dataType = 0 means GDAL will use the same data type as the data
|
||||
// is originally in
|
||||
TileDataset(const std::string& fileName, int minimumPixelSize, GLuint dataType = 0);
|
||||
|
||||
|
||||
/**
|
||||
* Opens a GDALDataset in readonly mode and calculates meta data required for
|
||||
* reading tile using a ChunkIndex.
|
||||
*
|
||||
* \param gdalDatasetDesc - A path to a specific file or raw XML describing the dataset
|
||||
* \param minimumPixelSize - minimum number of pixels per side per tile requested
|
||||
* \param datatype - datatype for storing pixel data in requested tile
|
||||
*/
|
||||
TileDataset(const std::string& gdalDatasetDesc, int minimumPixelSize, GLuint dataType = 0);
|
||||
|
||||
~TileDataset();
|
||||
|
||||
|
||||
|
||||
|
||||
std::shared_ptr<TileIOResult> readTileData(ChunkIndex chunkIndex);
|
||||
|
||||
@@ -105,6 +116,7 @@ namespace openspace {
|
||||
private:
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
// HELPER STRUCTS //
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user