See code below:
I downloaded GDAL 3.x for Windows from the GISInternals website.
I have Windows 10 64Bit, Visual Studio 2019 C++
The code below loads a data file after calling GDALAllRegister();There are no
runtime or GDAL errors reported.But the header results are incorrect and
corrupted. See attached Debug Window.I tried loading a 3D TIFF file and a ENVI
file, with the same problem. Any Idea what the problem could be?
Note, from the ENVI ascii data File Header, the raster size should be 320x190
with 256 bands for this example.
//------------------- CODEvoid CMFCApplication3Dlg::OnBnClickedButton1(){
CStringA fileName = "C:\\temp\\PC_IT5_G2.bin";
// C++ GDALDataset* data = (GDALDataset*)GDALOpen(fileName, GA_ReadOnly);
// C GDALDatasetH dataH = GDALOpen(fileName, GA_ReadOnly); GDALDriverH
hDriver = GDALGetDatasetDriver(dataH);
CStringA NameS = GDALGetDriverShortName(hDriver); CStringA NameL =
GDALGetDriverLongName(hDriver);
int nx = GDALGetRasterXSize(hDriver); int ny = GDALGetRasterYSize(hDriver);
int nz = GDALGetRasterCount(hDriver);
CStringA errMsg = CPLGetLastErrorMsg();
int i = 0;}
//------------------------ FILE HEADER minus Meta DataENVIacquisition time =
2020-04-29T15:53:46.486+00:0samples = 320lines = 190bands = 256header offset =
0file type = ENVI Standarddata type = 12interleave = bipbyte order =
0wavelength units = Nanometerswavelength = { 948.74, 951.95, 955.16, 958.37,
961.58, 964.79, 968, 971.22, 974.44, 977.65, 980.87, 984.1, ......
_______________________________________________
gdal-dev mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/gdal-dev