Skip to content
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

Shift where netcdf information is reported. #1413

Merged
merged 1 commit into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
### Changes
- Use an enum for priority constants ([#1400](../../pull/1400))
- Don't automatically flush memcached tile cache on exit ([#1409](../../pull/1409))
- Shift where netcdf information is reported ([#1413](../../pull/1413))

### Bug Fixes
- Fix an issue emitting geojson annotations ([#1395](../../pull/1395))
Expand Down
22 changes: 11 additions & 11 deletions sources/gdal/large_image_source_gdal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,17 +592,6 @@ def getMetadata(self):
'sourceBounds': self.getBounds(),
'bands': self.getBandInformation(),
})
if hasattr(self, '_netcdf'):
# To ensure all band information from all subdatasets in netcdf,
# we could do the following:
# for key in self._netcdf['datasets']:
# dataset = self._netcdf['datasets'][key]
# if 'bands' not in dataset:
# gdaldataset = gdal.Open(dataset['name'], gdalconst.GA_ReadOnly)
# dataset['bands'] = self.getBandInformation(gdaldataset)
# dataset['sizeX'] = gdaldataset.RasterXSize
# dataset['sizeY'] = gdaldataset.RasterYSize
metadata['netcdf'] = self._netcdf
return metadata

def getInternalMetadata(self, **kwargs):
Expand Down Expand Up @@ -634,6 +623,17 @@ def getInternalMetadata(self, **kwargs):
metadatalist = self.dataset.GetMetadata_List(key)
if metadatalist:
result['Metadata_' + key] = metadatalist
if hasattr(self, '_netcdf'):
# To ensure all band information from all subdatasets in netcdf,
# we could do the following:
# for key in self._netcdf['datasets']:
# dataset = self._netcdf['datasets'][key]
# if 'bands' not in dataset:
# gdaldataset = gdal.Open(dataset['name'], gdalconst.GA_ReadOnly)
# dataset['bands'] = self.getBandInformation(gdaldataset)
# dataset['sizeX'] = gdaldataset.RasterXSize
# dataset['sizeY'] = gdaldataset.RasterYSize
result['netcdf'] = self._netcdf
return result

def _bandNumber(self, band, exc=True): # TODO: use super method?
Expand Down