Ticket #2222 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

GetSubDatasets() sugar missing in NG python bindings

Reported by: warmerdam Owned by: hobu
Priority: normal Milestone: 1.5.1
Component: PythonBindings Version: 1.5.0
Severity: normal Keywords:
Cc: hobu

Description

The old generation bindings had a "syntactic sugar" method on GDALDataset like this:

    def GetSubDatasets(self):
        sd_list = []
        
        sd = self.GetMetadata('SUBDATASETS')
        if sd is None:
            return sd_list

        i = 1
        while sd.has_key('SUBDATASET_'+str(i)+'_NAME'):
            sd_list.append( ( sd['SUBDATASET_'+str(i)+'_NAME'],
                              sd['SUBDATASET_'+str(i)+'_DESC'] ) )
            i = i + 1
        return sd_list

This was not ported to the NG bindings. I'll do so...

Change History

Changed 4 years ago by warmerdam

  • status changed from new to closed
  • resolution set to fixed

This has been introduced into the NG bindings in trunk (r13769) and 1.5 branch (r13770).

It was tested interactively once, but there are no tests for this method in the test suite.

Note: See TracTickets for help on using tickets.