Ticket #2222 (closed defect: fixed)

Opened 3 months ago

Last modified 3 months ago

GetSubDatasets() sugar missing in NG python bindings

Reported by: warmerdam Assigned to: 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

02/12/08 17:12:59 changed 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.