Package osgeo :: Module gdal |
[hide private]
[frames] | no frames]

# Source Code for Module osgeo.gdal

       1  # This file was automatically generated by SWIG (http://www.swig.org).
       2  # Version 1.3.40
       3  #
       4  # Do not make changes to this file unless you know what you are doing--modify
       5  # the SWIG interface file instead.
       6  # This file is compatible with both classic and new-style classes.
       7
       8  from sys import version_info
       9  if version_info >= (2,6,0):
      10 -    def swig_import_helper():
      11          from os.path import dirname
      12          import imp
      13          fp = None
      14          try:
      15              fp, pathname, description = imp.find_module('_gdal', [dirname(__file__)])
      16          except ImportError:
      17              import _gdal
      18              return _gdal
      19          if fp is not None:
      20              try:
      21                  _mod = imp.load_module('_gdal', fp, pathname, description)
      22              finally:
      23                  fp.close()
      24              return _mod
      25      _gdal = swig_import_helper()
      26      del swig_import_helper
      27  else:
      28      import _gdal
      29  del version_info
      30  try:
      31      _swig_property = property
      32  except NameError:
      33      pass # Python < 2.2 doesn't have 'property'.
      34 -def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
      35      if (name == "thisown"): return self.this.own(value)
      36      if (name == "this"):
      37          if type(value).__name__ == 'SwigPyObject':
      38              self.__dict__[name] = value
      39              return
      40      method = class_type.__swig_setmethods__.get(name,None)
      41      if method: return method(self,value)
      42      if (not static) or hasattr(self,name):
      43          self.__dict__[name] = value
      44      else:
      45          raise AttributeError("You cannot add attributes to %s" % self)
      46
      47 -def _swig_setattr(self,class_type,name,value):
      48      return _swig_setattr_nondynamic(self,class_type,name,value,0)
      49
      50 -def _swig_getattr(self,class_type,name):
      51      if (name == "thisown"): return self.this.own()
      52      method = class_type.__swig_getmethods__.get(name,None)
      53      if method: return method(self)
      54      raise AttributeError(name)
      55
      56 -def _swig_repr(self):
      57      try: strthis = "proxy of " + self.this.__repr__()
      58      except: strthis = ""
      59      return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
      60
      61  try:
      62      _object = object
      63      _newclass = 1
      64  except AttributeError:
      65 -    class _object : pass
      66      _newclass = 0
      67
      68
      69  have_warned = 0
      70 -def deprecation_warn( module ):
      71    global have_warned
      72
      73    if have_warned == 1:
      74        return
      75
      76    have_warned = 1
      77
      78    from warnings import warn
      79    warn('%s.py was placed in a namespace, it is now available as osgeo.%s' % (module,module),
      80         DeprecationWarning)
      81
      82
      83  from gdalconst import *
      84  import gdalconst
      85
      86
      87  import sys
      88  byteorders = {"little": "<",
      89                "big": ">"}
      90  array_modes = { gdalconst.GDT_Int16:    ("%si2" % byteorders[sys.byteorder]),
      91                  gdalconst.GDT_UInt16:   ("%su2" % byteorders[sys.byteorder]),
      92                  gdalconst.GDT_Int32:    ("%si4" % byteorders[sys.byteorder]),
      93                  gdalconst.GDT_UInt32:   ("%su4" % byteorders[sys.byteorder]),
      94                  gdalconst.GDT_Float32:  ("%sf4" % byteorders[sys.byteorder]),
      95                  gdalconst.GDT_Float64:  ("%sf8" % byteorders[sys.byteorder]),
      96                  gdalconst.GDT_CFloat32: ("%sf4" % byteorders[sys.byteorder]),
      97                  gdalconst.GDT_CFloat64: ("%sf8" % byteorders[sys.byteorder]),
      98                  gdalconst.GDT_Byte:     ("%st8" % byteorders[sys.byteorder]),
      99  }
     100
     101 -def RGBFile2PCTFile( src_filename, dst_filename ):
     102    src_ds = Open(src_filename)
     103    if src_ds is None or src_ds == 'NULL':
     104        return 1
     105
     106    ct = ColorTable()
     107    err = ComputeMedianCutPCT( src_ds.GetRasterBand(1),
     108                               src_ds.GetRasterBand(2),
     109                               src_ds.GetRasterBand(3),
     110                               256, ct )
     111    if err != 0:
     112        return err
     113
     114    gtiff_driver = GetDriverByName('GTiff')
     115    if gtiff_driver is None:
     116        return 1
     117
     118    dst_ds = gtiff_driver.Create( dst_filename,
     119                                  src_ds.RasterXSize, src_ds.RasterYSize )
     120    dst_ds.GetRasterBand(1).SetRasterColorTable( ct )
     121
     122    err = DitherRGB2PCT( src_ds.GetRasterBand(1),
     123                         src_ds.GetRasterBand(2),
     124                         src_ds.GetRasterBand(3),
     125                         dst_ds.GetRasterBand(1),
     126                         ct )
     127    dst_ds = None
     128    src_ds = None
     129
     130    return 0
     131
     132
     133 -def GetUseExceptions(*args):
     134    """GetUseExceptions() -> int"""
     135    return _gdal.GetUseExceptions(*args)
     136
     137 -def UseExceptions(*args):
     138    """UseExceptions()"""
     139    return _gdal.UseExceptions(*args)
     140
     141 -def DontUseExceptions(*args):
     142    """DontUseExceptions()"""
     143    return _gdal.DontUseExceptions(*args)
     144
     145 -def VSIFReadL(*args):
     146    """VSIFReadL(int nMembSize, int nMembCount, VSILFILE fp) -> int"""
     147    return _gdal.VSIFReadL(*args)
     148 -def _is_str_or_unicode(o):
     149      return isinstance(o, str) or str(type(o)) == "<type 'unicode'>"
     150
     151 -def InfoOptions(options = [], format = 'text', deserialize = True,
     152           computeMinMax = False, reportHistograms = False, reportProj4 = False,
     153           stats = False, approxStats = False, computeChecksum = False,
     154           showGCPs = True, showMetadata = True, showRAT = True, showColorTable = True,
     155           listMDD = False, showFileList = True, allMetadata = False,
     156           extraMDDomains = None):
     157      """ Create a InfoOptions() object that can be passed to gdal.Info()
     158          options can be be an array of strings, a string or let empty and filled from other keywords."""
     159      import copy
     160
     161      if _is_str_or_unicode(options):
     162          new_options = ParseCommandLine(options)
     163          format = 'text'
     164          if '-json' in new_options:
     165              format = 'json'
     166      else:
     167          new_options = copy.copy(options)
     168          if format == 'json':
     169              new_options += ['-json']
     170          if computeMinMax:
     171              new_options += ['-mm']
     172          if reportHistograms:
     173              new_options += ['-hist']
     174          if reportProj4:
     175              new_options += ['-proj4']
     176          if stats:
     177              new_options += ['-stats']
     178          if approxStats:
     179              new_options += ['-approx_stats']
     180          if computeChecksum:
     181              new_options += ['-checksum']
     182          if not showGCPs:
     183              new_options += ['-nogcp']
     184          if not showMetadata:
     185              new_options += ['-nomd']
     186          if not showRAT:
     187              new_options += ['-norat']
     188          if not showColorTable:
     189              new_options += ['-noct']
     190          if listMDD:
     191              new_options += ['-listmdd']
     192          if not showFileList:
     193              new_options += ['-nofl']
     194          if allMetadata:
     195              new_options += ['-mdd', 'all']
     196          if extraMDDomains is not None:
     197              for mdd in extraMDDomains:
     198                  new_options += ['-mdd', mdd]
     199
     200      return (GDALInfoOptions(new_options), format, deserialize)
     201
     202 -def Info(ds, **kwargs):
     203      """ Return information on a dataset.
     204          Arguments are :
     205            ds --- a Dataset object or a filename
     206          Keyword arguments are :
     207            options --- return of gdal.InfoOptions(), string or array of strings
     208            other keywords arguments of gdal.InfoOptions()
     209          If options is provided as a gdal.InfoOptions() object, other keywords are ignored. """
     210      if not 'options' in kwargs or type(kwargs['options']) == type([]) or _is_str_or_unicode(kwargs['options']):
     211          (opts, format, deserialize) = InfoOptions(**kwargs)
     212      else:
     213          (opts, format, deserialize) = kwargs['options']
     214      if _is_str_or_unicode(ds):
     215          ds = Open(ds)
     216      ret = InfoInternal(ds, opts)
     217      if format == 'json' and deserialize:
     218          import json
     219          ret = json.loads(ret)
     220      return ret
     221
     222
     223 -def TranslateOptions(options = [], format = 'GTiff',
     224                outputType = GDT_Unknown, bandList = None, maskBand = None,
     225                width = 0, height = 0, widthPct = 0.0, heightPct = 0.0,
     226                xRes = 0.0, yRes = 0.0,
     227                creationOptions = None, srcWin = None, projWin = None, projWinSRS = None, strict = False,
     228                unscale = False, scaleParams = None, exponents = None,
     229                outputBounds = None, metadataOptions = None,
     230                outputSRS = None, GCPs = None,
     231                noData = None, rgbExpand = None,
     232                stats = False, rat = True, resampleAlg = None,
     233                callback = None, callback_data = None):
     234      """ Create a TranslateOptions() object that can be passed to gdal.Translate()
     235          Keyword arguments are :
     236            options --- can be be an array of strings, a string or let empty and filled from other keywords.
     237            format --- output format ("GTiff", etc...)
     238            outputType --- output type (gdal.GDT_Byte, etc...)
     239            bandList --- array of band numbers (index start at 1)
     240            maskBand --- mask band to generate or not ("none", "auto", "mask", 1, ...)
     241            width --- width of the output raster in pixel
     242            height --- height of the output raster in pixel
     243            widthPct --- width of the output raster in percentage (100 = original width)
     244            heightPct --- height of the output raster in percentage (100 = original height)
     245            xRes --- output horizontal resolution
     246            yRes --- output vertical resolution
     247            creationOptions --- list of creation options
     248            srcWin --- subwindow in pixels to extract: [left_x, top_y, width, height]
     249            projWin --- subwindow in projected coordinates to extract: [ulx, uly, lrx, lry]
     250            projWinSRS --- SRS in which projWin is expressed
     251            strict --- strict mode
     252            unscale --- unscale values with scale and offset metadata
     253            scaleParams --- list of scale parameters, each of the form [src_min,src_max] or [src_min,src_max,dst_min,dst_max]
     254            exponents --- list of exponentiation parameters
     255            outputBounds --- assigned output bounds: [ulx, uly, lrx, lry]
     256            metadataOptions --- list of metadata options
     257            outputSRS --- assigned output SRS
     258            GCPs --- list of GCPs
     259            noData --- nodata value (or "none" to unset it)
     260            rgbExpand --- Color palette expansion mode: "gray", "rgb", "rgba"
     261            stats --- whether to calculate statistics
     262            rat --- whether to write source RAT
     263            resampleAlg --- resampling mode
     264            callback --- callback method
     265            callback_data --- user data for callback
     266      """
     267      import copy
     268
     269      if _is_str_or_unicode(options):
     270          new_options = ParseCommandLine(options)
     271      else:
     272          new_options = copy.copy(options)
     273          new_options += ['-of', format]
     274          if outputType != GDT_Unknown:
     275              new_options += ['-ot', GetDataTypeName(outputType) ]
     276          if maskBand != None:
     277              new_options += ['-mask', str(maskBand) ]
     278          if bandList != None:
     279              for b in bandList:
     280                  new_options += ['-b', str(b) ]
     281          if width != 0 or height != 0:
     282              new_options += ['-outsize', str(width), str(height)]
     283          elif widthPct != 0 and heightPct != 0:
     284              new_options += ['-outsize', str(widthPct) + '%%', str(heightPct) + '%%']
     285          if creationOptions is not None:
     286              for opt in creationOptions:
     287                  new_options += ['-co', opt ]
     288          if srcWin is not None:
     289              new_options += ['-srcwin', str(srcWin[0]), str(srcWin[1]), str(srcWin[2]), str(srcWin[3])]
     290          if strict:
     291              new_options += ['-strict']
     292          if unscale:
     293              new_options += ['-unscale']
     294          if scaleParams:
     295              for scaleParam in scaleParams:
     296                  new_options += ['-scale']
     297                  for v in scaleParam:
     298                      new_options += [ str(v) ]
     299          if exponents:
     300              for exponent in exponents:
     301                  new_options += ['-exponent', str(exponent)]
     302          if outputBounds is not None:
     303              new_options += ['-a_ullr', str(outputBounds[0]), str(outputBounds[1]), str(outputBounds[2]), str(outputBounds[3])]
     304          if metadataOptions is not None:
     305              for opt in metadataOptions:
     306                  new_options += ['-mo', opt ]
     307          if outputSRS is not None:
     308              new_options += ['-a_srs', str(outputSRS) ]
     309          if GCPs is not None:
     310              for gcp in GCPs:
     311                  new_options += ['-gcp', str(gcp.GCPPixel), str(gcp.GCPLine), str(gcp.GCPX), str(gcp.GCPY), str(gcp.GCPZ) ]
     312          if projWin is not None:
     313              new_options += ['-projwin', str(projWin[0]), str(projWin[1]), str(projWin[2]), str(projWin[3])]
     314          if projWinSRS is not None:
     315              new_options += ['-projwin_srs', str(projWinSRS) ]
     316          if noData is not None:
     317              new_options += ['-a_nodata', str(noData) ]
     318          if rgbExpand is not None:
     319              new_options += ['-expand', str(rgbExpand) ]
     320          if stats:
     321              new_options += ['-stats']
     322          if not rat:
     323              new_options += ['-norat']
     324          if resampleAlg is not None:
     325              if resampleAlg == GRA_NearestNeighbour:
     326                  new_options += ['-r', 'near']
     327              elif resampleAlg == GRA_Bilinear:
     328                  new_options += ['-r', 'bilinear']
     329              elif resampleAlg == GRA_Cubic:
     330                  new_options += ['-r', 'cubic']
     331              elif resampleAlg == GRA_CubicSpline:
     332                  new_options += ['-r', 'cubicspline']
     333              elif resampleAlg == GRA_Lanczos:
     334                  new_options += ['-r', 'lanczos']
     335              elif resampleAlg == GRA_Average:
     336                  new_options += ['-r', 'average']
     337              elif resampleAlg == GRA_Mode:
     338                  new_options += ['-r', 'mode']
     339              else:
     340                  new_options += ['-r', str(resampleAlg) ]
     341          if xRes != 0 and yRes != 0:
     342              new_options += ['-tr', str(xRes), str(yRes) ]
     343
     344      return (GDALTranslateOptions(new_options), callback, callback_data)
     345
     346 -def Translate(destName, srcDS, **kwargs):
     347      """ Convert a dataset.
     348          Arguments are :
     349            destName --- Output dataset name
     350            srcDS --- a Dataset object or a filename
     351          Keyword arguments are :
     352            options --- return of gdal.InfoOptions(), string or array of strings
     353            other keywords arguments of gdal.TranslateOptions()
     354          If options is provided as a gdal.TranslateOptions() object, other keywords are ignored. """
     355
     356      if not 'options' in kwargs or type(kwargs['options']) == type([]) or _is_str_or_unicode(kwargs['options']):
     357          (opts, callback, callback_data) = TranslateOptions(**kwargs)
     358      else:
     359          (opts, callback, callback_data) = kwargs['options']
     360      if _is_str_or_unicode(srcDS):
     361          srcDS = Open(srcDS)
     362
     363      return TranslateInternal(destName, srcDS, opts, callback, callback_data)
     364
     365 -def WarpOptions(options = [], format = 'GTiff',
     366           outputBounds = None,
     367           outputBoundsSRS = None,
     368           xRes = None, yRes = None, targetAlignedPixels = False,
     369           width = 0, height = 0,
     370           srcSRS = None, dstSRS = None,
     371           srcAlpha = False, dstAlpha = False,
     372           warpOptions = None, errorThreshold = None,
     373           warpMemoryLimit = None, creationOptions = None, outputType = GDT_Unknown,
     374           workingType = GDT_Unknown, resampleAlg = None,
     375           srcNodata = None, dstNodata = None, multithread = False,
     376           tps = False, rpc = False, geoloc = False, polynomialOrder = None,
     377           transformerOptions = None, cutlineDSName = None,
     378           cutlineLayer = None, cutlineWhere = None, cutlineSQL = None, cutlineBlend = None, cropToCutline = False,
     379           copyMetadata = True, metadataConflictValue = None,
     380           setColorInterpretation = False,
     381           callback = None, callback_data = None):
     382      """ Create a WarpOptions() object that can be passed to gdal.Warp()
     383          Keyword arguments are :
     384            options --- can be be an array of strings, a string or let empty and filled from other keywords.
     385            format --- output format ("GTiff", etc...)
     386            outputBounds --- output bounds as (minX, minY, maxX, maxY) in target SRS
     387            outputBoundsSRS --- SRS in which output bounds are expressed, in the case they are not expressed in dstSRS
     388            xRes, yRes --- output resolution in target SRS
     389            targetAlignedPixels --- whether to force output bounds to be multiple of output resolution
     390            width --- width of the output raster in pixel
     391            height --- height of the output raster in pixel
     392            srcSRS --- source SRS
     393            dstSRS --- output SRS
     394            srcAlpha --- whether to force the last band of the input dataset to be considered as an alpha band
     395            dstAlpha --- whether to force the creation of an output alpha band
     396            outputType --- output type (gdal.GDT_Byte, etc...)
     397            workingType --- working type (gdal.GDT_Byte, etc...)
     398            warpOptions --- list of warping options
     399            errorThreshold --- error threshold for approximation transformer (in pixels)
     400            warpMemoryLimit --- size of working buffer in bytes
     401            resampleAlg --- resampling mode
     402            creationOptions --- list of creation options
     403            srcNodata --- source nodata value(s)
     404            dstNodata --- output nodata value(s)
     405            multithread --- whether to multithread computation and I/O operations
     406            tps --- whether to use Thin Plate Spline GCP transformer
     407            rpc --- whether to use RPC transformer
     408            geoloc --- whether to use GeoLocation array transformer
     409            polynomialOrder --- order of polynomial GCP interpolation
     410            transformerOptions --- list of transformer options
     411            cutlineDSName --- cutline dataset name
     412            cutlineLayer --- cutline layer name
     413            cutlineWhere --- cutline WHERE clause
     414            cutlineSQL --- cutline SQL statement
     415            cutlineBlend --- cutline blend distance in pixels
     416            cropToCutline --- whether to use cutline extent for output bounds
     417            copyMetadata --- whether to copy source metadata
     418            metadataConflictValue --- metadata data conflict value
     419            setColorInterpretation --- whether to force color interpretation of input bands to output bands
     420            callback --- callback method
     421            callback_data --- user data for callback
     422      """
     423      import copy
     424
     425      if _is_str_or_unicode(options):
     426          new_options = ParseCommandLine(options)
     427      else:
     428          new_options = copy.copy(options)
     429          new_options += ['-of', format]
     430          if outputType != GDT_Unknown:
     431              new_options += ['-ot', GetDataTypeName(outputType) ]
     432          if workingType != GDT_Unknown:
     433              new_options += ['-wt', GetDataTypeName(workingType) ]
     434          if outputBounds is not None:
     435              new_options += ['-te', str(outputBounds[0]), str(outputBounds[1]), str(outputBounds[2]), str(outputBounds[3]) ]
     436          if outputBoundsSRS is not None:
     437              new_options += ['-te_srs', str(outputBoundsSRS) ]
     438          if xRes is not None and yRes is not None:
     439              new_options += ['-tr', str(xRes), str(yRes) ]
     440          if width != 0 or height != 0:
     441              new_options += ['-ts', str(width), str(height)]
     442          if srcSRS is not None:
     443              new_options += ['-s_srs', str(srcSRS) ]
     444          if dstSRS is not None:
     445              new_options += ['-t_srs', str(dstSRS) ]
     446          if targetAlignedPixels:
     447              new_options += ['-tap']
     448          if srcAlpha:
     449              new_options += ['-srcalpha']
     450          if dstAlpha:
     451              new_options += ['-dstalpha']
     452          if warpOptions is not None:
     453              for opt in warpOptions:
     454                  new_options += ['-wo', str(opt)]
     455          if errorThreshold is not None:
     456              new_options += ['-et', str(errorThreshold)]
     457          if resampleAlg is not None:
     458              if resampleAlg == GRIORA_NearestNeighbour:
     459                  new_options += ['-r', 'near']
     460              elif resampleAlg == GRIORA_Bilinear:
     461                  new_options += ['-rb']
     462              elif resampleAlg == GRIORA_Cubic:
     463                  new_options += ['-rc']
     464              elif resampleAlg == GRIORA_CubicSpline:
     465                  new_options += ['-rcs']
     466              elif resampleAlg == GRIORA_Lanczos:
     467                  new_options += ['-r', 'lanczos']
     468              elif resampleAlg == GRIORA_Average:
     469                  new_options += ['-r', 'average']
     470              elif resampleAlg == GRIORA_Mode:
     471                  new_options += ['-r', 'mode']
     472              elif resampleAlg == GRIORA_Gauss:
     473                  new_options += ['-r', 'gauss']
     474              else:
     475                  new_options += ['-r', str(resampleAlg) ]
     476          if warpMemoryLimit is not None:
     477              new_options += ['-wm', str(warpMemoryLimit) ]
     478          if creationOptions is not None:
     479              for opt in creationOptions:
     480                  new_options += ['-co', opt ]
     481          if srcNodata is not None:
     482              new_options += ['-srcnodata', str(srcNodata) ]
     483          if dstNodata is not None:
     484              new_options += ['-dstnodata', str(dstNodata) ]
     485          if multithread:
     486              new_options += ['-multi']
     487          if tps:
     488              new_options += ['-tps']
     489          if rpc:
     490              new_options += ['-rpc']
     491          if geoloc:
     492              new_options += ['-geoloc']
     493          if polynomialOrder is not None:
     494              new_options += ['-order', str(polynomialOrder)]
     495          if transformerOptions is not None:
     496              for opt in transformerOptions:
     497                  new_options += ['-to', opt ]
     498          if cutlineDSName is not None:
     499              new_options += ['-cutline', str(cutlineDSName) ]
     500          if cutlineLayer is not None:
     501              new_options += ['-cl', str(cutlineLayer) ]
     502          if cutlineWhere is not None:
     503              new_options += ['-cwhere', str(cutlineWhere) ]
     504          if cutlineSQL is not None:
     505              new_options += ['-csql', str(cutlineSQL) ]
     506          if cutlineBlend is not None:
     507              new_options += ['-cblend', str(cutlineBlend) ]
     508          if cropToCutline:
     509              new_options += ['-crop_to_cutline']
     510          if not copyMetadata:
     511              new_options += ['-nomd']
     512          if metadataConflictValue:
     513              new_options += ['-cvmd', str(metadataConflictValue) ]
     514          if setColorInterpretation:
     515              new_options += ['-setci']
     516
     517      return (GDALWarpAppOptions(new_options), callback, callback_data)
     518
     519 -def Warp(destNameOrDestDS, srcDSOrSrcDSTab, **kwargs):
     520      """ Warp one or several datasets.
     521          Arguments are :
     522            destNameOrDestDS --- Output dataset name or object
     523            srcDSOrSrcDSTab --- an array of Dataset objects or filenames, or a Dataset object or a filename
     524          Keyword arguments are :
     525            options --- return of gdal.InfoOptions(), string or array of strings
     526            other keywords arguments of gdal.WarpOptions()
     527          If options is provided as a gdal.WarpOptions() object, other keywords are ignored. """
     528
     529      if not 'options' in kwargs or type(kwargs['options']) == type([]) or _is_str_or_unicode(kwargs['options']):
     530          (opts, callback, callback_data) = WarpOptions(**kwargs)
     531      else:
     532          (opts, callback, callback_data) = kwargs['options']
     533      if _is_str_or_unicode(srcDSOrSrcDSTab):
     534          srcDSTab = [Open(srcDSOrSrcDSTab)]
     535      elif type(srcDSOrSrcDSTab) == type([]):
     536          srcDSTab = []
     537          for elt in srcDSOrSrcDSTab:
     538              if _is_str_or_unicode(elt):
     539                  srcDSTab.append(Open(elt))
     540              else:
     541                  srcDSTab.append(elt)
     542      else:
     543          srcDSTab = [ srcDSOrSrcDSTab ]
     544
     545      if _is_str_or_unicode(destNameOrDestDS):
     546          return wrapper_GDALWarpDestName(destNameOrDestDS, srcDSTab, opts, callback, callback_data)
     547      else:
     548          return wrapper_GDALWarpDestDS(destNameOrDestDS, srcDSTab, opts, callback, callback_data)
     549
     550
     551 -def VectorTranslateOptions(options = [], format = 'ESRI Shapefile',
     552           accessMode = None,
     553           srcSRS = None, dstSRS = None, reproject = True,
     554           SQLStatement = None, SQLDialect = None, where = None, selectFields = None, spatFilter = None,
     555           datasetCreationOptions = None,
     556           layerCreationOptions = None,
     557           layers = None,
     558           layerName = None,
     559           geometryType = None,
     560           dim = None,
     561           segmentizeMaxDist= None,
     562           zField = None,
     563           skipFailures = False,
     564           callback = None, callback_data = None):
     565      """ Create a VectorTranslateOptions() object that can be passed to gdal.VectorTranslate()
     566          Keyword arguments are :
     567            options --- can be be an array of strings, a string or let empty and filled from other keywords.
     568            format --- output format ("ESRI Shapefile", etc...)
     569            accessMode --- None for creation, 'update', 'append', 'overwrite'
     570            srcSRS --- source SRS
     571            dstSRS --- output SRS (with reprojection if reproject = True)
     572            reproject --- whether to do reprojection
     573            SQLStatement --- SQL statement to apply to the source dataset
     574            SQLDialect --- SQL dialect ('OGRSQL', 'SQLITE', ...)
     575            where --- WHERE clause to apply to source layer(s)
     576            selectFields --- list of fields to select
     577            spatFilter --- spatial filter as (minX, minY, maxX, maxY) bounding box
     578            datasetCreationOptions --- list of dataset creation options
     579            layerCreationOptions --- list of layer creation options
     580            layers --- list of layers to convert
     581            layerName --- output layer name
     582            geometryType --- output layer geometry type ('POINT', ....)
     583            dim --- output dimension ('XY', 'XYZ', 'XYM', 'XYZM', 'layer_dim')
     584            segmentizeMaxDist --- maximum distance between consecutive nodes of a line geometry
     585            zField --- name of field to use to set the Z component of geometries
     586            skipFailures --- whether to skip failures
     587            callback --- callback method
     588            callback_data --- user data for callback
     589      """
     590      import copy
     591
     592      if _is_str_or_unicode(options):
     593          new_options = ParseCommandLine(options)
     594      else:
     595          new_options = copy.copy(options)
     596          new_options += ['-f', format]
     597          if srcSRS is not None:
     598              new_options += ['-s_srs', str(srcSRS) ]
     599          if dstSRS is not None:
     600              if reproject:
     601                  new_options += ['-t_srs', str(dstSRS) ]
     602              else:
     603                  new_options += ['-a_srs', str(dstSRS) ]
     604          if SQLStatement is not None:
     605              new_options += ['-sql', str(SQLStatement) ]
     606          if SQLDialect is not None:
     607              new_options += ['-dialect', str(SQLDialect) ]
     608          if where is not None:
     609              new_options += ['-where', str(where) ]
     610          if accessMode is not None:
     611              if accessMode == 'update':
     612                  new_options += ['-update']
     613              elif accessMode == 'append':
     614                  new_options += ['-append']
     615              elif accessMode == 'overwrite':
     616                  new_options += ['-overwrite']
     617              else:
     618                  raise Exception('unhandled accessMode')
     619          if selectFields is not None:
     620              val = ''
     621              for item in selectFields:
     622                  if len(val)>0:
     623                      val += ','
     624                  val += item
     625              new_options += ['-select', val]
     626          if datasetCreationOptions is not None:
     627              for opt in datasetCreationOptions:
     628                  new_options += ['-dsco', opt ]
     629          if layerCreationOptions is not None:
     630              for opt in layerCreationOptions:
     631                  new_options += ['-lco', opt ]
     632          if layers is not None:
     633              for lyr in layers:
     634                  new_options += [ lyr ]
     635          if segmentizeMaxDist is not None:
     636              new_options += ['-segmentize', str(segmentizeMaxDist) ]
     637          if spatFilter is not None:
     638              new_options += ['-spat', str(spatFilter[0]), str(spatFilter[1]), str(spatFilter[2]), str(spatFilter[3]) ]
     639          if layerName is not None:
     640              new_options += ['-nln', layerName]
     641          if geometryType is not None:
     642              new_options += ['-nlt', geometryType]
     643          if dim is not None:
     644              new_options += ['-dim', dim]
     645          if zField is not None:
     646              new_options += ['-zfield', zField]
     647          if skipFailures:
     648              new_options += ['-skip']
     649
     650      if callback is not None:
     651          new_options += [ '-progress' ]
     652
     653      return (GDALVectorTranslateOptions(new_options), callback, callback_data)
     654
     655 -def VectorTranslate(destNameOrDestDS, srcDS, **kwargs):
     656      """ Convert one vector dataset
     657          Arguments are :
     658            destNameOrDestDS --- Output dataset name or object
     659            srcDS --- a Dataset object or a filename
     660          Keyword arguments are :
     661            options --- return of gdal.InfoOptions(), string or array of strings
     662            other keywords arguments of gdal.VectorTranslateOptions()
     663          If options is provided as a gdal.VectorTranslateOptions() object, other keywords are ignored. """
     664
     665      if not 'options' in kwargs or type(kwargs['options']) == type([]) or _is_str_or_unicode(kwargs['options']):
     666          (opts, callback, callback_data) = VectorTranslateOptions(**kwargs)
     667      else:
     668          (opts, callback, callback_data) = kwargs['options']
     669      if _is_str_or_unicode(srcDS):
     670          srcDS = OpenEx(srcDS)
     671
     672      if _is_str_or_unicode(destNameOrDestDS):
     673          return wrapper_GDALVectorTranslateDestName(destNameOrDestDS, srcDS, opts, callback, callback_data)
     674      else:
     675          return wrapper_GDALVectorTranslateDestDS(destNameOrDestDS, srcDS, opts, callback, callback_data)
     676
     677 -def DEMProcessingOptions(options = [], colorFilename = None, format = 'GTiff',
     678                creationOptions = None, computeEdges = False, alg = 'Horn', band = 1,
     679                zFactor = None, scale = None, azimuth = None, altitude = None, combined = False,
     680                slopeFormat = None, trigonometric = False, zeroForFlat = False,
     681                callback = None, callback_data = None):
     682      """ Create a DEMProcessingOptions() object that can be passed to gdal.DEMProcessing()
     683          Keyword arguments are :
     684            options --- can be be an array of strings, a string or let empty and filled from other keywords.
     685            colorFilename --- (mandatory for "color-relief") name of file that contains palette definition for the "color-relief" processing.
     686            format --- output format ("GTiff", etc...)
     687            creationOptions --- list of creation options
     688            computeEdges --- whether to compute values at raster edges.
     689            alg --- 'ZevenbergenThorne' or 'Horn'
     690            band --- source band number to use
     691            zFactor --- (hillshade only) vertical exaggeration used to pre-multiply the elevations.
     692            scale --- ratio of vertical units to horizontal.
     693            azimuth --- (hillshade only) azimuth of the light, in degrees. 0 if it comes from the top of the raster, 90 from the east, ... The default value, 315, should rarely be changed as it is the value generally used to generate shaded maps.
     694            altitude ---(hillshade only) altitude of the light, in degrees. 90 if the light comes from above the DEM, 0 if it is raking light.
     695            combined --- (hillshade only) whether to compute combined shading, a combination of slope and oblique shading.
     696            slopeformat --- (slope only) "degree" or "percent".
     697            trigonometric --- (aspect only) whether to return trigonometric angle instead of azimuth. Thus 0deg means East, 90deg North, 180deg West, 270deg South.
     698            zeroForFlat --- (aspect only) whether to return 0 for flat areas with slope=0, instead of -9999.
     699            callback --- callback method
     700            callback_data --- user data for callback
     701      """
     702      import copy
     703
     704      if _is_str_or_unicode(options):
     705          new_options = ParseCommandLine(options)
     706      else:
     707          new_options = copy.copy(options)
     708          new_options += ['-of', format]
     709          if creationOptions is not None:
     710              for opt in creationOptions:
     711                  new_options += ['-co', opt ]
     712          if computeEdges:
     713              new_options += ['-compute_edges' ]
     714          if alg ==  'ZevenbergenThorne':
     715              new_options += ['-alg', 'ZevenbergenThorne']
     716          new_options += ['-b', str(band) ]
     717          if zFactor is not None:
     718              new_options += ['-z', str(zFactor) ]
     719          if scale is not None:
     720              new_options += ['-s', str(scale) ]
     721          if azimuth is not None:
     722              new_options += ['-az', str(azimuth) ]
     723          if altitude is not None:
     724              new_options += ['-alt', str(altitude) ]
     725          if combined:
     726              new_options += ['-combined' ]
     727          if slopeFormat == 'percent':
     728              new_options += ['-p' ]
     729          if trigonometric:
     730              new_options += ['-trigonometric' ]
     731          if zeroForFlat:
     732              new_options += ['zero_for_flat' ]
     733
     734      return (GDALDEMProcessingOptions(new_options), colorFilename, callback, callback_data)
     735
     736 -def DEMProcessing(destName, srcDS, processing, **kwargs):
     737      """ Apply a DEM processing.
     738          Arguments are :
     739            destName --- Output dataset name
     740            srcDS --- a Dataset object or a filename
     741            processing --- one of "hillshade", "slope", "aspect", "color-relief", "TRI", "TPI", "Roughness"
     742          Keyword arguments are :
     743            options --- return of gdal.InfoOptions(), string or array of strings
     744            other keywords arguments of gdal.DEMProcessingOptions()
     745          If options is provided as a gdal.DEMProcessingOptions() object, other keywords are ignored. """
     746
     747      if not 'options' in kwargs or type(kwargs['options']) == type([]) or _is_str_or_unicode(kwargs['options']):
     748          (opts, colorFilename, callback, callback_data) = DEMProcessingOptions(**kwargs)
     749      else:
     750          (opts, colorFilename, callback, callback_data) = kwargs['options']
     751      if _is_str_or_unicode(srcDS):
     752          srcDS = Open(srcDS)
     753
     754      return DEMProcessingInternal(destName, srcDS, processing, colorFilename, opts, callback, callback_data)
     755
     756
     757 -def NearblackOptions(options = [], format = 'GTiff',
     758           creationOptions = None, white = False, colors = None,
     759           maxNonBlack = None, nearDist = None, setAlpha = False, setMask = False,
     760           callback = None, callback_data = None):
     761      """ Create a NearblackOptions() object that can be passed to gdal.Nearblack()
     762          Keyword arguments are :
     763            options --- can be be an array of strings, a string or let empty and filled from other keywords.
     764            format --- output format ("GTiff", etc...)
     765            creationOptions --- list of creation options
     766            white --- whether to search for nearly white (255) pixels instead of nearly black pixels.
     767            colors --- list of colors  to search for, e.g. ((0,0,0),(255,255,255)). The pixels that are considered as the collar are set to 0
     768            maxNonBlack --- number of non-black (or other searched colors specified with white / colors) pixels that can be encountered before the giving up search inwards. Defaults to 2.
     769            nearDist --- select how far from black, white or custom colors the pixel values can be and still considered near black, white or custom color.  Defaults to 15.
     770            setAlpha --- adds an alpha band if the output file.
     771            setMask --- adds a mask band to the output file.
     772            callback --- callback method
     773            callback_data --- user data for callback
     774      """
     775      import copy
     776
     777      if _is_str_or_unicode(options):
     778          new_options = ParseCommandLine(options)
     779      else:
     780          new_options = copy.copy(options)
     781          new_options += ['-of', format]
     782          if creationOptions is not None:
     783              for opt in creationOptions:
     784                  new_options += ['-co', opt ]
     785          if white:
     786              new_options += ['-white']
     787          if colors is not None:
     788              for color in colors:
     789                  color_str = ''
     790                  for cpt in color:
     791                      if color_str != '':
     792                          color_str += ','
     793                      color_str += str(cpt)
     794                  new_options += ['-color',color_str]
     795          if maxNonBlack is not None:
     796              new_options += ['-nb', str(maxNonBlack) ]
     797          if nearDist is not None:
     798              new_options += ['-near', str(nearDist) ]
     799          if setAlpha:
     800              new_options += ['-setalpha']
     801          if setMask:
     802              new_options += ['-setmask']
     803
     804      return (GDALNearblackOptions(new_options), callback, callback_data)
     805
     806 -def Nearblack(destNameOrDestDS, srcDS, **kwargs):
     807      """ Convert nearly black/white borders to exact value.
     808          Arguments are :
     809            destNameOrDestDS --- Output dataset name or object
     810            srcDS --- a Dataset object or a filename
     811          Keyword arguments are :
     812            options --- return of gdal.InfoOptions(), string or array of strings
     813            other keywords arguments of gdal.NearblackOptions()
     814          If options is provided as a gdal.NearblackOptions() object, other keywords are ignored. """
     815
     816      if not 'options' in kwargs or type(kwargs['options']) == type([]) or _is_str_or_unicode(kwargs['options']):
     817          (opts, callback, callback_data) = NearblackOptions(**kwargs)
     818      else:
     819          (opts, callback, callback_data) = kwargs['options']
     820      if _is_str_or_unicode(srcDS):
     821          srcDS = OpenEx(srcDS)
     822
     823      if _is_str_or_unicode(destNameOrDestDS):
     824          return wrapper_GDALNearblackDestName(destNameOrDestDS, srcDS, opts, callback, callback_data)
     825      else:
     826          return wrapper_GDALNearblackDestDS(destNameOrDestDS, srcDS, opts, callback, callback_data)
     827
     828
     829 -def GridOptions(options = [], format = 'GTiff',
     830                outputType = GDT_Unknown,
     831                width = 0, height = 0,
     832                creationOptions = None,
     833                outputBounds = None,
     834                outputSRS = None,
     835                noData = None,
     836                algorithm = None,
     837                layers = None,
     838                SQLStatement = None,
     839                where = None,
     840                spatFilter = None,
     841                zfield = None,
     842                z_increase = None,
     843                z_multiply = None,
     844                callback = None, callback_data = None):
     845      """ Create a GridOptions() object that can be passed to gdal.Grid()
     846          Keyword arguments are :
     847            options --- can be be an array of strings, a string or let empty and filled from other keywords.
     848            format --- output format ("GTiff", etc...)
     849            outputType --- output type (gdal.GDT_Byte, etc...)
     850            width --- width of the output raster in pixel
     851            height --- height of the output raster in pixel
     852            creationOptions --- list of creation options
     853            outputBounds --- assigned output bounds: [ulx, uly, lrx, lry]
     854            outputSRS --- assigned output SRS
     855            noData --- nodata value
     856            algorithm --- e.g "invdist:power=2.0:smoothing=0.0:radius1=0.0:radius2=0.0:angle=0.0:max_points=0:min_points=0:nodata=0.0"
     857            layers --- list of layers to convert
     858            SQLStatement --- SQL statement to apply to the source dataset
     859            where --- WHERE clause to apply to source layer(s)
     860            spatFilter --- spatial filter as (minX, minY, maxX, maxY) bounding box
     861            zfield --- Identifies an attribute field on the features to be used to get a Z value from. This value overrides Z value read from feature geometry record.
     862            z_increase --- Addition to the attribute field on the features to be used to get a Z value from. The addition should be the same unit as Z value. The result value will be Z value + Z increase value. The default value is 0.
     863            z_multiply - Multiplication ratio for Z field. This can be used for shift from e.g. foot to meters or from  elevation to deep. The result value will be (Z value + Z increase value) * Z multiply value.  The default value is 1.
     864            callback --- callback method
     865            callback_data --- user data for callback
     866      """
     867      import copy
     868
     869      if _is_str_or_unicode(options):
     870          new_options = ParseCommandLine(options)
     871      else:
     872          new_options = copy.copy(options)
     873          new_options += ['-of', format]
     874          if outputType != GDT_Unknown:
     875              new_options += ['-ot', GetDataTypeName(outputType) ]
     876          if width != 0 or height != 0:
     877              new_options += ['-outsize', str(width), str(height)]
     878          if creationOptions is not None:
     879              for opt in creationOptions:
     880                  new_options += ['-co', opt ]
     881          if outputBounds is not None:
     882              new_options += ['-txe', str(outputBounds[0]), str(outputBounds[2]), '-tye', str(outputBounds[1]), str(outputBounds[3])]
     883          if outputSRS is not None:
     884              new_options += ['-a_srs', str(outputSRS) ]
     885          if algorithm is not None:
     886              new_options += ['-a', algorithm ]
     887          if layers is not None:
     888              if type(layers) == type(()) or type(layers) == type([]):
     889                  for layer in layers:
     890                      new_options += ['-l', layer]
     891              else:
     892                  new_options += ['-l', layers]
     893          if SQLStatement is not None:
     894              new_options += ['-sql', str(SQLStatement) ]
     895          if where is not None:
     896              new_options += ['-where', str(where) ]
     897          if zfield is not None:
     898              new_options += ['-zfield', zfield ]
     899          if z_increase is not None:
     900              new_options += ['-z_increase', str(z_increase) ]
     901          if z_multiply is not None:
     902              new_options += ['-z_multiply', str(z_multiply) ]
     903          if spatFilter is not None:
     904              new_options += ['-spat', str(spatFilter[0]), str(spatFilter[1]), str(spatFilter[2]), str(spatFilter[3]) ]
     905
     906      return (GDALGridOptions(new_options), callback, callback_data)
     907
     908 -def Grid(destName, srcDS, **kwargs):
     909      """ Create raster from the scattered data.
     910          Arguments are :
     911            destName --- Output dataset name
     912            srcDS --- a Dataset object or a filename
     913          Keyword arguments are :
     914            options --- return of gdal.InfoOptions(), string or array of strings
     915            other keywords arguments of gdal.GridOptions()
     916          If options is provided as a gdal.GridOptions() object, other keywords are ignored. """
     917
     918      if not 'options' in kwargs or type(kwargs['options']) == type([]) or _is_str_or_unicode(kwargs['options']):
     919          (opts, callback, callback_data) = GridOptions(**kwargs)
     920      else:
     921          (opts, callback, callback_data) = kwargs['options']
     922      if _is_str_or_unicode(srcDS):
     923          srcDS = OpenEx(srcDS, OF_VECTOR)
     924
     925      return GridInternal(destName, srcDS, opts, callback, callback_data)
     926
     927 -def RasterizeOptions(options = [], format = None,
     928           creationOptions = None, noData = None, initValues = None,
     929           outputBounds = None, outputSRS = None,
     930           width = None, height = None,
     931           xRes = None, yRes = None, targetAlignedPixels = False,
     932           bands = None, inverse = False, allTouched = False,
     933           burnValues = None, attribute = None, useZ = False, layers = None,
     934           SQLStatement = None, SQLDialect = None, where = None,
     935           callback = None, callback_data = None):
     936      """ Create a RasterizeOptions() object that can be passed to gdal.Rasterize()
     937          Keyword arguments are :
     938            options --- can be be an array of strings, a string or let empty and filled from other keywords.
     939            format --- output format ("GTiff", etc...)
     940            creationOptions --- list of creation options
     941            outputBounds --- assigned output bounds: [minx, miny, maxx, maxy]
     942            outputSRS --- assigned output SRS
     943            width --- width of the output raster in pixel
     944            height --- height of the output raster in pixel
     945            xRes, yRes --- output resolution in target SRS
     946            targetAlignedPixels --- whether to force output bounds to be multiple of output resolution
     947            noData --- nodata value
     948            initValues --- Value or list of values to pre-initialize the output image bands with.  However, it is not marked as the nodata value in the output file.  If only one value is given, the same value is used in all the bands.
     949            bands --- list of output bands to burn values into
     950            inverse --- whether to invert rasterization, i.e. burn the fixed burn value, or the burn value associated  with the first feature into all parts of the image not inside the provided a polygon.
     951            allTouched -- whether to enable the ALL_TOUCHED rasterization option so that all pixels touched by lines or polygons will be updated, not just those on the line render path, or whose center point is within the polygon.
     952            burnValues -- list of fixed values to burn into each band for all objects. Excusive with attribute.
     953            attribute --- identifies an attribute field on the features to be used for a burn-in value. The value will be burned into all output bands. Excusive with burnValues.
     954            useZ --- whether to indicate that a burn value should be extracted from the "Z" values of the feature. These values are added to the burn value given by burnValues or attribute if provided. As of now, only points and lines are drawn in 3D.
     955            layers --- list of layers from the datasource that will be used for input features.
     956            SQLStatement --- SQL statement to apply to the source dataset
     957            SQLDialect --- SQL dialect ('OGRSQL', 'SQLITE', ...)
     958            where --- WHERE clause to apply to source layer(s)
     959            callback --- callback method
     960            callback_data --- user data for callback
     961      """
     962      import copy
     963
     964      if _is_str_or_unicode(options):
     965          new_options = ParseCommandLine(options)
     966      else:
     967          new_options = copy.copy(options)
     968          if format is not None:
     969              new_options += ['-of', format]
     970          if creationOptions is not None:
     971              for opt in creationOptions:
     972                  new_options += ['-co', opt ]
     973          if bands is not None:
     974              for b in bands:
     975                  new_options += ['-b', str(b) ]
     976          if noData is not None:
     977              new_options += ['-a_nodata', str(noData) ]
     978          if initValues is not None:
     979              if type(initValues) == type(()) or type(initValues) == type([]):
     980                  for val in initValues:
     981                      new_options += ['-init', str(val) ]
     982              else:
     983                  new_options += ['-init', str(initValues) ]
     984          if outputBounds is not None:
     985              new_options += ['-te', str(outputBounds[0]), str(outputBounds[1]), str(outputBounds[2]), str(outputBounds[3])]
     986          if outputSRS is not None:
     987              new_options += ['-a_srs', str(outputSRS) ]
     988          if width is not None and height is not None:
     989              new_options += ['-ts', str(width), str(height)]
     990          if xRes is not None and yRes is not None:
     991              new_options += ['-tr', str(xRes), str(yRes)]
     992          if targetAlignedPixels:
     993              new_options += ['-tap']
     994          if inverse:
     995              new_options += ['-i']
     996          if allTouched:
     997              new_options += ['-at']
     998          if burnValues is not None:
     999              if attribute is not None:
    1000                  raise Exception('burnValues and attribute option are exclusive.')
    1001              if type(burnValues) == type(()) or type(burnValues) == type([]):
    1002                  for val in burnValues:
    1003                      new_options += ['-burn', str(val) ]
    1004              else:
    1005                  new_options += ['-burn', str(burnValues) ]
    1006          if attribute is not None:
    1007              new_options += ['-a', attribute]
    1008          if useZ:
    1009              new_options += ['-3d']
    1010          if layers is not None:
    1011              if type(layers) == type(()) or type(layers) == type([]):
    1012                  for layer in layers:
    1013                      new_options += ['-l', layer]
    1014              else:
    1015                  new_options += ['-l', layers]
    1016          if SQLStatement is not None:
    1017              new_options += ['-sql', str(SQLStatement) ]
    1018          if SQLDialect is not None:
    1019              new_options += ['-dialect', str(SQLDialect) ]
    1020          if where is not None:
    1021              new_options += ['-where', str(where) ]
    1022
    1023      return (GDALRasterizeOptions(new_options), callback, callback_data)
    1024
    1025 -def Rasterize(destNameOrDestDS, srcDS, **kwargs):
    1026      """ Burns vector geometries into a raster
    1027          Arguments are :
    1028            destNameOrDestDS --- Output dataset name or object
    1029            srcDS --- a Dataset object or a filename
    1030          Keyword arguments are :
    1031            options --- return of gdal.InfoOptions(), string or array of strings
    1032            other keywords arguments of gdal.RasterizeOptions()
    1033          If options is provided as a gdal.RasterizeOptions() object, other keywords are ignored. """
    1034
    1035      if not 'options' in kwargs or type(kwargs['options']) == type([]) or _is_str_or_unicode(kwargs['options']):
    1036          (opts, callback, callback_data) = RasterizeOptions(**kwargs)
    1037      else:
    1038          (opts, callback, callback_data) = kwargs['options']
    1039      if _is_str_or_unicode(srcDS):
    1040          srcDS = OpenEx(srcDS)
    1041
    1042      if _is_str_or_unicode(destNameOrDestDS):
    1043          return wrapper_GDALRasterizeDestName(destNameOrDestDS, srcDS, opts, callback, callback_data)
    1044      else:
    1045          return wrapper_GDALRasterizeDestDS(destNameOrDestDS, srcDS, opts, callback, callback_data)
    1046
    1047
    1048 -def BuildVRTOptions(options = [],
    1049                      resolution = None,
    1050                      outputBounds = None,
    1051                      xRes = None, yRes = None,
    1052                      targetAlignedPixels = None,
    1053                      separate = None,
    1054                      bandList = None,
    1055                      addAlpha = None,
    1056                      resampleAlg = None,
    1057                      outputSRS = None,
    1058                      allowProjectionDifference = None,
    1059                      srcNodata = None,
    1060                      VRTNodata = None,
    1061                      hideNodata = None,
    1062                      callback = None, callback_data = None):
    1063      """ Create a BuildVRTOptions() object that can be passed to gdal.BuildVRT()
    1064          Keyword arguments are :
    1065            options --- can be be an array of strings, a string or let empty and filled from other keywords..
    1066            resolution --- 'highest', 'lowest', 'average', 'user'.
    1067            outputBounds --- output bounds as (minX, minY, maxX, maxY) in target SRS.
    1068            xRes, yRes --- output resolution in target SRS.
    1069            targetAlignedPixels --- whether to force output bounds to be multiple of output resolution.
    1070            separate --- whether each source file goes into a separate stacked band in the VRT band.
    1071            bandList --- array of band numbers (index start at 1).
    1072            addAlpha --- whether to add an alpha mask band to the VRT when the source raster have none.
    1073            resampleAlg --- resampling mode.
    1074            outputSRS --- assigned output SRS.
    1075            allowProjectionDifference --- whether to accept input datasets have not the same projection. Note: they will *not* be reprojected.
    1076            srcNodata --- source nodata value(s).
    1077            VRTNodata --- nodata values at the VRT band level.
    1078            hideNodata --- whether to make the VRT band not report the NoData value.
    1079            callback --- callback method.
    1080            callback_data --- user data for callback.
    1081      """
    1082      import copy
    1083
    1084      if _is_str_or_unicode(options):
    1085          new_options = ParseCommandLine(options)
    1086      else:
    1087          new_options = copy.copy(options)
    1088          if resolution is not None:
    1089              new_options += ['-resolution', str(resolution) ]
    1090          if outputBounds is not None:
    1091              new_options += ['-te', str(outputBounds[0]), str(outputBounds[1]), str(outputBounds[2]), str(outputBounds[3])]
    1092          if xRes is not None and yRes is not None:
    1093              new_options += ['-tr', str(xRes), str(yRes)]
    1094          if targetAlignedPixels:
    1095              new_options += ['-tap']
    1096          if separate:
    1097              new_options += ['-separate']
    1098          if bandList != None:
    1099              for b in bandList:
    1100                  new_options += ['-b', str(b) ]
    1101          if addAlpha:
    1102              new_options += ['-addalpha']
    1103          if resampleAlg is not None:
    1104              if resampleAlg == GRIORA_NearestNeighbour:
    1105                  new_options += ['-r', 'near']
    1106              elif resampleAlg == GRIORA_Bilinear:
    1107                  new_options += ['-rb']
    1108              elif resampleAlg == GRIORA_Cubic:
    1109                  new_options += ['-rc']
    1110              elif resampleAlg == GRIORA_CubicSpline:
    1111                  new_options += ['-rcs']
    1112              elif resampleAlg == GRIORA_Lanczos:
    1113                  new_options += ['-r', 'lanczos']
    1114              elif resampleAlg == GRIORA_Average:
    1115                  new_options += ['-r', 'average']
    1116              elif resampleAlg == GRIORA_Mode:
    1117                  new_options += ['-r', 'mode']
    1118              elif resampleAlg == GRIORA_Gauss:
    1119                  new_options += ['-r', 'gauss']
    1120              else:
    1121                  new_options += ['-r', str(resampleAlg) ]
    1122          if outputSRS is not None:
    1123              new_options += ['-a_srs', str(outputSRS) ]
    1124          if allowProjectionDifference:
    1125              new_options += ['-allow_projection_difference']
    1126          if srcNodata is not None:
    1127              new_options += ['-srcnodata', str(srcNodata) ]
    1128          if VRTNodata is not None:
    1129              new_options += ['-vrtnodata', str(VRTNodata) ]
    1130          if hideNodata:
    1131              new_options += ['-hidenodata']
    1132
    1133      return (GDALBuildVRTOptions(new_options), callback, callback_data)
    1134
    1135 -def BuildVRT(destName, srcDSOrSrcDSTab, **kwargs):
    1136      """ Build a VRT from a list of datasets.
    1137          Arguments are :
    1138            destName --- Output dataset name
    1139            srcDSOrSrcDSTab --- an array of Dataset objects or filenames, or a Dataset object or a filename
    1140          Keyword arguments are :
    1141            options --- return of gdal.InfoOptions(), string or array of strings
    1142            other keywords arguments of gdal.BuildVRTOptions()
    1143          If options is provided as a gdal.BuildVRTOptions() object, other keywords are ignored. """
    1144
    1145      if not 'options' in kwargs or type(kwargs['options']) == type([]) or _is_str_or_unicode(kwargs['options']):
    1146          (opts, callback, callback_data) = BuildVRTOptions(**kwargs)
    1147      else:
    1148          (opts, callback, callback_data) = kwargs['options']
    1149
    1150      srcDSTab = []
    1151      srcDSNamesTab = []
    1152      if _is_str_or_unicode(srcDSOrSrcDSTab):
    1153          srcDSNamesTab = [ srcDSOrSrcDSTab ]
    1154      elif type(srcDSOrSrcDSTab) == type([]):
    1155          for elt in srcDSOrSrcDSTab:
    1156              if _is_str_or_unicode(elt):
    1157                  srcDSNamesTab.append(elt)
    1158              else:
    1159                  srcDSTab.append(elt)
    1160          if len(srcDSTab) != 0 and len(srcDSNamesTab) != 0:
    1161              raise Exception('Mix of names and dataset objects not supported')
    1162      else:
    1163          srcDSTab = [ srcDSOrSrcDSTab ]
    1164
    1165      if len(srcDSTab) > 0:
    1166          return BuildVRTInternalObjects(destName, srcDSTab, opts, callback, callback_data)
    1167      else:
    1168          return BuildVRTInternalNames(destName, srcDSNamesTab, opts, callback, callback_data)
    1169
    1170
    1171
    1172 -def Debug(*args):
    1173    """Debug(char msg_class, char message)"""
    1174    return _gdal.Debug(*args)
    1175
    1176 -def SetErrorHandler(*args):
    1177    """SetErrorHandler(char pszCallbackName = None) -> CPLErr"""
    1178    return _gdal.SetErrorHandler(*args)
    1179
    1180 -def PushErrorHandler(*args):
    1181    """PushErrorHandler(CPLErrorHandler pfnErrorHandler = None) -> CPLErr"""
    1182    return _gdal.PushErrorHandler(*args)
    1183
    1184 -def PopErrorHandler(*args):
    1185    """PopErrorHandler()"""
    1186    return _gdal.PopErrorHandler(*args)
    1187
    1188 -def Error(*args):
    1189    """Error(CPLErr msg_class = CE_Failure, int err_code = 0, char msg = "error")"""
    1190    return _gdal.Error(*args)
    1191
    1192 -def GOA2GetAuthorizationURL(*args):
    1193    """GOA2GetAuthorizationURL(char pszScope) -> retStringAndCPLFree"""
    1194    return _gdal.GOA2GetAuthorizationURL(*args)
    1195
    1196 -def GOA2GetRefreshToken(*args):
    1197    """GOA2GetRefreshToken(char pszAuthToken, char pszScope) -> retStringAndCPLFree"""
    1198    return _gdal.GOA2GetRefreshToken(*args)
    1199
    1200 -def GOA2GetAccessToken(*args):
    1201    """GOA2GetAccessToken(char pszRefreshToken, char pszScope) -> retStringAndCPLFree"""
    1202    return _gdal.GOA2GetAccessToken(*args)
    1203
    1204 -def ErrorReset(*args):
    1205    """ErrorReset()"""
    1206    return _gdal.ErrorReset(*args)
    1207
    1208 -def EscapeString(*args, **kwargs):
    1209    """EscapeString(int len, int scheme = CPLES_SQL) -> retStringAndCPLFree"""
    1210    return _gdal.EscapeString(*args, **kwargs)
    1211
    1212 -def GetLastErrorNo(*args):
    1213    """GetLastErrorNo() -> int"""
    1214    return _gdal.GetLastErrorNo(*args)
    1215
    1216 -def GetLastErrorType(*args):
    1217    """GetLastErrorType() -> int"""
    1218    return _gdal.GetLastErrorType(*args)
    1219
    1220 -def GetLastErrorMsg(*args):
    1221    """GetLastErrorMsg() -> char"""
    1222    return _gdal.GetLastErrorMsg(*args)
    1223
    1224 -def VSIGetLastErrorNo(*args):
    1225    """VSIGetLastErrorNo() -> int"""
    1226    return _gdal.VSIGetLastErrorNo(*args)
    1227
    1228 -def VSIGetLastErrorMsg(*args):
    1229    """VSIGetLastErrorMsg() -> char"""
    1230    return _gdal.VSIGetLastErrorMsg(*args)
    1231
    1232 -def PushFinderLocation(*args):
    1233    """PushFinderLocation(char utf8_path)"""
    1234    return _gdal.PushFinderLocation(*args)
    1235
    1236 -def PopFinderLocation(*args):
    1237    """PopFinderLocation()"""
    1238    return _gdal.PopFinderLocation(*args)
    1239
    1240 -def FinderClean(*args):
    1241    """FinderClean()"""
    1242    return _gdal.FinderClean(*args)
    1243
    1244 -def FindFile(*args):
    1245    """FindFile(char pszClass, char utf8_path) -> char"""
    1246    return _gdal.FindFile(*args)
    1247
    1248 -def ReadDir(*args):
    1249    """ReadDir(char utf8_path, int nMaxFiles = 0) -> char"""
    1250    return _gdal.ReadDir(*args)
    1251
    1252 -def ReadDirRecursive(*args):
    1253    """ReadDirRecursive(char utf8_path) -> char"""
    1254    return _gdal.ReadDirRecursive(*args)
    1255
    1256 -def SetConfigOption(*args):
    1257    """SetConfigOption(char pszKey, char pszValue)"""
    1258    return _gdal.SetConfigOption(*args)
    1259
    1260 -def GetConfigOption(*args):
    1261    """GetConfigOption(char pszKey, char pszDefault = None) -> char"""
    1262    return _gdal.GetConfigOption(*args)
    1263
    1264 -def CPLBinaryToHex(*args):
    1265    """CPLBinaryToHex(int nBytes) -> retStringAndCPLFree"""
    1266    return _gdal.CPLBinaryToHex(*args)
    1267
    1268 -def CPLHexToBinary(*args):
    1269    """CPLHexToBinary(char pszHex, int pnBytes) -> GByte"""
    1270    return _gdal.CPLHexToBinary(*args)
    1271
    1272 -def FileFromMemBuffer(*args):
    1273    """FileFromMemBuffer(char utf8_path, int nBytes)"""
    1274    return _gdal.FileFromMemBuffer(*args)
    1275
    1276 -def Unlink(*args):
    1277    """Unlink(char utf8_path) -> VSI_RETVAL"""
    1278    return _gdal.Unlink(*args)
    1279
    1280 -def HasThreadSupport(*args):
    1281    """HasThreadSupport() -> int"""
    1282    return _gdal.HasThreadSupport(*args)
    1283
    1284 -def Mkdir(*args):
    1285    """Mkdir(char utf8_path, int mode) -> VSI_RETVAL"""
    1286    return _gdal.Mkdir(*args)
    1287
    1288 -def Rmdir(*args):
    1289    """Rmdir(char utf8_path) -> VSI_RETVAL"""
    1290    return _gdal.Rmdir(*args)
    1291
    1292 -def Rename(*args):
    1293    """Rename(char pszOld, char pszNew) -> VSI_RETVAL"""
    1294    return _gdal.Rename(*args)
    1295  VSI_STAT_EXISTS_FLAG = _gdal.VSI_STAT_EXISTS_FLAG
    1296  VSI_STAT_NATURE_FLAG = _gdal.VSI_STAT_NATURE_FLAG
    1297  VSI_STAT_SIZE_FLAG = _gdal.VSI_STAT_SIZE_FLAG
    1298 -class StatBuf(_object):
    1299      """Proxy of C++ StatBuf class"""
    1300      __swig_setmethods__ = {}
    1301      __setattr__ = lambda self, name, value: _swig_setattr(self, StatBuf, name, value)
    1302      __swig_getmethods__ = {}
    1303      __getattr__ = lambda self, name: _swig_getattr(self, StatBuf, name)
    1304      __repr__ = _swig_repr
    1305      __swig_getmethods__["mode"] = _gdal.StatBuf_mode_get
    1306      if _newclass:mode = _swig_property(_gdal.StatBuf_mode_get)
    1307      __swig_getmethods__["size"] = _gdal.StatBuf_size_get
    1308      if _newclass:size = _swig_property(_gdal.StatBuf_size_get)
    1309      __swig_getmethods__["mtime"] = _gdal.StatBuf_mtime_get
    1310      if _newclass:mtime = _swig_property(_gdal.StatBuf_mtime_get)
    1311 -    def __init__(self, *args):
    1312          """__init__(self, StatBuf psStatBuf) -> StatBuf"""
    1313          this = _gdal.new_StatBuf(*args)
    1314          try: self.this.append(this)
    1315          except: self.this = this
    1316      __swig_destroy__ = _gdal.delete_StatBuf
    1317      __del__ = lambda self : None;
    1318 -    def IsDirectory(self, *args):
    1319          """IsDirectory(self) -> int"""
    1320          return _gdal.StatBuf_IsDirectory(self, *args)
    1321
    1322  StatBuf_swigregister = _gdal.StatBuf_swigregister
    1323  StatBuf_swigregister(StatBuf)
    1324
    1325
    1326 -def VSIStatL(*args):
    1327    """VSIStatL(char utf8_path, int nFlags = 0) -> int"""
    1328    return _gdal.VSIStatL(*args)
    1329
    1330 -def VSIFOpenL(*args):
    1331    """VSIFOpenL(char utf8_path, char pszMode) -> VSILFILE"""
    1332    return _gdal.VSIFOpenL(*args)
    1333
    1334 -def VSIFOpenExL(*args):
    1335    """VSIFOpenExL(char utf8_path, char pszMode, int bSetError) -> VSILFILE"""
    1336    return _gdal.VSIFOpenExL(*args)
    1337
    1338 -def VSIFCloseL(*args):
    1339    """VSIFCloseL(VSILFILE fp) -> VSI_RETVAL"""
    1340    return _gdal.VSIFCloseL(*args)
    1341
    1342 -def VSIFSeekL(*args):
    1343    """VSIFSeekL(VSILFILE fp, GIntBig offset, int whence) -> int"""
    1344    return _gdal.VSIFSeekL(*args)
    1345
    1346 -def VSIFTellL(*args):
    1347    """VSIFTellL(VSILFILE fp) -> GIntBig"""
    1348    return _gdal.VSIFTellL(*args)
    1349
    1350 -def VSIFTruncateL(*args):
    1351    """VSIFTruncateL(VSILFILE fp, GIntBig length) -> int"""
    1352    return _gdal.VSIFTruncateL(*args)
    1353
    1354 -def VSIFWriteL(*args):
    1355    """VSIFWriteL(int nLen, int size, int memb, VSILFILE fp) -> int"""
    1356    return _gdal.VSIFWriteL(*args)
    1357
    1358 -def ParseCommandLine(*args):
    1359    """ParseCommandLine(char utf8_path) -> char"""
    1360    return _gdal.ParseCommandLine(*args)
    1361 -class MajorObject(_object):
    1362      """Proxy of C++ GDALMajorObjectShadow class"""
    1363      __swig_setmethods__ = {}
    1364      __setattr__ = lambda self, name, value: _swig_setattr(self, MajorObject, name, value)
    1365      __swig_getmethods__ = {}
    1366      __getattr__ = lambda self, name: _swig_getattr(self, MajorObject, name)
    1367 -    def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined")
    1368      __repr__ = _swig_repr
    1369 -    def GetDescription(self, *args):
    1370          """GetDescription(self) -> char"""
    1371          return _gdal.MajorObject_GetDescription(self, *args)
    1372
    1373 -    def SetDescription(self, *args):
    1374          """SetDescription(self, char pszNewDesc)"""
    1375          return _gdal.MajorObject_SetDescription(self, *args)
    1376
    1377 -    def GetMetadataDomainList(self, *args):
    1378          """GetMetadataDomainList(self) -> char"""
    1379          return _gdal.MajorObject_GetMetadataDomainList(self, *args)
    1380
    1381 -    def GetMetadata_Dict(self, *args):
    1382          """GetMetadata_Dict(self, char pszDomain = "") -> char"""
    1383          return _gdal.MajorObject_GetMetadata_Dict(self, *args)
    1384
    1385 -    def GetMetadata_List(self, *args):
    1386          """GetMetadata_List(self, char pszDomain = "") -> char"""
    1387          return _gdal.MajorObject_GetMetadata_List(self, *args)
    1388
    1389 -    def SetMetadata(self, *args):
    1390          """
    1391          SetMetadata(self, char papszMetadata, char pszDomain = "") -> CPLErr
    1392          SetMetadata(self, char pszMetadataString, char pszDomain = "") -> CPLErr
    1393          """
    1394          return _gdal.MajorObject_SetMetadata(self, *args)
    1395
    1396 -    def GetMetadataItem(self, *args):
    1397          """GetMetadataItem(self, char pszName, char pszDomain = "") -> char"""
    1398          return _gdal.MajorObject_GetMetadataItem(self, *args)
    1399
    1400 -    def SetMetadataItem(self, *args):
    1401          """SetMetadataItem(self, char pszName, char pszValue, char pszDomain = "") -> CPLErr"""
    1402          return _gdal.MajorObject_SetMetadataItem(self, *args)
    1403
    1404 -    def GetMetadata( self, domain = '' ):
    1405        if domain[:4] == 'xml:':
    1406          return self.GetMetadata_List( domain )
    1407        return self.GetMetadata_Dict( domain )
    1408
    1409  MajorObject_swigregister = _gdal.MajorObject_swigregister
    1410  MajorObject_swigregister(MajorObject)
    1411
    1412 -class Driver(MajorObject):
    1413      """Proxy of C++ GDALDriverShadow class"""
    1414      __swig_setmethods__ = {}
    1415      for _s in [MajorObject]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
    1416      __setattr__ = lambda self, name, value: _swig_setattr(self, Driver, name, value)
    1417      __swig_getmethods__ = {}
    1418      for _s in [MajorObject]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
    1419      __getattr__ = lambda self, name: _swig_getattr(self, Driver, name)
    1420 -    def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined")
    1421      __repr__ = _swig_repr
    1422      __swig_getmethods__["ShortName"] = _gdal.Driver_ShortName_get
    1423      if _newclass:ShortName = _swig_property(_gdal.Driver_ShortName_get)
    1424      __swig_getmethods__["LongName"] = _gdal.Driver_LongName_get
    1425      if _newclass:LongName = _swig_property(_gdal.Driver_LongName_get)
    1426      __swig_getmethods__["HelpTopic"] = _gdal.Driver_HelpTopic_get
    1427      if _newclass:HelpTopic = _swig_property(_gdal.Driver_HelpTopic_get)
    1428 -    def Create(self, *args, **kwargs):
    1429          """
    1430          Create(self, char utf8_path, int xsize, int ysize, int bands = 1,
    1431              GDALDataType eType = GDT_Byte, char options = None) -> Dataset
    1432          """
    1433          return _gdal.Driver_Create(self, *args, **kwargs)
    1434
    1435 -    def CreateCopy(self, *args, **kwargs):
    1436          """
    1437          CreateCopy(self, char utf8_path, Dataset src, int strict = 1, char options = None,
    1438              GDALProgressFunc callback = None,
    1439              void callback_data = None) -> Dataset
    1440          """
    1441          return _gdal.Driver_CreateCopy(self, *args, **kwargs)
    1442
    1443 -    def Delete(self, *args):
    1444          """Delete(self, char utf8_path) -> CPLErr"""
    1445          return _gdal.Driver_Delete(self, *args)
    1446
    1447 -    def Rename(self, *args):
    1448          """Rename(self, char newName, char oldName) -> CPLErr"""
    1449          return _gdal.Driver_Rename(self, *args)
    1450
    1451 -    def CopyFiles(self, *args):
    1452          """CopyFiles(self, char newName, char oldName) -> CPLErr"""
    1453          return _gdal.Driver_CopyFiles(self, *args)
    1454
    1455 -    def Register(self, *args):
    1456          """Register(self) -> int"""
    1457          return _gdal.Driver_Register(self, *args)
    1458
    1459 -    def Deregister(self, *args):
    1460          """Deregister(self)"""
    1461          return _gdal.Driver_Deregister(self, *args)
    1462
    1463  Driver_swigregister = _gdal.Driver_swigregister
    1464  Driver_swigregister(Driver)
    1465
    1466  import ogr
    1467  import osr
    1468 -class ColorEntry(_object):
    1469      """Proxy of C++ GDALColorEntry class"""
    1470      __swig_setmethods__ = {}
    1471      __setattr__ = lambda self, name, value: _swig_setattr(self, ColorEntry, name, value)
    1472      __swig_getmethods__ = {}
    1473      __getattr__ = lambda self, name: _swig_getattr(self, ColorEntry, name)
    1474 -    def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined")
    1475      __repr__ = _swig_repr
    1476      __swig_setmethods__["c1"] = _gdal.ColorEntry_c1_set
    1477      __swig_getmethods__["c1"] = _gdal.ColorEntry_c1_get
    1478      if _newclass:c1 = _swig_property(_gdal.ColorEntry_c1_get, _gdal.ColorEntry_c1_set)
    1479      __swig_setmethods__["c2"] = _gdal.ColorEntry_c2_set
    1480      __swig_getmethods__["c2"] = _gdal.ColorEntry_c2_get
    1481      if _newclass:c2 = _swig_property(_gdal.ColorEntry_c2_get, _gdal.ColorEntry_c2_set)
    1482      __swig_setmethods__["c3"] = _gdal.ColorEntry_c3_set
    1483      __swig_getmethods__["c3"] = _gdal.ColorEntry_c3_get
    1484      if _newclass:c3 = _swig_property(_gdal.ColorEntry_c3_get, _gdal.ColorEntry_c3_set)
    1485      __swig_setmethods__["c4"] = _gdal.ColorEntry_c4_set
    1486      __swig_getmethods__["c4"] = _gdal.ColorEntry_c4_get
    1487      if _newclass:c4 = _swig_property(_gdal.ColorEntry_c4_get, _gdal.ColorEntry_c4_set)
    1488  ColorEntry_swigregister = _gdal.ColorEntry_swigregister
    1489  ColorEntry_swigregister(ColorEntry)
    1490
    1491 -class GCP(_object):
    1492      """Proxy of C++ GDAL_GCP class"""
    1493      __swig_setmethods__ = {}
    1494      __setattr__ = lambda self, name, value: _swig_setattr(self, GCP, name, value)
    1495      __swig_getmethods__ = {}
    1496      __getattr__ = lambda self, name: _swig_getattr(self, GCP, name)
    1497      __repr__ = _swig_repr
    1498      __swig_setmethods__["GCPX"] = _gdal.GCP_GCPX_set
    1499      __swig_getmethods__["GCPX"] = _gdal.GCP_GCPX_get
    1500      if _newclass:GCPX = _swig_property(_gdal.GCP_GCPX_get, _gdal.GCP_GCPX_set)
    1501      __swig_setmethods__["GCPY"] = _gdal.GCP_GCPY_set
    1502      __swig_getmethods__["GCPY"] = _gdal.GCP_GCPY_get
    1503      if _newclass:GCPY = _swig_property(_gdal.GCP_GCPY_get, _gdal.GCP_GCPY_set)
    1504      __swig_setmethods__["GCPZ"] = _gdal.GCP_GCPZ_set
    1505      __swig_getmethods__["GCPZ"] = _gdal.GCP_GCPZ_get
    1506      if _newclass:GCPZ = _swig_property(_gdal.GCP_GCPZ_get, _gdal.GCP_GCPZ_set)
    1507      __swig_setmethods__["GCPPixel"] = _gdal.GCP_GCPPixel_set
    1508      __swig_getmethods__["GCPPixel"] = _gdal.GCP_GCPPixel_get
    1509      if _newclass:GCPPixel = _swig_property(_gdal.GCP_GCPPixel_get, _gdal.GCP_GCPPixel_set)
    1510      __swig_setmethods__["GCPLine"] = _gdal.GCP_GCPLine_set
    1511      __swig_getmethods__["GCPLine"] = _gdal.GCP_GCPLine_get
    1512      if _newclass:GCPLine = _swig_property(_gdal.GCP_GCPLine_get, _gdal.GCP_GCPLine_set)
    1513      __swig_setmethods__["Info"] = _gdal.GCP_Info_set
    1514      __swig_getmethods__["Info"] = _gdal.GCP_Info_get
    1515      if _newclass:Info = _swig_property(_gdal.GCP_Info_get, _gdal.GCP_Info_set)
    1516      __swig_setmethods__["Id"] = _gdal.GCP_Id_set
    1517      __swig_getmethods__["Id"] = _gdal.GCP_Id_get
    1518      if _newclass:Id = _swig_property(_gdal.GCP_Id_get, _gdal.GCP_Id_set)
    1519 -    def __init__(self, *args):
    1520          """
    1521          __init__(self, double x = 0.0, double y = 0.0, double z = 0.0, double pixel = 0.0,
    1522              double line = 0.0, char info = "",
    1523              char id = "") -> GCP
    1524          """
    1525          this = _gdal.new_GCP(*args)
    1526          try: self.this.append(this)
    1527          except: self.this = this
    1528      __swig_destroy__ = _gdal.delete_GCP
    1529      __del__ = lambda self : None;
    1530 -    def __str__(self):
    1531        str = '%s (%.2fP,%.2fL) -> (%.7fE,%.7fN,%.2f) %s '\
    1532              % (self.Id, self.GCPPixel, self.GCPLine,
    1533                 self.GCPX, self.GCPY, self.GCPZ, self.Info )
    1534        return str
    1535
    1536 -    def serialize(self,with_Z=0):
    1537        base = [CXT_Element,'GCP']
    1538        base.append([CXT_Attribute,'Id',[CXT_Text,self.Id]])
    1539        pixval = '%0.15E' % self.GCPPixel
    1540        lineval = '%0.15E' % self.GCPLine
    1541        xval = '%0.15E' % self.GCPX
    1542        yval = '%0.15E' % self.GCPY
    1543        zval = '%0.15E' % self.GCPZ
    1544        base.append([CXT_Attribute,'Pixel',[CXT_Text,pixval]])
    1545        base.append([CXT_Attribute,'Line',[CXT_Text,lineval]])
    1546        base.append([CXT_Attribute,'X',[CXT_Text,xval]])
    1547        base.append([CXT_Attribute,'Y',[CXT_Text,yval]])
    1548        if with_Z:
    1549            base.append([CXT_Attribute,'Z',[CXT_Text,zval]])
    1550        return base
    1551
    1552  GCP_swigregister = _gdal.GCP_swigregister
    1553  GCP_swigregister(GCP)
    1554
    1555
    1556 -def GDAL_GCP_GCPX_get(*args):
    1557    """GDAL_GCP_GCPX_get(GCP gcp) -> double"""
    1558    return _gdal.GDAL_GCP_GCPX_get(*args)
    1559
    1560 -def GDAL_GCP_GCPX_set(*args):
    1561    """GDAL_GCP_GCPX_set(GCP gcp, double dfGCPX)"""
    1562    return _gdal.GDAL_GCP_GCPX_set(*args)
    1563
    1564 -def GDAL_GCP_GCPY_get(*args):
    1565    """GDAL_GCP_GCPY_get(GCP gcp) -> double"""
    1566    return _gdal.GDAL_GCP_GCPY_get(*args)
    1567
    1568 -def GDAL_GCP_GCPY_set(*args):
    1569    """GDAL_GCP_GCPY_set(GCP gcp, double dfGCPY)"""
    1570    return _gdal.GDAL_GCP_GCPY_set(*args)
    1571
    1572 -def GDAL_GCP_GCPZ_get(*args):
    1573    """GDAL_GCP_GCPZ_get(GCP gcp) -> double"""
    1574    return _gdal.GDAL_GCP_GCPZ_get(*args)
    1575
    1576 -def GDAL_GCP_GCPZ_set(*args):
    1577    """GDAL_GCP_GCPZ_set(GCP gcp, double dfGCPZ)"""
    1578    return _gdal.GDAL_GCP_GCPZ_set(*args)
    1579
    1580 -def GDAL_GCP_GCPPixel_get(*args):
    1581    """GDAL_GCP_GCPPixel_get(GCP gcp) -> double"""
    1582    return _gdal.GDAL_GCP_GCPPixel_get(*args)
    1583
    1584 -def GDAL_GCP_GCPPixel_set(*args):
    1585    """GDAL_GCP_GCPPixel_set(GCP gcp, double dfGCPPixel)"""
    1586    return _gdal.GDAL_GCP_GCPPixel_set(*args)
    1587
    1588 -def GDAL_GCP_GCPLine_get(*args):
    1589    """GDAL_GCP_GCPLine_get(GCP gcp) -> double"""
    1590    return _gdal.GDAL_GCP_GCPLine_get(*args)
    1591
    1592 -def GDAL_GCP_GCPLine_set(*args):
    1593    """GDAL_GCP_GCPLine_set(GCP gcp, double dfGCPLine)"""
    1594    return _gdal.GDAL_GCP_GCPLine_set(*args)
    1595
    1596 -def GDAL_GCP_Info_get(*args):
    1597    """GDAL_GCP_Info_get(GCP gcp) -> char"""
    1598    return _gdal.GDAL_GCP_Info_get(*args)
    1599
    1600 -def GDAL_GCP_Info_set(*args):
    1601    """GDAL_GCP_Info_set(GCP gcp, char pszInfo)"""
    1602    return _gdal.GDAL_GCP_Info_set(*args)
    1603
    1604 -def GDAL_GCP_Id_get(*args):
    1605    """GDAL_GCP_Id_get(GCP gcp) -> char"""
    1606    return _gdal.GDAL_GCP_Id_get(*args)
    1607
    1608 -def GDAL_GCP_Id_set(*args):
    1609    """GDAL_GCP_Id_set(GCP gcp, char pszId)"""
    1610    return _gdal.GDAL_GCP_Id_set(*args)
    1611
    1612 -def GCPsToGeoTransform(*args):
    1613    """GCPsToGeoTransform(int nGCPs, int bApproxOK = 1) -> RETURN_NONE"""
    1614    return _gdal.GCPsToGeoTransform(*args)
    1615 -class VirtualMem(_object):
    1616      """Proxy of C++ CPLVirtualMemShadow class"""
    1617      __swig_setmethods__ = {}
    1618      __setattr__ = lambda self, name, value: _swig_setattr(self, VirtualMem, name, value)
    1619      __swig_getmethods__ = {}
    1620      __getattr__ = lambda self, name: _swig_getattr(self, VirtualMem, name)
    1621 -    def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined")
    1622      __repr__ = _swig_repr
    1623      __swig_destroy__ = _gdal.delete_VirtualMem
    1624      __del__ = lambda self : None;
    1625 -    def GetAddr(self, *args):
    1626          """GetAddr(self)"""
    1627          return _gdal.VirtualMem_GetAddr(self, *args)
    1628
    1629 -    def Pin(self, *args):
    1630          """Pin(self, size_t start_offset = 0, size_t nsize = 0, int bWriteOp = 0)"""
    1631          return _gdal.VirtualMem_Pin(self, *args)
    1632
    1633  VirtualMem_swigregister = _gdal.VirtualMem_swigregister
    1634  VirtualMem_swigregister(VirtualMem)
    1635
    1636 -class AsyncReader(_object):
    1637      """Proxy of C++ GDALAsyncReaderShadow class"""
    1638      __swig_setmethods__ = {}
    1639      __setattr__ = lambda self, name, value: _swig_setattr(self, AsyncReader, name, value)
    1640      __swig_getmethods__ = {}
    1641      __getattr__ = lambda self, name: _swig_getattr(self, AsyncReader, name)
    1642 -    def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined")
    1643      __repr__ = _swig_repr
    1644      __swig_destroy__ = _gdal.delete_AsyncReader
    1645      __del__ = lambda self : None;
    1646 -    def GetNextUpdatedRegion(self, *args):
    1647          """GetNextUpdatedRegion(self, double timeout) -> GDALAsyncStatusType"""
    1648          return _gdal.AsyncReader_GetNextUpdatedRegion(self, *args)
    1649
    1650 -    def GetBuffer(self, *args):
    1651          """GetBuffer(self)"""
    1652          return _gdal.AsyncReader_GetBuffer(self, *args)
    1653
    1654 -    def LockBuffer(self, *args):
    1655          """LockBuffer(self, double timeout) -> int"""
    1656          return _gdal.AsyncReader_LockBuffer(self, *args)
    1657
    1658 -    def UnlockBuffer(self, *args):
    1659          """UnlockBuffer(self)"""
    1660          return _gdal.AsyncReader_UnlockBuffer(self, *args)
    1661
    1662  AsyncReader_swigregister = _gdal.AsyncReader_swigregister
    1663  AsyncReader_swigregister(AsyncReader)
    1664
    1665 -class Dataset(MajorObject):
    1666      """Proxy of C++ GDALDatasetShadow class"""
    1667      __swig_setmethods__ = {}
    1668      for _s in [MajorObject]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
    1669      __setattr__ = lambda self, name, value: _swig_setattr(self, Dataset, name, value)
    1670      __swig_getmethods__ = {}
    1671      for _s in [MajorObject]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
    1672      __getattr__ = lambda self, name: _swig_getattr(self, Dataset, name)
    1673 -    def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined")
    1674      __repr__ = _swig_repr
    1675      __swig_getmethods__["RasterXSize"] = _gdal.Dataset_RasterXSize_get
    1676      if _newclass:RasterXSize = _swig_property(_gdal.Dataset_RasterXSize_get)
    1677      __swig_getmethods__["RasterYSize"] = _gdal.Dataset_RasterYSize_get
    1678      if _newclass:RasterYSize = _swig_property(_gdal.Dataset_RasterYSize_get)
    1679      __swig_getmethods__["RasterCount"] = _gdal.Dataset_RasterCount_get
    1680      if _newclass:RasterCount = _swig_property(_gdal.Dataset_RasterCount_get)
    1681      __swig_destroy__ = _gdal.delete_Dataset
    1682      __del__ = lambda self : None;
    1683 -    def GetDriver(self, *args):
    1684          """GetDriver(self) -> Driver"""
    1685          return _gdal.Dataset_GetDriver(self, *args)
    1686
    1687 -    def GetRasterBand(self, *args):
    1688          """GetRasterBand(self, int nBand) -> Band"""
    1689          return _gdal.Dataset_GetRasterBand(self, *args)
    1690
    1691 -    def GetProjection(self, *args):
    1692          """GetProjection(self) -> char"""
    1693          return _gdal.Dataset_GetProjection(self, *args)
    1694
    1695 -    def GetProjectionRef(self, *args):
    1696          """GetProjectionRef(self) -> char"""
    1697          return _gdal.Dataset_GetProjectionRef(self, *args)
    1698
    1699 -    def SetProjection(self, *args):
    1700          """SetProjection(self, char prj) -> CPLErr"""
    1701          return _gdal.Dataset_SetProjection(self, *args)
    1702
    1703 -    def GetGeoTransform(self, *args, **kwargs):
    1704          """GetGeoTransform(self, int can_return_null = None)"""
    1705          return _gdal.Dataset_GetGeoTransform(self, *args, **kwargs)
    1706
    1707 -    def SetGeoTransform(self, *args):
    1708          """SetGeoTransform(self, double argin) -> CPLErr"""
    1709          return _gdal.Dataset_SetGeoTransform(self, *args)
    1710
    1711 -    def BuildOverviews(self, *args, **kwargs):
    1712          """
    1713          BuildOverviews(self, char resampling = "NEAREST", int overviewlist = 0,
    1714              GDALProgressFunc callback = None, void callback_data = None) -> int
    1715          """
    1716          return _gdal.Dataset_BuildOverviews(self, *args, **kwargs)
    1717
    1718 -    def GetGCPCount(self, *args):
    1719          """GetGCPCount(self) -> int"""
    1720          return _gdal.Dataset_GetGCPCount(self, *args)
    1721
    1722 -    def GetGCPProjection(self, *args):
    1723          """GetGCPProjection(self) -> char"""
    1724          return _gdal.Dataset_GetGCPProjection(self, *args)
    1725
    1726 -    def GetGCPs(self, *args):
    1727          """GetGCPs(self)"""
    1728          return _gdal.Dataset_GetGCPs(self, *args)
    1729
    1730 -    def SetGCPs(self, *args):
    1731          """SetGCPs(self, int nGCPs, char pszGCPProjection) -> CPLErr"""
    1732          return _gdal.Dataset_SetGCPs(self, *args)
    1733
    1734 -    def FlushCache(self, *args):
    1735          """FlushCache(self)"""
    1736          return _gdal.Dataset_FlushCache(self, *args)
    1737
    1738 -    def AddBand(self, *args, **kwargs):
    1739          """AddBand(self, GDALDataType datatype = GDT_Byte, char options = None) -> CPLErr"""
    1740          return _gdal.Dataset_AddBand(self, *args, **kwargs)
    1741
    1742 -    def CreateMaskBand(self, *args):
    1743          """CreateMaskBand(self, int nFlags) -> CPLErr"""
    1744          return _gdal.Dataset_CreateMaskBand(self, *args)
    1745
    1746 -    def GetFileList(self, *args):
    1747          """GetFileList(self) -> char"""
    1748          return _gdal.Dataset_GetFileList(self, *args)
    1749
    1750 -    def WriteRaster(self, *args, **kwargs):
    1751          """
    1752          WriteRaster(self, int xoff, int yoff, int xsize, int ysize, GIntBig buf_len,
    1753              int buf_xsize = None, int buf_ysize = None,
    1754              GDALDataType buf_type = None, int band_list = 0,
    1755              GIntBig buf_pixel_space = None, GIntBig buf_line_space = None,
    1756              GIntBig buf_band_space = None) -> CPLErr
    1757          """
    1758          return _gdal.Dataset_WriteRaster(self, *args, **kwargs)
    1759
    1760 -    def BeginAsyncReader(self, *args, **kwargs):
    1761          """
    1762          BeginAsyncReader(self, int xOff, int yOff, int xSize, int ySize, int buf_len,
    1763              int buf_xsize, int buf_ysize, GDALDataType bufType = (GDALDataType) 0,
    1764              int band_list = 0,
    1765              int nPixelSpace = 0, int nLineSpace = 0,
    1766              int nBandSpace = 0, char options = None) -> AsyncReader
    1767          """
    1768          return _gdal.Dataset_BeginAsyncReader(self, *args, **kwargs)
    1769
    1770 -    def EndAsyncReader(self, *args):
    1771          """EndAsyncReader(self, AsyncReader ario)"""
    1772          return _gdal.Dataset_EndAsyncReader(self, *args)
    1773
    1774 -    def GetVirtualMem(self, *args, **kwargs):
    1775          """
    1776          GetVirtualMem(self, GDALRWFlag eRWFlag, int nXOff, int nYOff, int nXSize,
    1777              int nYSize, int nBufXSize, int nBufYSize,
    1778              GDALDataType eBufType, int band_list, int bIsBandSequential,
    1779              size_t nCacheSize, size_t nPageSizeHint,
    1780              char options = None) -> VirtualMem
    1781          """
    1782          return _gdal.Dataset_GetVirtualMem(self, *args, **kwargs)
    1783
    1784 -    def GetTiledVirtualMem(self, *args, **kwargs):
    1785          """
    1786          GetTiledVirtualMem(self, GDALRWFlag eRWFlag, int nXOff, int nYOff, int nXSize,
    1787              int nYSize, int nTileXSize, int nTileYSize,
    1788              GDALDataType eBufType, int band_list, GDALTileOrganization eTileOrganization,
    1789              size_t nCacheSize,
    1790              char options = None) -> VirtualMem
    1791          """
    1792          return _gdal.Dataset_GetTiledVirtualMem(self, *args, **kwargs)
    1793
    1794 -    def CreateLayer(self, *args, **kwargs):
    1795          """
    1796          CreateLayer(self, char name, SpatialReference srs = None, OGRwkbGeometryType geom_type = wkbUnknown,
    1797              char options = None) -> Layer
    1798          """
    1799          return _gdal.Dataset_CreateLayer(self, *args, **kwargs)
    1800
    1801 -    def CopyLayer(self, *args, **kwargs):
    1802          """CopyLayer(self, Layer src_layer, char new_name, char options = None) -> Layer"""
    1803          return _gdal.Dataset_CopyLayer(self, *args, **kwargs)
    1804
    1805 -    def DeleteLayer(self, *args):
    1806          """DeleteLayer(self, int index) -> OGRErr"""
    1807          return _gdal.Dataset_DeleteLayer(self, *args)
    1808
    1809 -    def GetLayerCount(self, *args):
    1810          """GetLayerCount(self) -> int"""
    1811          return _gdal.Dataset_GetLayerCount(self, *args)
    1812
    1813 -    def GetLayerByIndex(self, *args):
    1814          """GetLayerByIndex(self, int index = 0) -> Layer"""
    1815          return _gdal.Dataset_GetLayerByIndex(self, *args)
    1816
    1817 -    def GetLayerByName(self, *args):
    1818          """GetLayerByName(self, char layer_name) -> Layer"""
    1819          return _gdal.Dataset_GetLayerByName(self, *args)
    1820
    1821 -    def TestCapability(self, *args):
    1822          """TestCapability(self, char cap) -> bool"""
    1823          return _gdal.Dataset_TestCapability(self, *args)
    1824
    1825 -    def ExecuteSQL(self, *args, **kwargs):
    1826          """ExecuteSQL(self, char statement, Geometry spatialFilter = None, char dialect = "") -> Layer"""
    1827          return _gdal.Dataset_ExecuteSQL(self, *args, **kwargs)
    1828
    1829 -    def ReleaseResultSet(self, *args):
    1830          """ReleaseResultSet(self, Layer layer)"""
    1831          return _gdal.Dataset_ReleaseResultSet(self, *args)
    1832
    1833 -    def GetStyleTable(self, *args):
    1834          """GetStyleTable(self) -> StyleTable"""
    1835          return _gdal.Dataset_GetStyleTable(self, *args)
    1836
    1837 -    def SetStyleTable(self, *args):
    1838          """SetStyleTable(self, StyleTable table)"""
    1839          return _gdal.Dataset_SetStyleTable(self, *args)
    1840
    1841 -    def StartTransaction(self, *args, **kwargs):
    1842          """StartTransaction(self, int force = True) -> OGRErr"""
    1843          return _gdal.Dataset_StartTransaction(self, *args, **kwargs)
    1844
    1845 -    def CommitTransaction(self, *args):
    1846          """CommitTransaction(self) -> OGRErr"""
    1847          return _gdal.Dataset_CommitTransaction(self, *args)
    1848
    1849 -    def RollbackTransaction(self, *args):
    1850          """RollbackTransaction(self) -> OGRErr"""
    1851          return _gdal.Dataset_RollbackTransaction(self, *args)
    1852
    1853 -    def ReadRaster1(self, *args, **kwargs):
    1854          """
    1855          ReadRaster1(self, int xoff, int yoff, int xsize, int ysize, int buf_xsize = None,
    1856              int buf_ysize = None, GDALDataType buf_type = None,
    1857              int band_list = 0, GIntBig buf_pixel_space = None,
    1858              GIntBig buf_line_space = None,
    1859              GIntBig buf_band_space = None, GDALRIOResampleAlg resample_alg = GRIORA_NearestNeighbour,
    1860              GDALProgressFunc callback = None,
    1861              void callback_data = None) -> CPLErr
    1862          """
    1863          return _gdal.Dataset_ReadRaster1(self, *args, **kwargs)
    1864
    1865 -    def ReadAsArray(self, xoff=0, yoff=0, xsize=None, ysize=None, buf_obj=None,
    1866                      buf_xsize = None, buf_ysize = None, buf_type = None,
    1867                      resample_alg = GRIORA_NearestNeighbour,
    1868                      callback = None,
    1869                      callback_data = None):
    1870          """ Reading a chunk of a GDAL band into a numpy array. The optional (buf_xsize,buf_ysize,buf_type)
    1871          parameters should generally not be specified if buf_obj is specified. The array is returned"""
    1872
    1873          import gdalnumeric
    1874          return gdalnumeric.DatasetReadAsArray( self, xoff, yoff, xsize, ysize, buf_obj,
    1875                                                 buf_xsize, buf_ysize, buf_type,
    1876                                                 resample_alg = resample_alg,
    1877                                                 callback = callback,
    1878                                                 callback_data = callback_data )
    1879
    1880 -    def WriteRaster(self, xoff, yoff, xsize, ysize,
    1881                      buf_string,
    1882                      buf_xsize = None, buf_ysize = None, buf_type = None,
    1883                      band_list = None,
    1884                      buf_pixel_space = None, buf_line_space = None, buf_band_space = None ):
    1885
    1886          if buf_xsize is None:
    1887              buf_xsize = xsize;
    1888          if buf_ysize is None:
    1889              buf_ysize = ysize;
    1890          if band_list is None:
    1891              band_list = range(1,self.RasterCount+1)
    1892          if buf_type is None:
    1893              buf_type = self.GetRasterBand(1).DataType
    1894
    1895          return _gdal.Dataset_WriteRaster(self,
    1896                   xoff, yoff, xsize, ysize,
    1897                  buf_string, buf_xsize, buf_ysize, buf_type, band_list,
    1898                  buf_pixel_space, buf_line_space, buf_band_space )
    1899
    1900 -    def ReadRaster(self, xoff = 0, yoff = 0, xsize = None, ysize = None,
    1901                     buf_xsize = None, buf_ysize = None, buf_type = None,
    1902                     band_list = None,
    1903                     buf_pixel_space = None, buf_line_space = None, buf_band_space = None,
    1904                     resample_alg = GRIORA_NearestNeighbour,
    1905                     callback = None,
    1906                     callback_data = None):
    1907
    1908          if xsize is None:
    1909              xsize = self.RasterXSize
    1910          if ysize is None:
    1911              ysize = self.RasterYSize
    1912          if band_list is None:
    1913              band_list = range(1,self.RasterCount+1)
    1914          if buf_xsize is None:
    1915              buf_xsize = xsize;
    1916          if buf_ysize is None:
    1917              buf_ysize = ysize;
    1918
    1919          if buf_type is None:
    1920              buf_type = self.GetRasterBand(1).DataType;
    1921
    1922          return _gdal.Dataset_ReadRaster1(self, xoff, yoff, xsize, ysize,
    1923                                              buf_xsize, buf_ysize, buf_type,
    1924                                              band_list, buf_pixel_space, buf_line_space, buf_band_space,
    1925                                            resample_alg, callback, callback_data )
    1926
    1927 -    def GetVirtualMemArray(self, eAccess = gdalconst.GF_Read, xoff=0, yoff=0,
    1928                             xsize=None, ysize=None, bufxsize=None, bufysize=None,
    1929                             datatype = None, band_list = None, band_sequential = True,
    1930                             cache_size = 10 * 1024 * 1024, page_size_hint = 0,
    1931                             options = None):
    1932          """Return a NumPy array for the dataset, seen as a virtual memory mapping.
    1933             If there are several bands and band_sequential = True, an element is
    1934             accessed with array[band][y][x].
    1935             If there are several bands and band_sequential = False, an element is
    1936             accessed with array[y][x][band].
    1937             If there is only one band, an element is accessed with array[y][x].
    1938             Any reference to the array must be dropped before the last reference to the
    1939             related dataset is also dropped.
    1940          """
    1941          import gdalnumeric
    1942          if xsize is None:
    1943              xsize = self.RasterXSize
    1944          if ysize is None:
    1945              ysize = self.RasterYSize
    1946          if bufxsize is None:
    1947              bufxsize = self.RasterXSize
    1948          if bufysize is None:
    1949              bufysize = self.RasterYSize
    1950          if datatype is None:
    1951              datatype = self.GetRasterBand(1).DataType
    1952          if band_list is None:
    1953              band_list = range(1,self.RasterCount+1)
    1954          if options is None:
    1955              virtualmem = self.GetVirtualMem(eAccess,xoff,yoff,xsize,ysize,bufxsize,bufysize,datatype,band_list,band_sequential,cache_size,page_size_hint)
    1956          else:
    1957              virtualmem = self.GetVirtualMem(eAccess,xoff,yoff,xsize,ysize,bufxsize,bufysize,datatype,band_list,band_sequential,cache_size,page_size_hint, options)
    1958          return gdalnumeric.VirtualMemGetArray( virtualmem )
    1959
    1960 -    def GetTiledVirtualMemArray(self, eAccess = gdalconst.GF_Read, xoff=0, yoff=0,
    1961                             xsize=None, ysize=None, tilexsize=256, tileysize=256,
    1962                             datatype = None, band_list = None, tile_organization = gdalconst.GTO_BSQ,
    1963                             cache_size = 10 * 1024 * 1024, options = None):
    1964          """Return a NumPy array for the dataset, seen as a virtual memory mapping with
    1965             a tile organization.
    1966             If there are several bands and tile_organization = gdal.GTO_TIP, an element is
    1967             accessed with array[tiley][tilex][y][x][band].
    1968             If there are several bands and tile_organization = gdal.GTO_BIT, an element is
    1969             accessed with array[tiley][tilex][band][y][x].
    1970             If there are several bands and tile_organization = gdal.GTO_BSQ, an element is
    1971             accessed with array[band][tiley][tilex][y][x].
    1972             If there is only one band, an element is accessed with array[tiley][tilex][y][x].
    1973             Any reference to the array must be dropped before the last reference to the
    1974             related dataset is also dropped.
    1975          """
    1976          import gdalnumeric
    1977          if xsize is None:
    1978              xsize = self.RasterXSize
    1979          if ysize is None:
    1980              ysize = self.RasterYSize
    1981          if datatype is None:
    1982              datatype = self.GetRasterBand(1).DataType
    1983          if band_list is None:
    1984              band_list = range(1,self.RasterCount+1)
    1985          if options is None:
    1986              virtualmem = self.GetTiledVirtualMem(eAccess,xoff,yoff,xsize,ysize,tilexsize,tileysize,datatype,band_list,tile_organization,cache_size)
    1987          else:
    1988              virtualmem = self.GetTiledVirtualMem(eAccess,xoff,yoff,xsize,ysize,tilexsize,tileysize,datatype,band_list,tile_organization,cache_size, options)
    1989          return gdalnumeric.VirtualMemGetArray( virtualmem )
    1990
    1991 -    def GetSubDatasets(self):
    1992          sd_list = []
    1993
    1994          sd = self.GetMetadata('SUBDATASETS')
    1995          if sd is None:
    1996              return sd_list
    1997
    1998          i = 1
    1999          while 'SUBDATASET_'+str(i)+'_NAME' in sd:
    2000              sd_list.append( ( sd['SUBDATASET_'+str(i)+'_NAME'],
    2001                                sd['SUBDATASET_'+str(i)+'_DESC'] ) )
    2002              i = i + 1
    2003          return sd_list
    2004
    2005 -    def BeginAsyncReader(self, xoff, yoff, xsize, ysize, buf_obj = None, buf_xsize = None, buf_ysize = None, buf_type = None, band_list = None, options=[]):
    2006          if band_list is None:
    2007              band_list = range(1, self.RasterCount + 1)
    2008          if buf_xsize is None:
    2009              buf_xsize = 0;
    2010          if buf_ysize is None:
    2011              buf_ysize = 0;
    2012          if buf_type is None:
    2013              buf_type = GDT_Byte
    2014
    2015          if buf_xsize <= 0:
    2016              buf_xsize = xsize
    2017          if buf_ysize <= 0:
    2018              buf_ysize = ysize
    2019
    2020          if buf_obj is None:
    2021              from sys import version_info
    2022              nRequiredSize = int(buf_xsize * buf_ysize * len(band_list) * (_gdal.GetDataTypeSize(buf_type) / 8))
    2023              if version_info >= (3,0,0):
    2024                  buf_obj_ar = [ None ]
    2025                  exec("buf_obj_ar[0] = b' ' * nRequiredSize")
    2026                  buf_obj = buf_obj_ar[0]
    2027              else:
    2028                  buf_obj = ' ' * nRequiredSize
    2029          return _gdal.Dataset_BeginAsyncReader(self, xoff, yoff, xsize, ysize, buf_obj, buf_xsize, buf_ysize, buf_type, band_list,  0, 0, 0, options)
    2030
    2031 -    def GetLayer(self,iLayer=0):
    2032          """Return the layer given an index or a name"""
    2033          if isinstance(iLayer, str):
    2034              return self.GetLayerByName(str(iLayer))
    2035          elif isinstance(iLayer, int):
    2036              return self.GetLayerByIndex(iLayer)
    2037          else:
    2038              raise TypeError("Input %s is not of String or Int type" % type(iLayer))
    2039
    2040 -    def DeleteLayer(self, value):
    2041          """Deletes the layer given an index or layer name"""
    2042          if isinstance(value, str):
    2043              for i in range(self.GetLayerCount()):
    2044                  name = self.GetLayer(i).GetName()
    2045                  if name == value:
    2046                      return _gdal.Dataset_DeleteLayer(self, i)
    2047              raise ValueError("Layer %s not found to delete" % value)
    2048          elif isinstance(value, int):
    2049              return _gdal.Dataset_DeleteLayer(self, value)
    2050          else:
    2051              raise TypeError("Input %s is not of String or Int type" % type(value))
    2052
    2053  Dataset_swigregister = _gdal.Dataset_swigregister
    2054  Dataset_swigregister(Dataset)
    2055
    2056 -class Band(MajorObject):
    2057      """Proxy of C++ GDALRasterBandShadow class"""
    2058      __swig_setmethods__ = {}
    2059      for _s in [MajorObject]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
    2060      __setattr__ = lambda self, name, value: _swig_setattr(self, Band, name, value)
    2061      __swig_getmethods__ = {}
    2062      for _s in [MajorObject]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
    2063      __getattr__ = lambda self, name: _swig_getattr(self, Band, name)
    2064 -    def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined")
    2065      __repr__ = _swig_repr
    2066      __swig_getmethods__["XSize"] = _gdal.Band_XSize_get
    2067      if _newclass:XSize = _swig_property(_gdal.Band_XSize_get)
    2068      __swig_getmethods__["YSize"] = _gdal.Band_YSize_get
    2069      if _newclass:YSize = _swig_property(_gdal.Band_YSize_get)
    2070      __swig_getmethods__["DataType"] = _gdal.Band_DataType_get
    2071      if _newclass:DataType = _swig_property(_gdal.Band_DataType_get)
    2072 -    def GetDataset(self, *args):
    2073          """GetDataset(self) -> Dataset"""
    2074          return _gdal.Band_GetDataset(self, *args)
    2075
    2076 -    def GetBand(self, *args):
    2077          """GetBand(self) -> int"""
    2078          return _gdal.Band_GetBand(self, *args)
    2079
    2080 -    def GetBlockSize(self, *args):
    2081          """GetBlockSize(self)"""
    2082          return _gdal.Band_GetBlockSize(self, *args)
    2083
    2084 -    def GetColorInterpretation(self, *args):
    2085          """GetColorInterpretation(self) -> GDALColorInterp"""
    2086          return _gdal.Band_GetColorInterpretation(self, *args)
    2087
    2088 -    def GetRasterColorInterpretation(self, *args):
    2089          """GetRasterColorInterpretation(self) -> GDALColorInterp"""
    2090          return _gdal.Band_GetRasterColorInterpretation(self, *args)
    2091
    2092 -    def SetColorInterpretation(self, *args):
    2093          """SetColorInterpretation(self, GDALColorInterp val) -> CPLErr"""
    2094          return _gdal.Band_SetColorInterpretation(self, *args)
    2095
    2096 -    def SetRasterColorInterpretation(self, *args):
    2097          """SetRasterColorInterpretation(self, GDALColorInterp val) -> CPLErr"""
    2098          return _gdal.Band_SetRasterColorInterpretation(self, *args)
    2099
    2100 -    def GetNoDataValue(self, *args):
    2101          """GetNoDataValue(self)"""
    2102          return _gdal.Band_GetNoDataValue(self, *args)
    2103
    2104 -    def SetNoDataValue(self, *args):
    2105          """SetNoDataValue(self, double d) -> CPLErr"""
    2106          return _gdal.Band_SetNoDataValue(self, *args)
    2107
    2108 -    def DeleteNoDataValue(self, *args):
    2109          """DeleteNoDataValue(self) -> CPLErr"""
    2110          return _gdal.Band_DeleteNoDataValue(self, *args)
    2111
    2112 -    def GetUnitType(self, *args):
    2113          """GetUnitType(self) -> char"""
    2114          return _gdal.Band_GetUnitType(self, *args)
    2115
    2116 -    def SetUnitType(self, *args):
    2117          """SetUnitType(self, char val) -> CPLErr"""
    2118          return _gdal.Band_SetUnitType(self, *args)
    2119
    2120 -    def GetRasterCategoryNames(self, *args):
    2121          """GetRasterCategoryNames(self) -> char"""
    2122          return _gdal.Band_GetRasterCategoryNames(self, *args)
    2123
    2124 -    def SetRasterCategoryNames(self, *args):
    2125          """SetRasterCategoryNames(self, char names) -> CPLErr"""
    2126          return _gdal.Band_SetRasterCategoryNames(self, *args)
    2127
    2128 -    def GetMinimum(self, *args):
    2129          """GetMinimum(self)"""
    2130          return _gdal.Band_GetMinimum(self, *args)
    2131
    2132 -    def GetMaximum(self, *args):
    2133          """GetMaximum(self)"""
    2134          return _gdal.Band_GetMaximum(self, *args)
    2135
    2136 -    def GetOffset(self, *args):
    2137          """GetOffset(self)"""
    2138          return _gdal.Band_GetOffset(self, *args)
    2139
    2140 -    def GetScale(self, *args):
    2141          """GetScale(self)"""
    2142          return _gdal.Band_GetScale(self, *args)
    2143
    2144 -    def SetOffset(self, *args):
    2145          """SetOffset(self, double val) -> CPLErr"""
    2146          return _gdal.Band_SetOffset(self, *args)
    2147
    2148 -    def SetScale(self, *args):
    2149          """SetScale(self, double val) -> CPLErr"""
    2150          return _gdal.Band_SetScale(self, *args)
    2151
    2152 -    def GetStatistics(self, *args):
    2153          """GetStatistics(self, int approx_ok, int force) -> CPLErr"""
    2154          return _gdal.Band_GetStatistics(self, *args)
    2155
    2156 -    def ComputeStatistics(self, *args):
    2157          """ComputeStatistics(self, bool approx_ok, GDALProgressFunc callback = None, void callback_data = None) -> CPLErr"""
    2158          return _gdal.Band_ComputeStatistics(self, *args)
    2159
    2160 -    def SetStatistics(self, *args):
    2161          """SetStatistics(self, double min, double max, double mean, double stddev) -> CPLErr"""
    2162          return _gdal.Band_SetStatistics(self, *args)
    2163
    2164 -    def GetOverviewCount(self, *args):
    2165          """GetOverviewCount(self) -> int"""
    2166          return _gdal.Band_GetOverviewCount(self, *args)
    2167
    2168 -    def GetOverview(self, *args):
    2169          """GetOverview(self, int i) -> Band"""
    2170          return _gdal.Band_GetOverview(self, *args)
    2171
    2172 -    def Checksum(self, *args, **kwargs):
    2173          """Checksum(self, int xoff = 0, int yoff = 0, int xsize = None, int ysize = None) -> int"""
    2174          return _gdal.Band_Checksum(self, *args, **kwargs)
    2175
    2176 -    def ComputeRasterMinMax(self, *args):
    2177          """ComputeRasterMinMax(self, int approx_ok = 0)"""
    2178          return _gdal.Band_ComputeRasterMinMax(self, *args)
    2179
    2180 -    def ComputeBandStats(self, *args):
    2181          """ComputeBandStats(self, int samplestep = 1)"""
    2182          return _gdal.Band_ComputeBandStats(self, *args)
    2183
    2184 -    def Fill(self, *args):
    2185          """Fill(self, double real_fill, double imag_fill = 0.0) -> CPLErr"""
    2186          return _gdal.Band_Fill(self, *args)
    2187
    2188 -    def WriteRaster(self, *args, **kwargs):
    2189          """
    2190          WriteRaster(self, int xoff, int yoff, int xsize, int ysize, GIntBig buf_len,
    2191              int buf_xsize = None, int buf_ysize = None,
    2192              int buf_type = None, GIntBig buf_pixel_space = None,
    2193              GIntBig buf_line_space = None) -> CPLErr
    2194          """
    2195          return _gdal.Band_WriteRaster(self, *args, **kwargs)
    2196
    2197 -    def FlushCache(self, *args):
    2198          """FlushCache(self)"""
    2199          return _gdal.Band_FlushCache(self, *args)
    2200
    2201 -    def GetRasterColorTable(self, *args):
    2202          """GetRasterColorTable(self) -> ColorTable"""
    2203          return _gdal.Band_GetRasterColorTable(self, *args)
    2204
    2205 -    def GetColorTable(self, *args):
    2206          """GetColorTable(self) -> ColorTable"""
    2207          return _gdal.Band_GetColorTable(self, *args)
    2208
    2209 -    def SetRasterColorTable(self, *args):
    2210          """SetRasterColorTable(self, ColorTable arg) -> int"""
    2211          return _gdal.Band_SetRasterColorTable(self, *args)
    2212
    2213 -    def SetColorTable(self, *args):
    2214          """SetColorTable(self, ColorTable arg) -> int"""
    2215          return _gdal.Band_SetColorTable(self, *args)
    2216
    2217 -    def GetDefaultRAT(self, *args):
    2218          """GetDefaultRAT(self) -> RasterAttributeTable"""
    2219          return _gdal.Band_GetDefaultRAT(self, *args)
    2220
    2221 -    def SetDefaultRAT(self, *args):
    2222          """SetDefaultRAT(self, RasterAttributeTable table) -> int"""
    2223          return _gdal.Band_SetDefaultRAT(self, *args)
    2224
    2225 -    def GetMaskBand(self, *args):
    2226          """GetMaskBand(self) -> Band"""
    2227          return _gdal.Band_GetMaskBand(self, *args)
    2228
    2229 -    def GetMaskFlags(self, *args):
    2230          """GetMaskFlags(self) -> int"""
    2231          return _gdal.Band_GetMaskFlags(self, *args)
    2232
    2233 -    def CreateMaskBand(self, *args):
    2234          """CreateMaskBand(self, int nFlags) -> CPLErr"""
    2235          return _gdal.Band_CreateMaskBand(self, *args)
    2236
    2237 -    def GetHistogram(self, *args, **kwargs):
    2238          """
    2239          GetHistogram(self, double min = -0.5, double max = 255.5, int buckets = 256,
    2240              int include_out_of_range = 0, int approx_ok = 1,
    2241              GDALProgressFunc callback = None,
    2242              void callback_data = None) -> CPLErr
    2243          """
    2244          return _gdal.Band_GetHistogram(self, *args, **kwargs)
    2245
    2246 -    def GetDefaultHistogram(self, *args, **kwargs):
    2247          """
    2248          GetDefaultHistogram(self, double min_ret = None, double max_ret = None, int buckets_ret = None,
    2249              GUIntBig ppanHistogram = None,
    2250              int force = 1, GDALProgressFunc callback = None,
    2251              void callback_data = None) -> CPLErr
    2252          """
    2253          return _gdal.Band_GetDefaultHistogram(self, *args, **kwargs)
    2254
    2255 -    def SetDefaultHistogram(self, *args):
    2256          """SetDefaultHistogram(self, double min, double max, int buckets_in) -> CPLErr"""
    2257          return _gdal.Band_SetDefaultHistogram(self, *args)
    2258
    2259 -    def HasArbitraryOverviews(self, *args):
    2260          """HasArbitraryOverviews(self) -> bool"""
    2261          return _gdal.Band_HasArbitraryOverviews(self, *args)
    2262
    2263 -    def GetCategoryNames(self, *args):
    2264          """GetCategoryNames(self) -> char"""
    2265          return _gdal.Band_GetCategoryNames(self, *args)
    2266
    2267 -    def SetCategoryNames(self, *args):
    2268          """SetCategoryNames(self, char papszCategoryNames) -> CPLErr"""
    2269          return _gdal.Band_SetCategoryNames(self, *args)
    2270
    2271 -    def GetVirtualMem(self, *args, **kwargs):
    2272          """
    2273          GetVirtualMem(self, GDALRWFlag eRWFlag, int nXOff, int nYOff, int nXSize,
    2274              int nYSize, int nBufXSize, int nBufYSize,
    2275              GDALDataType eBufType, size_t nCacheSize, size_t nPageSizeHint,
    2276              char options = None) -> VirtualMem
    2277          """
    2278          return _gdal.Band_GetVirtualMem(self, *args, **kwargs)
    2279
    2280 -    def GetVirtualMemAuto(self, *args, **kwargs):
    2281          """GetVirtualMemAuto(self, GDALRWFlag eRWFlag, char options = None) -> VirtualMem"""
    2282          return _gdal.Band_GetVirtualMemAuto(self, *args, **kwargs)
    2283
    2284 -    def GetTiledVirtualMem(self, *args, **kwargs):
    2285          """
    2286          GetTiledVirtualMem(self, GDALRWFlag eRWFlag, int nXOff, int nYOff, int nXSize,
    2287              int nYSize, int nTileXSize, int nTileYSize,
    2288              GDALDataType eBufType, size_t nCacheSize, char options = None) -> VirtualMem
    2289          """
    2290          return _gdal.Band_GetTiledVirtualMem(self, *args, **kwargs)
    2291
    2292 -    def ReadRaster1(self, *args, **kwargs):
    2293          """
    2294          ReadRaster1(self, double xoff, double yoff, double xsize, double ysize,
    2295              int buf_xsize = None, int buf_ysize = None,
    2296              int buf_type = None, GIntBig buf_pixel_space = None,
    2297              GIntBig buf_line_space = None, GDALRIOResampleAlg resample_alg = GRIORA_NearestNeighbour,
    2298              GDALProgressFunc callback = None,
    2299              void callback_data = None) -> CPLErr
    2300          """
    2301          return _gdal.Band_ReadRaster1(self, *args, **kwargs)
    2302
    2303 -    def ReadBlock(self, *args, **kwargs):
    2304          """ReadBlock(self, int xoff, int yoff) -> CPLErr"""
    2305          return _gdal.Band_ReadBlock(self, *args, **kwargs)
    2306
    2307 -    def ReadRaster(self, xoff = 0, yoff = 0, xsize = None, ysize = None,
    2308                       buf_xsize = None, buf_ysize = None, buf_type = None,
    2309                       buf_pixel_space = None, buf_line_space = None,
    2310                       resample_alg = GRIORA_NearestNeighbour,
    2311                       callback = None,
    2312                       callback_data = None):
    2313
    2314          if xsize is None:
    2315              xsize = self.XSize
    2316          if ysize is None:
    2317              ysize = self.YSize
    2318
    2319          return _gdal.Band_ReadRaster1(self, xoff, yoff, xsize, ysize,
    2320                                        buf_xsize, buf_ysize, buf_type,
    2321                                        buf_pixel_space, buf_line_space,
    2322                                        resample_alg, callback, callback_data)
    2323
    2324 -    def ReadAsArray(self, xoff=0, yoff=0, win_xsize=None, win_ysize=None,
    2325                      buf_xsize=None, buf_ysize=None, buf_type=None, buf_obj=None,
    2326                      resample_alg = GRIORA_NearestNeighbour,
    2327                      callback = None,
    2328                      callback_data = None):
    2329          """ Reading a chunk of a GDAL band into a numpy array. The optional (buf_xsize,buf_ysize,buf_type)
    2330          parameters should generally not be specified if buf_obj is specified. The array is returned"""
    2331
    2332          import gdalnumeric
    2333
    2334          return gdalnumeric.BandReadAsArray( self, xoff, yoff,
    2335                                              win_xsize, win_ysize,
    2336                                              buf_xsize, buf_ysize, buf_type, buf_obj,
    2337                                              resample_alg = resample_alg,
    2338                                              callback = callback,
    2339                                              callback_data = callback_data)
    2340
    2341 -    def WriteArray(self, array, xoff=0, yoff=0,
    2342                     resample_alg = GRIORA_NearestNeighbour,
    2343                     callback = None,
    2344                     callback_data = None):
    2345          import gdalnumeric
    2346
    2347          return gdalnumeric.BandWriteArray( self, array, xoff, yoff,
    2348                                             resample_alg = resample_alg,
    2349                                             callback = callback,
    2350                                             callback_data = callback_data )
    2351
    2352 -    def GetVirtualMemArray(self, eAccess = gdalconst.GF_Read, xoff=0, yoff=0,
    2353                             xsize=None, ysize=None, bufxsize=None, bufysize=None,
    2354                             datatype = None,
    2355                             cache_size = 10 * 1024 * 1024, page_size_hint = 0,
    2356                             options = None):
    2357            """Return a NumPy array for the band, seen as a virtual memory mapping.
    2358               An element is accessed with array[y][x].
    2359               Any reference to the array must be dropped before the last reference to the
    2360               related dataset is also dropped.
    2361            """
    2362            import gdalnumeric
    2363            if xsize is None:
    2364                xsize = self.XSize
    2365            if ysize is None:
    2366                ysize = self.YSize
    2367            if bufxsize is None:
    2368                bufxsize = self.XSize
    2369            if bufysize is None:
    2370                bufysize = self.YSize
    2371            if datatype is None:
    2372                datatype = self.DataType
    2373            if options is None:
    2374                virtualmem = self.GetVirtualMem(eAccess,xoff,yoff,xsize,ysize,bufxsize,bufysize,datatype,cache_size,page_size_hint)
    2375            else:
    2376                virtualmem = self.GetVirtualMem(eAccess,xoff,yoff,xsize,ysize,bufxsize,bufysize,datatype,cache_size,page_size_hint,options)
    2377            return gdalnumeric.VirtualMemGetArray( virtualmem )
    2378
    2379 -    def GetVirtualMemAutoArray(self, eAccess = gdalconst.GF_Read, options = None):
    2380            """Return a NumPy array for the band, seen as a virtual memory mapping.
    2381               An element is accessed with array[y][x].
    2382               Any reference to the array must be dropped before the last reference to the
    2383               related dataset is also dropped.
    2384            """
    2385            import gdalnumeric
    2386            if options is None:
    2387                virtualmem = self.GetVirtualMemAuto(eAccess)
    2388            else:
    2389                virtualmem = self.GetVirtualMemAuto(eAccess,options)
    2390            return gdalnumeric.VirtualMemGetArray( virtualmem )
    2391
    2392 -    def GetTiledVirtualMemArray(self, eAccess = gdalconst.GF_Read, xoff=0, yoff=0,
    2393                               xsize=None, ysize=None, tilexsize=256, tileysize=256,
    2394                               datatype = None,
    2395                               cache_size = 10 * 1024 * 1024, options = None):
    2396            """Return a NumPy array for the band, seen as a virtual memory mapping with
    2397               a tile organization.
    2398               An element is accessed with array[tiley][tilex][y][x].
    2399               Any reference to the array must be dropped before the last reference to the
    2400               related dataset is also dropped.
    2401            """
    2402            import gdalnumeric
    2403            if xsize is None:
    2404                xsize = self.XSize
    2405            if ysize is None:
    2406                ysize = self.YSize
    2407            if datatype is None:
    2408                datatype = self.DataType
    2409            if options is None:
    2410                virtualmem = self.GetTiledVirtualMem(eAccess,xoff,yoff,xsize,ysize,tilexsize,tileysize,datatype,cache_size)
    2411            else:
    2412                virtualmem = self.GetTiledVirtualMem(eAccess,xoff,yoff,xsize,ysize,tilexsize,tileysize,datatype,cache_size,options)
    2413            return gdalnumeric.VirtualMemGetArray( virtualmem )
    2414
    2415 -    def __get_array_interface__(self):
    2416          shape = [1, self.XSize, self.YSize]
    2417
    2418
    2419  Band_swigregister = _gdal.Band_swigregister
    2420  Band_swigregister(Band)
    2421
    2422 -class ColorTable(_object):
    2423      """Proxy of C++ GDALColorTableShadow class"""
    2424      __swig_setmethods__ = {}
    2425      __setattr__ = lambda self, name, value: _swig_setattr(self, ColorTable, name, value)
    2426      __swig_getmethods__ = {}
    2427      __getattr__ = lambda self, name: _swig_getattr(self, ColorTable, name)
    2428      __repr__ = _swig_repr
    2429 -    def __init__(self, *args, **kwargs):
    2430          """__init__(self, GDALPaletteInterp palette = GPI_RGB) -> ColorTable"""
    2431          this = _gdal.new_ColorTable(*args, **kwargs)
    2432          try: self.this.append(this)
    2433          except: self.this = this
    2434      __swig_destroy__ = _gdal.delete_ColorTable
    2435      __del__ = lambda self : None;
    2436 -    def Clone(self, *args):
    2437          """Clone(self) -> ColorTable"""
    2438          return _gdal.ColorTable_Clone(self, *args)
    2439
    2440 -    def GetPaletteInterpretation(self, *args):
    2441          """GetPaletteInterpretation(self) -> GDALPaletteInterp"""
    2442          return _gdal.ColorTable_GetPaletteInterpretation(self, *args)
    2443
    2444 -    def GetCount(self, *args):
    2445          """GetCount(self) -> int"""
    2446          return _gdal.ColorTable_GetCount(self, *args)
    2447
    2448 -    def GetColorEntry(self, *args):
    2449          """GetColorEntry(self, int entry) -> ColorEntry"""
    2450          return _gdal.ColorTable_GetColorEntry(self, *args)
    2451
    2452 -    def GetColorEntryAsRGB(self, *args):
    2453          """GetColorEntryAsRGB(self, int entry, ColorEntry centry) -> int"""
    2454          return _gdal.ColorTable_GetColorEntryAsRGB(self, *args)
    2455
    2456 -    def SetColorEntry(self, *args):
    2457          """SetColorEntry(self, int entry, ColorEntry centry)"""
    2458          return _gdal.ColorTable_SetColorEntry(self, *args)
    2459
    2460 -    def CreateColorRamp(self, *args):
    2461          """
    2462          CreateColorRamp(self, int nStartIndex, ColorEntry startcolor, int nEndIndex,
    2463              ColorEntry endcolor)
    2464          """
    2465          return _gdal.ColorTable_CreateColorRamp(self, *args)
    2466
    2467  ColorTable_swigregister = _gdal.ColorTable_swigregister
    2468  ColorTable_swigregister(ColorTable)
    2469
    2470 -class RasterAttributeTable(_object):
    2471      """Proxy of C++ GDALRasterAttributeTableShadow class"""
    2472      __swig_setmethods__ = {}
    2473      __setattr__ = lambda self, name, value: _swig_setattr(self, RasterAttributeTable, name, value)
    2474      __swig_getmethods__ = {}
    2475      __getattr__ = lambda self, name: _swig_getattr(self, RasterAttributeTable, name)
    2476      __repr__ = _swig_repr
    2477 -    def __init__(self, *args):
    2478          """__init__(self) -> RasterAttributeTable"""
    2479          this = _gdal.new_RasterAttributeTable(*args)
    2480          try: self.this.append(this)
    2481          except: self.this = this
    2482      __swig_destroy__ = _gdal.delete_RasterAttributeTable
    2483      __del__ = lambda self : None;
    2484 -    def Clone(self, *args):
    2485          """Clone(self) -> RasterAttributeTable"""
    2486          return _gdal.RasterAttributeTable_Clone(self, *args)
    2487
    2488 -    def GetColumnCount(self, *args):
    2489          """GetColumnCount(self) -> int"""
    2490          return _gdal.RasterAttributeTable_GetColumnCount(self, *args)
    2491
    2492 -    def GetNameOfCol(self, *args):
    2493          """GetNameOfCol(self, int iCol) -> char"""
    2494          return _gdal.RasterAttributeTable_GetNameOfCol(self, *args)
    2495
    2496 -    def GetUsageOfCol(self, *args):
    2497          """GetUsageOfCol(self, int iCol) -> GDALRATFieldUsage"""
    2498          return _gdal.RasterAttributeTable_GetUsageOfCol(self, *args)
    2499
    2500 -    def GetTypeOfCol(self, *args):
    2501          """GetTypeOfCol(self, int iCol) -> GDALRATFieldType"""
    2502          return _gdal.RasterAttributeTable_GetTypeOfCol(self, *args)
    2503
    2504 -    def GetColOfUsage(self, *args):
    2505          """GetColOfUsage(self, GDALRATFieldUsage eUsage) -> int"""
    2506          return _gdal.RasterAttributeTable_GetColOfUsage(self, *args)
    2507
    2508 -    def GetRowCount(self, *args):
    2509          """GetRowCount(self) -> int"""
    2510          return _gdal.RasterAttributeTable_GetRowCount(self, *args)
    2511
    2512 -    def GetValueAsString(self, *args):
    2513          """GetValueAsString(self, int iRow, int iCol) -> char"""
    2514          return _gdal.RasterAttributeTable_GetValueAsString(self, *args)
    2515
    2516 -    def GetValueAsInt(self, *args):
    2517          """GetValueAsInt(self, int iRow, int iCol) -> int"""
    2518          return _gdal.RasterAttributeTable_GetValueAsInt(self, *args)
    2519
    2520 -    def GetValueAsDouble(self, *args):
    2521          """GetValueAsDouble(self, int iRow, int iCol) -> double"""
    2522          return _gdal.RasterAttributeTable_GetValueAsDouble(self, *args)
    2523
    2524 -    def SetValueAsString(self, *args):
    2525          """SetValueAsString(self, int iRow, int iCol, char pszValue)"""
    2526          return _gdal.RasterAttributeTable_SetValueAsString(self, *args)
    2527
    2528 -    def SetValueAsInt(self, *args):
    2529          """SetValueAsInt(self, int iRow, int iCol, int nValue)"""
    2530          return _gdal.RasterAttributeTable_SetValueAsInt(self, *args)
    2531
    2532 -    def SetValueAsDouble(self, *args):
    2533          """SetValueAsDouble(self, int iRow, int iCol, double dfValue)"""
    2534          return _gdal.RasterAttributeTable_SetValueAsDouble(self, *args)
    2535
    2536 -    def SetRowCount(self, *args):
    2537          """SetRowCount(self, int nCount)"""
    2538          return _gdal.RasterAttributeTable_SetRowCount(self, *args)
    2539
    2540 -    def CreateColumn(self, *args):
    2541          """CreateColumn(self, char pszName, GDALRATFieldType eType, GDALRATFieldUsage eUsage) -> int"""
    2542          return _gdal.RasterAttributeTable_CreateColumn(self, *args)
    2543
    2544 -    def GetLinearBinning(self, *args):
    2545          """GetLinearBinning(self) -> bool"""
    2546          return _gdal.RasterAttributeTable_GetLinearBinning(self, *args)
    2547
    2548 -    def SetLinearBinning(self, *args):
    2549          """SetLinearBinning(self, double dfRow0Min, double dfBinSize) -> int"""
    2550          return _gdal.RasterAttributeTable_SetLinearBinning(self, *args)
    2551
    2552 -    def GetRowOfValue(self, *args):
    2553          """GetRowOfValue(self, double dfValue) -> int"""
    2554          return _gdal.RasterAttributeTable_GetRowOfValue(self, *args)
    2555
    2556 -    def ChangesAreWrittenToFile(self, *args):
    2557          """ChangesAreWrittenToFile(self) -> int"""
    2558          return _gdal.RasterAttributeTable_ChangesAreWrittenToFile(self, *args)
    2559
    2560 -    def DumpReadable(self, *args):
    2561          """DumpReadable(self)"""
    2562          return _gdal.RasterAttributeTable_DumpReadable(self, *args)
    2563
    2564 -    def WriteArray(self, array, field, start=0):
    2565          import gdalnumeric
    2566
    2567          return gdalnumeric.RATWriteArray(self, array, field, start)
    2568
    2569 -    def ReadAsArray(self, field, start=0, length=None):
    2570          import gdalnumeric
    2571
    2572          return gdalnumeric.RATReadArray(self, field, start, length)
    2573
    2574  RasterAttributeTable_swigregister = _gdal.RasterAttributeTable_swigregister
    2575  RasterAttributeTable_swigregister(RasterAttributeTable)
    2576
    2577
    2578 -def TermProgress_nocb(*args, **kwargs):
    2579    """TermProgress_nocb(double dfProgress, char pszMessage = None, void pData = None) -> int"""
    2580    return _gdal.TermProgress_nocb(*args, **kwargs)
    2581  TermProgress = _gdal.TermProgress
    2582
    2583 -def ComputeMedianCutPCT(*args, **kwargs):
    2584    """
    2585      ComputeMedianCutPCT(Band red, Band green, Band blue, int num_colors, ColorTable colors,
    2586          GDALProgressFunc callback = None,
    2587          void callback_data = None) -> int
    2588      """
    2589    return _gdal.ComputeMedianCutPCT(*args, **kwargs)
    2590  ComputeMedianCutPCT = _gdal.ComputeMedianCutPCT
    2591
    2592 -def DitherRGB2PCT(*args, **kwargs):
    2593    """
    2594      DitherRGB2PCT(Band red, Band green, Band blue, Band target, ColorTable colors,
    2595          GDALProgressFunc callback = None,
    2596          void callback_data = None) -> int
    2597      """
    2598    return _gdal.DitherRGB2PCT(*args, **kwargs)
    2599  DitherRGB2PCT = _gdal.DitherRGB2PCT
    2600
    2601 -def ReprojectImage(*args, **kwargs):
    2602    """
    2603      ReprojectImage(Dataset src_ds, Dataset dst_ds, char src_wkt = None,
    2604          char dst_wkt = None, GDALResampleAlg eResampleAlg = GRA_NearestNeighbour,
    2605          double WarpMemoryLimit = 0.0,
    2606          double maxerror = 0.0, GDALProgressFunc callback = None,
    2607          void callback_data = None,
    2608          char options = None) -> CPLErr
    2609      """
    2610    return _gdal.ReprojectImage(*args, **kwargs)
    2611  ReprojectImage = _gdal.ReprojectImage
    2612
    2613 -def ComputeProximity(*args, **kwargs):
    2614    """
    2615      ComputeProximity(Band srcBand, Band proximityBand, char options = None,
    2616          GDALProgressFunc callback = None, void callback_data = None) -> int
    2617      """
    2618    return _gdal.ComputeProximity(*args, **kwargs)
    2619  ComputeProximity = _gdal.ComputeProximity
    2620
    2621 -def RasterizeLayer(*args, **kwargs):
    2622    """
    2623      RasterizeLayer(Dataset dataset, int bands, Layer layer, void pfnTransformer = None,
    2624          void pTransformArg = None,
    2625          int burn_values = 0, char options = None, GDALProgressFunc callback = None,
    2626          void callback_data = None) -> int
    2627      """
    2628    return _gdal.RasterizeLayer(*args, **kwargs)
    2629  RasterizeLayer = _gdal.RasterizeLayer
    2630
    2631 -def Polygonize(*args, **kwargs):
    2632    """
    2633      Polygonize(Band srcBand, Band maskBand, Layer outLayer, int iPixValField,
    2634          char options = None, GDALProgressFunc callback = None,
    2635          void callback_data = None) -> int
    2636      """
    2637    return _gdal.Polygonize(*args, **kwargs)
    2638  Polygonize = _gdal.Polygonize
    2639
    2640 -def FPolygonize(*args, **kwargs):
    2641    """
    2642      FPolygonize(Band srcBand, Band maskBand, Layer outLayer, int iPixValField,
    2643          char options = None, GDALProgressFunc callback = None,
    2644          void callback_data = None) -> int
    2645      """
    2646    return _gdal.FPolygonize(*args, **kwargs)
    2647  FPolygonize = _gdal.FPolygonize
    2648
    2649 -def FillNodata(*args, **kwargs):
    2650    """
    2651      FillNodata(Band targetBand, Band maskBand, double maxSearchDist,
    2652          int smoothingIterations, char options = None,
    2653          GDALProgressFunc callback = None, void callback_data = None) -> int
    2654      """
    2655    return _gdal.FillNodata(*args, **kwargs)
    2656  FillNodata = _gdal.FillNodata
    2657
    2658 -def SieveFilter(*args, **kwargs):
    2659    """
    2660      SieveFilter(Band srcBand, Band maskBand, Band dstBand, int threshold,
    2661          int connectedness = 4, char options = None,
    2662          GDALProgressFunc callback = None, void callback_data = None) -> int
    2663      """
    2664    return _gdal.SieveFilter(*args, **kwargs)
    2665  SieveFilter = _gdal.SieveFilter
    2666
    2667 -def RegenerateOverviews(*args, **kwargs):
    2668    """
    2669      RegenerateOverviews(Band srcBand, int overviewBandCount, char resampling = "average",
    2670          GDALProgressFunc callback = None,
    2671          void callback_data = None) -> int
    2672      """
    2673    return _gdal.RegenerateOverviews(*args, **kwargs)
    2674  RegenerateOverviews = _gdal.RegenerateOverviews
    2675
    2676 -def RegenerateOverview(*args, **kwargs):
    2677    """
    2678      RegenerateOverview(Band srcBand, Band overviewBand, char resampling = "average",
    2679          GDALProgressFunc callback = None,
    2680          void callback_data = None) -> int
    2681      """
    2682    return _gdal.RegenerateOverview(*args, **kwargs)
    2683  RegenerateOverview = _gdal.RegenerateOverview
    2684
    2685 -def ContourGenerate(*args, **kwargs):
    2686    """
    2687      ContourGenerate(Band srcBand, double contourInterval, double contourBase,
    2688          int fixedLevelCount, int useNoData, double noDataValue,
    2689          Layer dstLayer, int idField,
    2690          int elevField, GDALProgressFunc callback = None,
    2691          void callback_data = None) -> int
    2692      """
    2693    return _gdal.ContourGenerate(*args, **kwargs)
    2694  ContourGenerate = _gdal.ContourGenerate
    2695
    2696 -def AutoCreateWarpedVRT(*args):
    2697    """
    2698      AutoCreateWarpedVRT(Dataset src_ds, char src_wkt = None, char dst_wkt = None,
    2699          GDALResampleAlg eResampleAlg = GRA_NearestNeighbour,
    2700          double maxerror = 0.0) -> Dataset
    2701      """
    2702    return _gdal.AutoCreateWarpedVRT(*args)
    2703  AutoCreateWarpedVRT = _gdal.AutoCreateWarpedVRT
    2704
    2705 -def CreatePansharpenedVRT(*args):
    2706    """CreatePansharpenedVRT(char pszXML, Band panchroBand, int nInputSpectralBands) -> Dataset"""
    2707    return _gdal.CreatePansharpenedVRT(*args)
    2708  CreatePansharpenedVRT = _gdal.CreatePansharpenedVRT
    2709 -class Transformer(_object):
    2710      """Proxy of C++ GDALTransformerInfoShadow class"""
    2711      __swig_setmethods__ = {}
    2712      __setattr__ = lambda self, name, value: _swig_setattr(self, Transformer, name, value)
    2713      __swig_getmethods__ = {}
    2714      __getattr__ = lambda self, name: _swig_getattr(self, Transformer, name)
    2715      __repr__ = _swig_repr
    2716 -    def __init__(self, *args):
    2717          """__init__(self, Dataset src, Dataset dst, char options) -> Transformer"""
    2718          this = _gdal.new_Transformer(*args)
    2719          try: self.this.append(this)
    2720          except: self.this = this
    2721      __swig_destroy__ = _gdal.delete_Transformer
    2722      __del__ = lambda self : None;
    2723 -    def TransformPoint(self, *args):
    2724          """
    2725          TransformPoint(self, int bDstToSrc, double inout) -> int
    2726          TransformPoint(self, int bDstToSrc, double x, double y, double z = 0.0) -> int
    2727          """
    2728          return _gdal.Transformer_TransformPoint(self, *args)
    2729
    2730 -    def TransformPoints(self, *args):
    2731          """TransformPoints(self, int bDstToSrc, int nCount) -> int"""
    2732          return _gdal.Transformer_TransformPoints(self, *args)
    2733
    2734 -    def TransformGeolocations(self, *args, **kwargs):
    2735          """
    2736          TransformGeolocations(self, Band xBand, Band yBand, Band zBand, GDALProgressFunc callback = None,
    2737              void callback_data = None,
    2738              char options = None) -> int
    2739          """
    2740          return _gdal.Transformer_TransformGeolocations(self, *args, **kwargs)
    2741
    2742  Transformer_swigregister = _gdal.Transformer_swigregister
    2743  Transformer_swigregister(Transformer)
    2744
    2745
    2746 -def ApplyGeoTransform(*args):
    2747    """ApplyGeoTransform(double padfGeoTransform, double dfPixel, double dfLine)"""
    2748    return _gdal.ApplyGeoTransform(*args)
    2749  ApplyGeoTransform = _gdal.ApplyGeoTransform
    2750
    2751 -def InvGeoTransform(*args):
    2752    """InvGeoTransform(double gt_in) -> RETURN_NONE"""
    2753    return _gdal.InvGeoTransform(*args)
    2754  InvGeoTransform = _gdal.InvGeoTransform
    2755
    2756 -def VersionInfo(*args):
    2757    """VersionInfo(char request = "VERSION_NUM") -> char"""
    2758    return _gdal.VersionInfo(*args)
    2759  VersionInfo = _gdal.VersionInfo
    2760
    2761 -def AllRegister(*args):
    2762    """AllRegister()"""
    2763    return _gdal.AllRegister(*args)
    2764  AllRegister = _gdal.AllRegister
    2765
    2766 -def GDALDestroyDriverManager(*args):
    2767    """GDALDestroyDriverManager()"""
    2768    return _gdal.GDALDestroyDriverManager(*args)
    2769  GDALDestroyDriverManager = _gdal.GDALDestroyDriverManager
    2770
    2771 -def GetCacheMax(*args):
    2772    """GetCacheMax() -> GIntBig"""
    2773    return _gdal.GetCacheMax(*args)
    2774  GetCacheMax = _gdal.GetCacheMax
    2775
    2776 -def GetCacheUsed(*args):
    2777    """GetCacheUsed() -> GIntBig"""
    2778    return _gdal.GetCacheUsed(*args)
    2779  GetCacheUsed = _gdal.GetCacheUsed
    2780
    2781 -def SetCacheMax(*args):
    2782    """SetCacheMax(GIntBig nBytes)"""
    2783    return _gdal.SetCacheMax(*args)
    2784  SetCacheMax = _gdal.SetCacheMax
    2785
    2786 -def GetDataTypeSize(*args):
    2787    """GetDataTypeSize(GDALDataType eDataType) -> int"""
    2788    return _gdal.GetDataTypeSize(*args)
    2789  GetDataTypeSize = _gdal.GetDataTypeSize
    2790
    2791 -def DataTypeIsComplex(*args):
    2792    """DataTypeIsComplex(GDALDataType eDataType) -> int"""
    2793    return _gdal.DataTypeIsComplex(*args)
    2794  DataTypeIsComplex = _gdal.DataTypeIsComplex
    2795
    2796 -def GetDataTypeName(*args):
    2797    """GetDataTypeName(GDALDataType eDataType) -> char"""
    2798    return _gdal.GetDataTypeName(*args)
    2799  GetDataTypeName = _gdal.GetDataTypeName
    2800
    2801 -def GetDataTypeByName(*args):
    2802    """GetDataTypeByName(char pszDataTypeName) -> GDALDataType"""
    2803    return _gdal.GetDataTypeByName(*args)
    2804  GetDataTypeByName = _gdal.GetDataTypeByName
    2805
    2806 -def GetColorInterpretationName(*args):
    2807    """GetColorInterpretationName(GDALColorInterp eColorInterp) -> char"""
    2808    return _gdal.GetColorInterpretationName(*args)
    2809  GetColorInterpretationName = _gdal.GetColorInterpretationName
    2810
    2811 -def GetPaletteInterpretationName(*args):
    2812    """GetPaletteInterpretationName(GDALPaletteInterp ePaletteInterp) -> char"""
    2813    return _gdal.GetPaletteInterpretationName(*args)
    2814  GetPaletteInterpretationName = _gdal.GetPaletteInterpretationName
    2815
    2816 -def DecToDMS(*args):
    2817    """DecToDMS(double arg0, char arg1, int arg2 = 2) -> char"""
    2818    return _gdal.DecToDMS(*args)
    2819  DecToDMS = _gdal.DecToDMS
    2820
    2821 -def PackedDMSToDec(*args):
    2822    """PackedDMSToDec(double dfPacked) -> double"""
    2823    return _gdal.PackedDMSToDec(*args)
    2824  PackedDMSToDec = _gdal.PackedDMSToDec
    2825
    2826 -def DecToPackedDMS(*args):
    2827    """DecToPackedDMS(double dfDec) -> double"""
    2828    return _gdal.DecToPackedDMS(*args)
    2829  DecToPackedDMS = _gdal.DecToPackedDMS
    2830
    2831 -def ParseXMLString(*args):
    2832    """ParseXMLString(char pszXMLString) -> CPLXMLNode"""
    2833    return _gdal.ParseXMLString(*args)
    2834  ParseXMLString = _gdal.ParseXMLString
    2835
    2836 -def SerializeXMLTree(*args):
    2837    """SerializeXMLTree(CPLXMLNode xmlnode) -> retStringAndCPLFree"""
    2838    return _gdal.SerializeXMLTree(*args)
    2839  SerializeXMLTree = _gdal.SerializeXMLTree
    2840
    2841 -def GetJPEG2000Structure(*args):
    2842    """GetJPEG2000Structure(char pszFilename, char options = None) -> CPLXMLNode"""
    2843    return _gdal.GetJPEG2000Structure(*args)
    2844  GetJPEG2000Structure = _gdal.GetJPEG2000Structure
    2845
    2846 -def GetJPEG2000StructureAsString(*args):
    2847    """GetJPEG2000StructureAsString(char pszFilename, char options = None) -> retStringAndCPLFree"""
    2848    return _gdal.GetJPEG2000StructureAsString(*args)
    2849  GetJPEG2000StructureAsString = _gdal.GetJPEG2000StructureAsString
    2850
    2851 -def GetDriverCount(*args):
    2852    """GetDriverCount() -> int"""
    2853    return _gdal.GetDriverCount(*args)
    2854  GetDriverCount = _gdal.GetDriverCount
    2855
    2856 -def GetDriverByName(*args):
    2857    """GetDriverByName(char name) -> Driver"""
    2858    return _gdal.GetDriverByName(*args)
    2859  GetDriverByName = _gdal.GetDriverByName
    2860
    2861 -def GetDriver(*args):
    2862    """GetDriver(int i) -> Driver"""
    2863    return _gdal.GetDriver(*args)
    2864  GetDriver = _gdal.GetDriver
    2865
    2866 -def Open(*args):
    2867    """Open(char utf8_path, GDALAccess eAccess = GA_ReadOnly) -> Dataset"""
    2868    return _gdal.Open(*args)
    2869  Open = _gdal.Open
    2870
    2871 -def OpenEx(*args, **kwargs):
    2872    """
    2873      OpenEx(char utf8_path, unsigned int nOpenFlags = 0, char allowed_drivers = None,
    2874          char open_options = None,
    2875          char sibling_files = None) -> Dataset
    2876      """
    2877    return _gdal.OpenEx(*args, **kwargs)
    2878  OpenEx = _gdal.OpenEx
    2879
    2880 -def OpenShared(*args):
    2881    """OpenShared(char utf8_path, GDALAccess eAccess = GA_ReadOnly) -> Dataset"""
    2882    return _gdal.OpenShared(*args)
    2883  OpenShared = _gdal.OpenShared
    2884
    2885 -def IdentifyDriver(*args):
    2886    """IdentifyDriver(char utf8_path, char papszSiblings = None) -> Driver"""
    2887    return _gdal.IdentifyDriver(*args)
    2888  IdentifyDriver = _gdal.IdentifyDriver
    2889
    2890 -def GeneralCmdLineProcessor(*args):
    2891    """GeneralCmdLineProcessor(char papszArgv, int nOptions = 0) -> char"""
    2892    return _gdal.GeneralCmdLineProcessor(*args)
    2893  GeneralCmdLineProcessor = _gdal.GeneralCmdLineProcessor
    2894  __version__ = _gdal.VersionInfo("RELEASE_NAME")
    2895
    2896 -class GDALInfoOptions(_object):
    2897      """Proxy of C++ GDALInfoOptions class"""
    2898      __swig_setmethods__ = {}
    2899      __setattr__ = lambda self, name, value: _swig_setattr(self, GDALInfoOptions, name, value)
    2900      __swig_getmethods__ = {}
    2901      __getattr__ = lambda self, name: _swig_getattr(self, GDALInfoOptions, name)
    2902      __repr__ = _swig_repr
    2903 -    def __init__(self, *args):
    2904          """__init__(self, char options) -> GDALInfoOptions"""
    2905          this = _gdal.new_GDALInfoOptions(*args)
    2906          try: self.this.append(this)
    2907          except: self.this = this
    2908      __swig_destroy__ = _gdal.delete_GDALInfoOptions
    2909      __del__ = lambda self : None;
    2910  GDALInfoOptions_swigregister = _gdal.GDALInfoOptions_swigregister
    2911  GDALInfoOptions_swigregister(GDALInfoOptions)
    2912
    2913
    2914 -def InfoInternal(*args):
    2915    """InfoInternal(Dataset hDataset, GDALInfoOptions infoOptions) -> retStringAndCPLFree"""
    2916    return _gdal.InfoInternal(*args)
    2917  InfoInternal = _gdal.InfoInternal
    2918 -class GDALTranslateOptions(_object):
    2919      """Proxy of C++ GDALTranslateOptions class"""
    2920      __swig_setmethods__ = {}
    2921      __setattr__ = lambda self, name, value: _swig_setattr(self, GDALTranslateOptions, name, value)
    2922      __swig_getmethods__ = {}
    2923      __getattr__ = lambda self, name: _swig_getattr(self, GDALTranslateOptions, name)
    2924      __repr__ = _swig_repr
    2925 -    def __init__(self, *args):
    2926          """__init__(self, char options) -> GDALTranslateOptions"""
    2927          this = _gdal.new_GDALTranslateOptions(*args)
    2928          try: self.this.append(this)
    2929          except: self.this = this
    2930      __swig_destroy__ = _gdal.delete_GDALTranslateOptions
    2931      __del__ = lambda self : None;
    2932  GDALTranslateOptions_swigregister = _gdal.GDALTranslateOptions_swigregister
    2933  GDALTranslateOptions_swigregister(GDALTranslateOptions)
    2934
    2935
    2936 -def TranslateInternal(*args):
    2937    """
    2938      TranslateInternal(char dest, Dataset dataset, GDALTranslateOptions translateOptions,
    2939          GDALProgressFunc callback = None,
    2940          void callback_data = None) -> Dataset
    2941      """
    2942    return _gdal.TranslateInternal(*args)
    2943  TranslateInternal = _gdal.TranslateInternal
    2944 -class GDALWarpAppOptions(_object):
    2945      """Proxy of C++ GDALWarpAppOptions class"""
    2946      __swig_setmethods__ = {}
    2947      __setattr__ = lambda self, name, value: _swig_setattr(self, GDALWarpAppOptions, name, value)
    2948      __swig_getmethods__ = {}
    2949      __getattr__ = lambda self, name: _swig_getattr(self, GDALWarpAppOptions, name)
    2950      __repr__ = _swig_repr
    2951 -    def __init__(self, *args):
    2952          """__init__(self, char options) -> GDALWarpAppOptions"""
    2953          this = _gdal.new_GDALWarpAppOptions(*args)
    2954          try: self.this.append(this)
    2955          except: self.this = this
    2956      __swig_destroy__ = _gdal.delete_GDALWarpAppOptions
    2957      __del__ = lambda self : None;
    2958  GDALWarpAppOptions_swigregister = _gdal.GDALWarpAppOptions_swigregister
    2959  GDALWarpAppOptions_swigregister(GDALWarpAppOptions)
    2960
    2961
    2962 -def wrapper_GDALWarpDestDS(*args):
    2963    """
    2964      wrapper_GDALWarpDestDS(Dataset dstDS, int object_list_count, GDALWarpAppOptions warpAppOptions,
    2965          GDALProgressFunc callback = None,
    2966          void callback_data = None) -> int
    2967      """
    2968    return _gdal.wrapper_GDALWarpDestDS(*args)
    2969  wrapper_GDALWarpDestDS = _gdal.wrapper_GDALWarpDestDS
    2970
    2971 -def wrapper_GDALWarpDestName(*args):
    2972    """
    2973      wrapper_GDALWarpDestName(char dest, int object_list_count, GDALWarpAppOptions warpAppOptions,
    2974          GDALProgressFunc callback = None,
    2975          void callback_data = None) -> Dataset
    2976      """
    2977    return _gdal.wrapper_GDALWarpDestName(*args)
    2978  wrapper_GDALWarpDestName = _gdal.wrapper_GDALWarpDestName
    2979 -class GDALVectorTranslateOptions(_object):
    2980      """Proxy of C++ GDALVectorTranslateOptions class"""
    2981      __swig_setmethods__ = {}
    2982      __setattr__ = lambda self, name, value: _swig_setattr(self, GDALVectorTranslateOptions, name, value)
    2983      __swig_getmethods__ = {}
    2984      __getattr__ = lambda self, name: _swig_getattr(self, GDALVectorTranslateOptions, name)
    2985      __repr__ = _swig_repr
    2986 -    def __init__(self, *args):
    2987          """__init__(self, char options) -> GDALVectorTranslateOptions"""
    2988          this = _gdal.new_GDALVectorTranslateOptions(*args)
    2989          try: self.this.append(this)
    2990          except: self.this = this
    2991      __swig_destroy__ = _gdal.delete_GDALVectorTranslateOptions
    2992      __del__ = lambda self : None;
    2993  GDALVectorTranslateOptions_swigregister = _gdal.GDALVectorTranslateOptions_swigregister
    2994  GDALVectorTranslateOptions_swigregister(GDALVectorTranslateOptions)
    2995
    2996
    2997 -def wrapper_GDALVectorTranslateDestDS(*args):
    2998    """
    2999      wrapper_GDALVectorTranslateDestDS(Dataset dstDS, Dataset srcDS, GDALVectorTranslateOptions options,
    3000          GDALProgressFunc callback = None,
    3001          void callback_data = None) -> int
    3002      """
    3003    return _gdal.wrapper_GDALVectorTranslateDestDS(*args)
    3004  wrapper_GDALVectorTranslateDestDS = _gdal.wrapper_GDALVectorTranslateDestDS
    3005
    3006 -def wrapper_GDALVectorTranslateDestName(*args):
    3007    """
    3008      wrapper_GDALVectorTranslateDestName(char dest, Dataset srcDS, GDALVectorTranslateOptions options,
    3009          GDALProgressFunc callback = None,
    3010          void callback_data = None) -> Dataset
    3011      """
    3012    return _gdal.wrapper_GDALVectorTranslateDestName(*args)
    3013  wrapper_GDALVectorTranslateDestName = _gdal.wrapper_GDALVectorTranslateDestName
    3014 -class GDALDEMProcessingOptions(_object):
    3015      """Proxy of C++ GDALDEMProcessingOptions class"""
    3016      __swig_setmethods__ = {}
    3017      __setattr__ = lambda self, name, value: _swig_setattr(self, GDALDEMProcessingOptions, name, value)
    3018      __swig_getmethods__ = {}
    3019      __getattr__ = lambda self, name: _swig_getattr(self, GDALDEMProcessingOptions, name)
    3020      __repr__ = _swig_repr
    3021 -    def __init__(self, *args):
    3022          """__init__(self, char options) -> GDALDEMProcessingOptions"""
    3023          this = _gdal.new_GDALDEMProcessingOptions(*args)
    3024          try: self.this.append(this)
    3025          except: self.this = this
    3026      __swig_destroy__ = _gdal.delete_GDALDEMProcessingOptions
    3027      __del__ = lambda self : None;
    3028  GDALDEMProcessingOptions_swigregister = _gdal.GDALDEMProcessingOptions_swigregister
    3029  GDALDEMProcessingOptions_swigregister(GDALDEMProcessingOptions)
    3030
    3031
    3032 -def DEMProcessingInternal(*args):
    3033    """
    3034      DEMProcessingInternal(char dest, Dataset dataset, char pszProcessing, char pszColorFilename,
    3035          GDALDEMProcessingOptions options,
    3036          GDALProgressFunc callback = None, void callback_data = None) -> Dataset
    3037      """
    3038    return _gdal.DEMProcessingInternal(*args)
    3039  DEMProcessingInternal = _gdal.DEMProcessingInternal
    3040 -class GDALNearblackOptions(_object):
    3041      """Proxy of C++ GDALNearblackOptions class"""
    3042      __swig_setmethods__ = {}
    3043      __setattr__ = lambda self, name, value: _swig_setattr(self, GDALNearblackOptions, name, value)
    3044      __swig_getmethods__ = {}
    3045      __getattr__ = lambda self, name: _swig_getattr(self, GDALNearblackOptions, name)
    3046      __repr__ = _swig_repr
    3047 -    def __init__(self, *args):
    3048          """__init__(self, char options) -> GDALNearblackOptions"""
    3049          this = _gdal.new_GDALNearblackOptions(*args)
    3050          try: self.this.append(this)
    3051          except: self.this = this
    3052      __swig_destroy__ = _gdal.delete_GDALNearblackOptions
    3053      __del__ = lambda self : None;
    3054  GDALNearblackOptions_swigregister = _gdal.GDALNearblackOptions_swigregister
    3055  GDALNearblackOptions_swigregister(GDALNearblackOptions)
    3056
    3057
    3058 -def wrapper_GDALNearblackDestDS(*args):
    3059    """
    3060      wrapper_GDALNearblackDestDS(Dataset dstDS, Dataset srcDS, GDALNearblackOptions options,
    3061          GDALProgressFunc callback = None, void callback_data = None) -> int
    3062      """
    3063    return _gdal.wrapper_GDALNearblackDestDS(*args)
    3064  wrapper_GDALNearblackDestDS = _gdal.wrapper_GDALNearblackDestDS
    3065
    3066 -def wrapper_GDALNearblackDestName(*args):
    3067    """
    3068      wrapper_GDALNearblackDestName(char dest, Dataset srcDS, GDALNearblackOptions options,
    3069          GDALProgressFunc callback = None, void callback_data = None) -> Dataset
    3070      """
    3071    return _gdal.wrapper_GDALNearblackDestName(*args)
    3072  wrapper_GDALNearblackDestName = _gdal.wrapper_GDALNearblackDestName
    3073 -class GDALGridOptions(_object):
    3074      """Proxy of C++ GDALGridOptions class"""
    3075      __swig_setmethods__ = {}
    3076      __setattr__ = lambda self, name, value: _swig_setattr(self, GDALGridOptions, name, value)
    3077      __swig_getmethods__ = {}
    3078      __getattr__ = lambda self, name: _swig_getattr(self, GDALGridOptions, name)
    3079      __repr__ = _swig_repr
    3080 -    def __init__(self, *args):
    3081          """__init__(self, char options) -> GDALGridOptions"""
    3082          this = _gdal.new_GDALGridOptions(*args)
    3083          try: self.this.append(this)
    3084          except: self.this = this
    3085      __swig_destroy__ = _gdal.delete_GDALGridOptions
    3086      __del__ = lambda self : None;
    3087  GDALGridOptions_swigregister = _gdal.GDALGridOptions_swigregister
    3088  GDALGridOptions_swigregister(GDALGridOptions)
    3089
    3090
    3091 -def GridInternal(*args):
    3092    """
    3093      GridInternal(char dest, Dataset dataset, GDALGridOptions options,
    3094          GDALProgressFunc callback = None, void callback_data = None) -> Dataset
    3095      """
    3096    return _gdal.GridInternal(*args)
    3097  GridInternal = _gdal.GridInternal
    3098 -class GDALRasterizeOptions(_object):
    3099      """Proxy of C++ GDALRasterizeOptions class"""
    3100      __swig_setmethods__ = {}
    3101      __setattr__ = lambda self, name, value: _swig_setattr(self, GDALRasterizeOptions, name, value)
    3102      __swig_getmethods__ = {}
    3103      __getattr__ = lambda self, name: _swig_getattr(self, GDALRasterizeOptions, name)
    3104      __repr__ = _swig_repr
    3105 -    def __init__(self, *args):
    3106          """__init__(self, char options) -> GDALRasterizeOptions"""
    3107          this = _gdal.new_GDALRasterizeOptions(*args)
    3108          try: self.this.append(this)
    3109          except: self.this = this
    3110      __swig_destroy__ = _gdal.delete_GDALRasterizeOptions
    3111      __del__ = lambda self : None;
    3112  GDALRasterizeOptions_swigregister = _gdal.GDALRasterizeOptions_swigregister
    3113  GDALRasterizeOptions_swigregister(GDALRasterizeOptions)
    3114
    3115
    3116 -def wrapper_GDALRasterizeDestDS(*args):
    3117    """
    3118      wrapper_GDALRasterizeDestDS(Dataset dstDS, Dataset srcDS, GDALRasterizeOptions options,
    3119          GDALProgressFunc callback = None, void callback_data = None) -> int
    3120      """
    3121    return _gdal.wrapper_GDALRasterizeDestDS(*args)
    3122  wrapper_GDALRasterizeDestDS = _gdal.wrapper_GDALRasterizeDestDS
    3123
    3124 -def wrapper_GDALRasterizeDestName(*args):
    3125    """
    3126      wrapper_GDALRasterizeDestName(char dest, Dataset srcDS, GDALRasterizeOptions options,
    3127          GDALProgressFunc callback = None, void callback_data = None) -> Dataset
    3128      """
    3129    return _gdal.wrapper_GDALRasterizeDestName(*args)
    3130  wrapper_GDALRasterizeDestName = _gdal.wrapper_GDALRasterizeDestName
    3131 -class GDALBuildVRTOptions(_object):
    3132      """Proxy of C++ GDALBuildVRTOptions class"""
    3133      __swig_setmethods__ = {}
    3134      __setattr__ = lambda self, name, value: _swig_setattr(self, GDALBuildVRTOptions, name, value)
    3135      __swig_getmethods__ = {}
    3136      __getattr__ = lambda self, name: _swig_getattr(self, GDALBuildVRTOptions, name)
    3137      __repr__ = _swig_repr
    3138 -    def __init__(self, *args):
    3139          """__init__(self, char options) -> GDALBuildVRTOptions"""
    3140          this = _gdal.new_GDALBuildVRTOptions(*args)
    3141          try: self.this.append(this)
    3142          except: self.this = this
    3143      __swig_destroy__ = _gdal.delete_GDALBuildVRTOptions
    3144      __del__ = lambda self : None;
    3145  GDALBuildVRTOptions_swigregister = _gdal.GDALBuildVRTOptions_swigregister
    3146  GDALBuildVRTOptions_swigregister(GDALBuildVRTOptions)
    3147
    3148
    3149 -def BuildVRTInternalObjects(*args):
    3150    """
    3151      BuildVRTInternalObjects(char dest, int object_list_count, GDALBuildVRTOptions options,
    3152          GDALProgressFunc callback = None,
    3153          void callback_data = None) -> Dataset
    3154      """
    3155    return _gdal.BuildVRTInternalObjects(*args)
    3156  BuildVRTInternalObjects = _gdal.BuildVRTInternalObjects
    3157
    3158 -def BuildVRTInternalNames(*args):
    3159    """
    3160      BuildVRTInternalNames(char dest, char source_filenames, GDALBuildVRTOptions options,
    3161          GDALProgressFunc callback = None,
    3162          void callback_data = None) -> Dataset
    3163      """
    3164    return _gdal.BuildVRTInternalNames(*args)
    3165  BuildVRTInternalNames = _gdal.BuildVRTInternalNames
    3166