Commit 28ffa0e6 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Added compatibility to the 'HDF:"/path/file.hdf":subdataset' syntax when...


Added compatibility to the 'HDF:"/path/file.hdf":subdataset' syntax when opening HDF sub-datasets directly.
Signed-off-by: Daniel Scheffler's avatarDaniel Scheffler <danschef@gfz-potsdam.de>
parent d466585b
......@@ -2,6 +2,13 @@
History
=======
0.15.2 (coming soon)
--------------------
* Added compatibility to the 'HDF:"/path/file.hdf":subdataset' syntax when opening HDF sub-datasets directly.
0.15.1 (22.10.2021)
-------------------
......
......@@ -93,7 +93,9 @@ class GeoArray(object):
if isinstance(path_or_array, str):
assert ' ' not in path_or_array, "The given path contains whitespaces. This is not supported by GDAL."
if not os.path.exists(path_or_array) and not path_or_array.startswith('/vsi'):
if not os.path.exists(path_or_array) and \
not path_or_array.startswith('/vsi') and \
not path_or_array.startswith('HDF'):
raise FileNotFoundError(path_or_array)
if isinstance(path_or_array, GeoArray) or issubclass(getattr(path_or_array, '__class__'), GeoArray):
......
......@@ -149,7 +149,9 @@ class GDAL_Metadata(object):
def read_from_file(self, filePath):
assert ' ' not in filePath, "The given path contains whitespaces. This is not supported by GDAL."
if not os.path.exists(filePath) and not filePath.startswith('/vsi'):
if not os.path.exists(filePath) and \
not filePath.startswith('/vsi') and \
not filePath.startswith('HDF'):
raise FileNotFoundError(filePath)
ds = gdal.Open(filePath)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment