Skip to content

Commit

Permalink
Merge pull request #1413 from girder/shift-netcdf
Browse files Browse the repository at this point in the history
Shift where netcdf information is reported.
  • Loading branch information
manthey authored Dec 19, 2023
2 parents 7d579ca + ee179f9 commit a734a0b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
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

0 comments on commit a734a0b

Please sign in to comment.