-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NETCDF / HDF5 Metadata retrieval issue #70
Comments
Assigned myself to look into it deeper and to add more examples / details about the bug. |
The story here, is that both # python code
>>> import gdal
>>> gdal.Warp('', '/tmp/rarchv.2008_028_00_2d.nc4')
ERROR 1: Input file /tmp/rarchv.2008_028_00_2d.nc4 has no raster bands. |
@jamesmcclain I tried to use this hack / feature to workaround this issue with minimal changes in the code, but it looks like I can't call |
I think the right solution in this case would be to fail only when the |
The code that fails when trying to call a Failure message: $ .travis/tests.sh
make: Entering directory '/workdir/src'
make -C main java/com/azavea/gdal/GDALWarp.class
g++ -I/usr/include/gdal -Wall -Werror -O0 -ggdb3 -DSO_FINI -D_GNU_SOURCE -std=c++14 -I/usr/include -fPIC bindings.cpp -c -o bindings.o
make[1]: Entering directory '/workdir/src/main'
javac -h .. -cp java java/com/azavea/gdal/GDALWarp.java
g++ -I/usr/include/gdal -Wall -Werror -O0 -ggdb3 -DSO_FINI -D_GNU_SOURCE -std=c++14 -I/usr/include -fPIC tokens.cpp -c -o tokens.o
g++ -I/usr/include/gdal -Wall -Werror -O0 -ggdb3 -DSO_FINI -D_GNU_SOURCE -std=c++14 -I/usr/include -fPIC errorcodes.cpp -c -o errorcodes.o
make[1]: Leaving directory '/workdir/src/main'
gcc -Wall -Werror -O0 -ggdb3 -DSO_FINI -D_GNU_SOURCE -I/usr/include/gdal -I/usr/lib/jvm/java-8-openjdk-amd64/include -I/usr/lib/jvm/java-8-openjdk-amd64/include/linux -fPIC com_azavea_gdal_GDALWarp.c -c -o com_azavea_gdal_GDALWarp.o
gcc -Wall -Werror -O0 -ggdb3 -DSO_FINI -D_GNU_SOURCE com_azavea_gdal_GDALWarp.o bindings.o tokens.o errorcodes.o -lgdal -l:libstdc++.a -lpthread -shared -o libgdalwarp_bindings.so
make -C unit_tests tests
make[1]: Entering directory '/workdir/src/unit_tests'
g++ -Wall -Werror -O0 -ggdb3 -DSO_FINI -D_GNU_SOURCE -I.. -std=c++14 -I/usr/include token_tests.cpp -lgdal -L.. -lgdalwarp_bindings -lpthread -lm -o token_tests
g++ -Wall -Werror -O0 -ggdb3 -DSO_FINI -D_GNU_SOURCE -I.. -I/usr/include/gdal -std=c++14 -I/usr/include dataset_tests.cpp -lgdal -L.. -lgdalwarp_bindings -lpthread -lm -o dataset_tests
g++ -Wall -Werror -O0 -ggdb3 -DSO_FINI -D_GNU_SOURCE -I.. -I/usr/include/gdal -std=c++14 -I/usr/include cache_tests.cpp -lgdal -L.. -lgdalwarp_bindings -lpthread -lm -o cache_tests
g++ -Wall -Werror -O0 -ggdb3 -DSO_FINI -D_GNU_SOURCE -I.. -I/usr/include/gdal -std=c++14 -I/usr/include bindings_tests.cpp -lgdal -L.. -lgdalwarp_bindings -lpthread -lm -o bindings_tests
../libgdalwarp_bindings.so: undefined reference to `CPLTurnFailureIntoWarning'
collect2: error: ld returned 1 exit status
Makefile:25: recipe for target 'token_tests' failed
make[1]: *** [token_tests] Error 1
make[1]: *** Waiting for unfinished jobs....
../libgdalwarp_bindings.so: undefined reference to `CPLTurnFailureIntoWarning'
collect2: error: ld returned 1 exit status
Makefile:34: recipe for target 'bindings_tests' failed
make[1]: *** [bindings_tests] Error 1
/tmp/ccS0yFsg.o: In function `locked_dataset::open()':
/workdir/src/unit_tests/../locked_dataset.hpp:706: undefined reference to `CPLTurnFailureIntoWarning'
/workdir/src/unit_tests/../locked_dataset.hpp:715: undefined reference to `CPLTurnFailureIntoWarning'
collect2: error: ld returned 1 exit status
Makefile:31: recipe for target 'cache_tests' failed
make[1]: *** [cache_tests] Error 1
/tmp/cco1AL5i.o: In function `locked_dataset::open()':
/workdir/src/unit_tests/../locked_dataset.hpp:706: undefined reference to `CPLTurnFailureIntoWarning'
/workdir/src/unit_tests/../locked_dataset.hpp:715: undefined reference to `CPLTurnFailureIntoWarning'
collect2: error: ld returned 1 exit status
Makefile:28: recipe for target 'dataset_tests' failed
make[1]: *** [dataset_tests] Error 1
make[1]: Leaving directory '/workdir/src/unit_tests'
Makefile:37: recipe for target 'tests' failed
make: *** [tests] Error 2
make: Leaving directory '/workdir/src' |
I confirmed that GDAL 2.2.3 is the version currently in the build container. I will upgrade it to a 2.4 version this evening. |
The new way to support HDF in GT 3.x is posted here:
Supposed this is your data:
Try APIs with GDALDataset("HDF4_EOS:EOS_GRID:\"(your path to file/)MCD12Q1.A2019001.h25v09.006.2020212132651.hdf\":MCD12Q1:LC_Type1") And this is a temporary solution according to @pomadchin. |
Describe the bug
Getting the metadata of the NETCDF file can not be performed.
So performing a
GDALWarp.get_metadata_domain_list(token, datasetType.value, numberOfAttempts, band, arr)
of a file that consists of multipleSUBDATASETS
seems to be not possible, even with reading the metadata for the entire file (specifying the band = 0))To Reproduce
rarchv.2008_028_00_2d.nc4
) (contact me if you need a copy)Expected behavior
Should behave like usual GDAL JNI bindings:
Environment
Mac OS 10.14.6
1.8.0_162
GDAL 2.4.2, released 2019/06/28
The text was updated successfully, but these errors were encountered: