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

# Source Code for Module osgeo.gnm

      1  # This file was automatically generated by SWIG (http://www.swig.org).
      2  # Version 3.0.12
      3  #
      4  # Do not make changes to this file unless you know what you are doing--modify
      5  # the SWIG interface file instead.
      6
      7  from sys import version_info as _swig_python_version_info
      8  if _swig_python_version_info >= (2, 7, 0):
      9 -    def swig_import_helper():
     10          import importlib
     11          pkg = __name__.rpartition('.')[0]
     12          mname = '.'.join((pkg, '_gnm')).lstrip('.')
     13          try:
     14              return importlib.import_module(mname)
     15          except ImportError:
     16              return importlib.import_module('_gnm')
     17      _gnm = swig_import_helper()
     18      del swig_import_helper
     19  elif _swig_python_version_info >= (2, 6, 0):
     20 -    def swig_import_helper():
     21          from os.path import dirname
     22          import imp
     23          fp = None
     24          try:
     25              fp, pathname, description = imp.find_module('_gnm', [dirname(__file__)])
     26          except ImportError:
     27              import _gnm
     28              return _gnm
     29          try:
     30              _mod = imp.load_module('_gnm', fp, pathname, description)
     31          finally:
     32              if fp is not None:
     33                  fp.close()
     34          return _mod
     35      _gnm = swig_import_helper()
     36      del swig_import_helper
     37  else:
     38      import _gnm
     39  del _swig_python_version_info
     40
     41  try:
     42      _swig_property = property
     43  except NameError:
     44      pass  # Python < 2.2 doesn't have 'property'.
     45
     46  try:
     47      import builtins as __builtin__
     48  except ImportError:
     49      import __builtin__
     50
     51 -def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
     52      if (name == "thisown"):
     53          return self.this.own(value)
     54      if (name == "this"):
     55          if type(value).__name__ == 'SwigPyObject':
     56              self.__dict__[name] = value
     57              return
     58      method = class_type.__swig_setmethods__.get(name, None)
     59      if method:
     60          return method(self, value)
     61      if (not static):
     62          if _newclass:
     63              object.__setattr__(self, name, value)
     64          else:
     65              self.__dict__[name] = value
     66      else:
     67          raise AttributeError("You cannot add attributes to %s" % self)
     68
     69
     70 -def _swig_setattr(self, class_type, name, value):
     71      return _swig_setattr_nondynamic(self, class_type, name, value, 0)
     72
     73
     74 -def _swig_getattr(self, class_type, name):
     75      if (name == "thisown"):
     76          return self.this.own()
     77      method = class_type.__swig_getmethods__.get(name, None)
     78      if method:
     79          return method(self)
     80      raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))
     81
     82
     83 -def _swig_repr(self):
     84      try:
     85          strthis = "proxy of " + self.this.__repr__()
     86      except __builtin__.Exception:
     87          strthis = ""
     88      return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
     89
     90  try:
     91      _object = object
     92      _newclass = 1
     93  except __builtin__.Exception:
     94 -    class _object:
     95          pass
     96      _newclass = 0
     97
     98
     99 -def GetUseExceptions(*args):
    100      """GetUseExceptions() -> int"""
    101      return _gnm.GetUseExceptions(*args)
    102
    103 -def UseExceptions(*args):
    104      """UseExceptions()"""
    105      return _gnm.UseExceptions(*args)
    106
    107 -def DontUseExceptions(*args):
    108      """DontUseExceptions()"""
    109      return _gnm.DontUseExceptions(*args)
    110  from sys import version_info as _swig_python_version_info
    111  if _swig_python_version_info >= (2, 7, 0):
    112      from . import ogr
    113  else:
    114      import ogr
    115  del _swig_python_version_info
    116  from sys import version_info as _swig_python_version_info
    117  if _swig_python_version_info >= (2, 7, 0):
    118      from . import osr
    119  else:
    120      import osr
    121  del _swig_python_version_info
    122  GATDijkstraShortestPath = _gnm.GATDijkstraShortestPath
    123  GATKShortestPath = _gnm.GATKShortestPath
    124  GATConnectedComponents = _gnm.GATConnectedComponents
    125  GNM_EDGE_DIR_BOTH = _gnm.GNM_EDGE_DIR_BOTH
    126  GNM_EDGE_DIR_SRCTOTGT = _gnm.GNM_EDGE_DIR_SRCTOTGT
    127  GNM_EDGE_DIR_TGTTOSRC = _gnm.GNM_EDGE_DIR_TGTTOSRC
    128
    129 -def CastToNetwork(*args):
    130      """CastToNetwork(MajorObject base) -> Network"""
    131      return _gnm.CastToNetwork(*args)
    132
    133 -def CastToGenericNetwork(*args):
    134      """CastToGenericNetwork(MajorObject base) -> GenericNetwork"""
    135      return _gnm.CastToGenericNetwork(*args)
    136 -class Network(ogr.MajorObject):
    137      """Proxy of C++ GNMNetworkShadow class."""
    138
    139      __swig_setmethods__ = {}
    140      for _s in [ogr.MajorObject]:
    141          __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    142      __setattr__ = lambda self, name, value: _swig_setattr(self, Network, name, value)
    143      __swig_getmethods__ = {}
    144      for _s in [ogr.MajorObject]:
    145          __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    146      __getattr__ = lambda self, name: _swig_getattr(self, Network, name)
    147
    148 -    def __init__(self, *args, **kwargs):
    149          raise AttributeError("No constructor defined")
    150      __repr__ = _swig_repr
    151      __swig_destroy__ = _gnm.delete_Network
    152      __del__ = lambda self: None
    153
    154 -    def ReleaseResultSet(self, *args):
    155          """ReleaseResultSet(Network self, Layer layer)"""
    156          return _gnm.Network_ReleaseResultSet(self, *args)
    157
    158
    159 -    def GetVersion(self, *args):
    160          """GetVersion(Network self) -> int"""
    161          return _gnm.Network_GetVersion(self, *args)
    162
    163
    164 -    def GetName(self, *args):
    165          """GetName(Network self) -> char const *"""
    166          return _gnm.Network_GetName(self, *args)
    167
    168
    169 -    def GetFeatureByGlobalFID(self, *args):
    170          """GetFeatureByGlobalFID(Network self, GIntBig GFID) -> Feature"""
    171          return _gnm.Network_GetFeatureByGlobalFID(self, *args)
    172
    173
    174 -    def GetPath(self, *args, **kwargs):
    175          """GetPath(Network self, GIntBig nStartFID, GIntBig nEndFID, GNMGraphAlgorithmType eAlgorithm, char ** options=None) -> Layer"""
    176          return _gnm.Network_GetPath(self, *args, **kwargs)
    177
    178
    179 -    def DisconnectAll(self, *args):
    180          """DisconnectAll(Network self) -> CPLErr"""
    181          return _gnm.Network_DisconnectAll(self, *args)
    182
    183
    184 -    def GetProjection(self, *args):
    185          """GetProjection(Network self) -> char const *"""
    186          return _gnm.Network_GetProjection(self, *args)
    187
    188
    189 -    def GetProjectionRef(self, *args):
    190          """GetProjectionRef(Network self) -> char const *"""
    191          return _gnm.Network_GetProjectionRef(self, *args)
    192
    193
    194 -    def GetFileList(self, *args):
    195          """GetFileList(Network self) -> char **"""
    196          return _gnm.Network_GetFileList(self, *args)
    197
    198
    199 -    def CreateLayer(self, *args, **kwargs):
    200          """CreateLayer(Network self, char const * name, SpatialReference srs=None, OGRwkbGeometryType geom_type, char ** options=None) -> Layer"""
    201          return _gnm.Network_CreateLayer(self, *args, **kwargs)
    202
    203
    204 -    def CopyLayer(self, *args, **kwargs):
    205          """CopyLayer(Network self, Layer src_layer, char const * new_name, char ** options=None) -> Layer"""
    206          return _gnm.Network_CopyLayer(self, *args, **kwargs)
    207
    208
    209 -    def DeleteLayer(self, *args):
    210          """DeleteLayer(Network self, int index) -> OGRErr"""
    211          return _gnm.Network_DeleteLayer(self, *args)
    212
    213
    214 -    def GetLayerCount(self, *args):
    215          """GetLayerCount(Network self) -> int"""
    216          return _gnm.Network_GetLayerCount(self, *args)
    217
    218
    219 -    def GetLayerByIndex(self, *args):
    220          """GetLayerByIndex(Network self, int index=0) -> Layer"""
    221          return _gnm.Network_GetLayerByIndex(self, *args)
    222
    223
    224 -    def GetLayerByName(self, *args):
    225          """GetLayerByName(Network self, char const * layer_name) -> Layer"""
    226          return _gnm.Network_GetLayerByName(self, *args)
    227
    228
    229 -    def TestCapability(self, *args):
    230          """TestCapability(Network self, char const * cap) -> bool"""
    231          return _gnm.Network_TestCapability(self, *args)
    232
    233
    234 -    def StartTransaction(self, *args, **kwargs):
    235          """StartTransaction(Network self, int force=False) -> OGRErr"""
    236          return _gnm.Network_StartTransaction(self, *args, **kwargs)
    237
    238
    239 -    def CommitTransaction(self, *args):
    240          """CommitTransaction(Network self) -> OGRErr"""
    241          return _gnm.Network_CommitTransaction(self, *args)
    242
    243
    244 -    def RollbackTransaction(self, *args):
    245          """RollbackTransaction(Network self) -> OGRErr"""
    246          return _gnm.Network_RollbackTransaction(self, *args)
    247
    248  Network_swigregister = _gnm.Network_swigregister
    249  Network_swigregister(Network)
    250
    251 -class GenericNetwork(Network):
    252      """Proxy of C++ GNMGenericNetworkShadow class."""
    253
    254      __swig_setmethods__ = {}
    255      for _s in [Network]:
    256          __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    257      __setattr__ = lambda self, name, value: _swig_setattr(self, GenericNetwork, name, value)
    258      __swig_getmethods__ = {}
    259      for _s in [Network]:
    260          __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    261      __getattr__ = lambda self, name: _swig_getattr(self, GenericNetwork, name)
    262
    263 -    def __init__(self, *args, **kwargs):
    264          raise AttributeError("No constructor defined")
    265      __repr__ = _swig_repr
    266      __swig_destroy__ = _gnm.delete_GenericNetwork
    267      __del__ = lambda self: None
    268
    269 -    def ConnectFeatures(self, *args):
    270          """ConnectFeatures(GenericNetwork self, GIntBig nSrcFID, GIntBig nTgtFID, GIntBig nConFID, double dfCost, double dfInvCost, GNMDirection eDir) -> CPLErr"""
    271          return _gnm.GenericNetwork_ConnectFeatures(self, *args)
    272
    273
    274 -    def DisconnectFeatures(self, *args):
    275          """DisconnectFeatures(GenericNetwork self, GIntBig nSrcFID, GIntBig nTgtFID, GIntBig nConFID) -> CPLErr"""
    276          return _gnm.GenericNetwork_DisconnectFeatures(self, *args)
    277
    278
    279 -    def DisconnectFeaturesWithId(self, *args):
    280          """DisconnectFeaturesWithId(GenericNetwork self, GIntBig nFID) -> CPLErr"""
    281          return _gnm.GenericNetwork_DisconnectFeaturesWithId(self, *args)
    282
    283
    284 -    def ReconnectFeatures(self, *args):
    285          """ReconnectFeatures(GenericNetwork self, GIntBig nSrcFID, GIntBig nTgtFID, GIntBig nConFID, double dfCost, double dfInvCost, GNMDirection eDir) -> CPLErr"""
    286          return _gnm.GenericNetwork_ReconnectFeatures(self, *args)
    287
    288
    289 -    def CreateRule(self, *args):
    290          """CreateRule(GenericNetwork self, char const * pszRuleStr) -> CPLErr"""
    291          return _gnm.GenericNetwork_CreateRule(self, *args)
    292
    293
    294 -    def DeleteAllRules(self, *args):
    295          """DeleteAllRules(GenericNetwork self) -> CPLErr"""
    296          return _gnm.GenericNetwork_DeleteAllRules(self, *args)
    297
    298
    299 -    def DeleteRule(self, *args):
    300          """DeleteRule(GenericNetwork self, char const * pszRuleStr) -> CPLErr"""
    301          return _gnm.GenericNetwork_DeleteRule(self, *args)
    302
    303
    304 -    def GetRules(self, *args):
    305          """GetRules(GenericNetwork self) -> char **"""
    306          return _gnm.GenericNetwork_GetRules(self, *args)
    307
    308
    309 -    def ConnectPointsByLines(self, *args, **kwargs):
    310          """ConnectPointsByLines(GenericNetwork self, char ** papszLayerList, double dfTolerance, double dfCost, double dfInvCost, GNMDirection eDir) -> CPLErr"""
    311          return _gnm.GenericNetwork_ConnectPointsByLines(self, *args, **kwargs)
    312
    313
    314 -    def ChangeBlockState(self, *args):
    315          """ChangeBlockState(GenericNetwork self, GIntBig nFID, bool bIsBlock) -> CPLErr"""
    316          return _gnm.GenericNetwork_ChangeBlockState(self, *args)
    317
    318
    319 -    def ChangeAllBlockState(self, *args):
    320          """ChangeAllBlockState(GenericNetwork self, bool bIsBlock=False) -> CPLErr"""
    321          return _gnm.GenericNetwork_ChangeAllBlockState(self, *args)
    322
    323  GenericNetwork_swigregister = _gnm.GenericNetwork_swigregister
    324  GenericNetwork_swigregister(GenericNetwork)
    325
    326  # This file is compatible with both classic and new-style classes.
    327