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