1#ifndef ISCE_IO_GDAL_DETAIL_MEMDATASET_ICC
2#error "MemDataset.icc is an implementation detail of MemDataset.h"
7#include <isce3/except/Error.h>
9#include "GDALDataTypeUtil.h"
11namespace isce3 {
namespace io {
namespace gdal {
namespace detail {
15std::string toString(T * ptr)
17 constexpr int maxlen = 64;
22 int len = CPLPrintPointer(buffer, ptr, maxlen);
26 std::string errmsg =
"string size exceeds buffer length";
27 throw isce3::except::RuntimeError(ISCE_SRCINFO(), errmsg);
33 return std::string(buffer);
38std::string getMemDatasetName(T * data,
42 std::size_t colstride,
43 std::size_t rowstride,
44 std::size_t bandstride)
46 GDALDataType datatype = Type2GDALDataType<T>::datatype;
47 if (datatype == GDT_Unknown) {
48 throw isce3::except::RuntimeError(ISCE_SRCINFO(),
"type is not mappable to GDALDataType");
50 std::string datatype_str = GDALGetDataTypeName(datatype);
52 std::string name =
"MEM:::";
53 name +=
"DATAPOINTER=" + toString(data);
54 name +=
",PIXELS=" + std::to_string(width);
55 name +=
",LINES=" + std::to_string(length);
56 name +=
",BANDS=" + std::to_string(bands);
57 name +=
",DATATYPE=" + datatype_str;
58 if (colstride) { name +=
",PIXELOFFSET=" + std::to_string(colstride); }
59 if (rowstride) { name +=
",LINEOFFSET=" + std::to_string(rowstride); }
60 if (bandstride) { name +=
",BANDOFFSET=" + std::to_string(bandstride); }
The isce3::io namespace.
Definition Constants.h:14
base interpolator is an abstract base class
Definition BinarySearchFunc.cpp:5