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 4.0.1
      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      raise RuntimeError("Python 2.7 or later required")
     10
     11  # Import the low-level C/C++ module
     12  if __package__ or "." in __name__:
     13      from . import _gnm
     14  else:
     15      import _gnm
     16
     17  try:
     18      import builtins as __builtin__
     19  except ImportError:
     20      import __builtin__
     21
     22 -def _swig_repr(self):
     23      try:
     24          strthis = "proxy of " + self.this.__repr__()
     25      except __builtin__.Exception:
     26          strthis = ""
     27      return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
     28
     29
     30 -def _swig_setattr_nondynamic_instance_variable(set):
     31      def set_instance_attr(self, name, value):
     32          if name == "thisown":
     33              self.this.own(value)
     34          elif name == "this":
     35              set(self, name, value)
     36          elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
     37              set(self, name, value)
     38          else:
     39              raise AttributeError("You cannot add instance attributes to %s" % self)
     40      return set_instance_attr
     41
     42
     43 -def _swig_setattr_nondynamic_class_variable(set):
     44      def set_class_attr(cls, name, value):
     45          if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
     46              set(cls, name, value)
     47          else:
     48              raise AttributeError("You cannot add class attributes to %s" % cls)
     49      return set_class_attr
     50
     51
     52 -def _swig_add_metaclass(metaclass):
     53      """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
     54      def wrapper(cls):
     55          return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
     56      return wrapper
     57
     58
     59 -class _SwigNonDynamicMeta(type):
     60      """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
     61      __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)
     62
     63
     64
     65 -def GetUseExceptions(*args):
     66      r"""GetUseExceptions() -> int"""
     67      return _gnm.GetUseExceptions(*args)
     68
     69 -def UseExceptions(*args):
     70      r"""UseExceptions()"""
     71      return _gnm.UseExceptions(*args)
     72
     73 -def DontUseExceptions(*args):
     74      r"""DontUseExceptions()"""
     75      return _gnm.DontUseExceptions(*args)
     76  from . import ogr
     77  from . import osr
     78  GATDijkstraShortestPath = _gnm.GATDijkstraShortestPath
     79
     80  GATKShortestPath = _gnm.GATKShortestPath
     81
     82  GATConnectedComponents = _gnm.GATConnectedComponents
     83
     84  GNM_EDGE_DIR_BOTH = _gnm.GNM_EDGE_DIR_BOTH
     85
     86  GNM_EDGE_DIR_SRCTOTGT = _gnm.GNM_EDGE_DIR_SRCTOTGT
     87
     88  GNM_EDGE_DIR_TGTTOSRC = _gnm.GNM_EDGE_DIR_TGTTOSRC
     89
     90
     91 -def CastToNetwork(*args):
     92      r"""CastToNetwork(MajorObject base) -> Network"""
     93      return _gnm.CastToNetwork(*args)
     94
     95 -def CastToGenericNetwork(*args):
     96      r"""CastToGenericNetwork(MajorObject base) -> GenericNetwork"""
     97      return _gnm.CastToGenericNetwork(*args)
     98 -class Network(ogr.MajorObject):
     99      r"""Proxy of C++ GNMNetworkShadow class."""
    100
    101      thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    102
    103 -    def __init__(self, *args, **kwargs):
    104          raise AttributeError("No constructor defined")
    105      __repr__ = _swig_repr
    106      __swig_destroy__ = _gnm.delete_Network
    107
    108 -    def ReleaseResultSet(self, *args):
    109          r"""ReleaseResultSet(Network self, Layer layer)"""
    110          return _gnm.Network_ReleaseResultSet(self, *args)
    111
    112 -    def GetVersion(self, *args):
    113          r"""GetVersion(Network self) -> int"""
    114          return _gnm.Network_GetVersion(self, *args)
    115
    116 -    def GetName(self, *args):
    117          r"""GetName(Network self) -> char const *"""
    118          return _gnm.Network_GetName(self, *args)
    119
    120 -    def GetFeatureByGlobalFID(self, *args):
    121          r"""GetFeatureByGlobalFID(Network self, GIntBig GFID) -> Feature"""
    122          return _gnm.Network_GetFeatureByGlobalFID(self, *args)
    123
    124 -    def GetPath(self, *args, **kwargs):
    125          r"""GetPath(Network self, GIntBig nStartFID, GIntBig nEndFID, GNMGraphAlgorithmType eAlgorithm, char ** options=None) -> Layer"""
    126          return _gnm.Network_GetPath(self, *args, **kwargs)
    127
    128 -    def DisconnectAll(self, *args):
    129          r"""DisconnectAll(Network self) -> CPLErr"""
    130          return _gnm.Network_DisconnectAll(self, *args)
    131
    132 -    def GetProjection(self, *args):
    133          r"""GetProjection(Network self) -> char const *"""
    134          return _gnm.Network_GetProjection(self, *args)
    135
    136 -    def GetProjectionRef(self, *args):
    137          r"""GetProjectionRef(Network self) -> char const *"""
    138          return _gnm.Network_GetProjectionRef(self, *args)
    139
    140 -    def GetFileList(self, *args):
    141          r"""GetFileList(Network self) -> char **"""
    142          return _gnm.Network_GetFileList(self, *args)
    143
    144 -    def CreateLayer(self, *args, **kwargs):
    145          r"""CreateLayer(Network self, char const * name, SpatialReference srs=None, OGRwkbGeometryType geom_type=wkbUnknown, char ** options=None) -> Layer"""
    146          return _gnm.Network_CreateLayer(self, *args, **kwargs)
    147
    148 -    def CopyLayer(self, *args, **kwargs):
    149          r"""CopyLayer(Network self, Layer src_layer, char const * new_name, char ** options=None) -> Layer"""
    150          return _gnm.Network_CopyLayer(self, *args, **kwargs)
    151
    152 -    def DeleteLayer(self, *args):
    153          r"""DeleteLayer(Network self, int index) -> OGRErr"""
    154          return _gnm.Network_DeleteLayer(self, *args)
    155
    156 -    def GetLayerCount(self, *args):
    157          r"""GetLayerCount(Network self) -> int"""
    158          return _gnm.Network_GetLayerCount(self, *args)
    159
    160 -    def GetLayerByIndex(self, *args):
    161          r"""GetLayerByIndex(Network self, int index=0) -> Layer"""
    162          return _gnm.Network_GetLayerByIndex(self, *args)
    163
    164 -    def GetLayerByName(self, *args):
    165          r"""GetLayerByName(Network self, char const * layer_name) -> Layer"""
    166          return _gnm.Network_GetLayerByName(self, *args)
    167
    168 -    def TestCapability(self, *args):
    169          r"""TestCapability(Network self, char const * cap) -> bool"""
    170          return _gnm.Network_TestCapability(self, *args)
    171
    172 -    def StartTransaction(self, *args, **kwargs):
    173          r"""StartTransaction(Network self, int force=FALSE) -> OGRErr"""
    174          return _gnm.Network_StartTransaction(self, *args, **kwargs)
    175
    176 -    def CommitTransaction(self, *args):
    177          r"""CommitTransaction(Network self) -> OGRErr"""
    178          return _gnm.Network_CommitTransaction(self, *args)
    179
    180 -    def RollbackTransaction(self, *args):
    181          r"""RollbackTransaction(Network self) -> OGRErr"""
    182          return _gnm.Network_RollbackTransaction(self, *args)
    183
    184  # Register Network in _gnm:
    185  _gnm.Network_swigregister(Network)
    186
    187 -class GenericNetwork(Network):
    188      r"""Proxy of C++ GNMGenericNetworkShadow class."""
    189
    190      thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    191
    192 -    def __init__(self, *args, **kwargs):
    193          raise AttributeError("No constructor defined")
    194      __repr__ = _swig_repr
    195      __swig_destroy__ = _gnm.delete_GenericNetwork
    196
    197 -    def ConnectFeatures(self, *args):
    198          r"""ConnectFeatures(GenericNetwork self, GIntBig nSrcFID, GIntBig nTgtFID, GIntBig nConFID, double dfCost, double dfInvCost, GNMDirection eDir) -> CPLErr"""
    199          return _gnm.GenericNetwork_ConnectFeatures(self, *args)
    200
    201 -    def DisconnectFeatures(self, *args):
    202          r"""DisconnectFeatures(GenericNetwork self, GIntBig nSrcFID, GIntBig nTgtFID, GIntBig nConFID) -> CPLErr"""
    203          return _gnm.GenericNetwork_DisconnectFeatures(self, *args)
    204
    205 -    def DisconnectFeaturesWithId(self, *args):
    206          r"""DisconnectFeaturesWithId(GenericNetwork self, GIntBig nFID) -> CPLErr"""
    207          return _gnm.GenericNetwork_DisconnectFeaturesWithId(self, *args)
    208
    209 -    def ReconnectFeatures(self, *args):
    210          r"""ReconnectFeatures(GenericNetwork self, GIntBig nSrcFID, GIntBig nTgtFID, GIntBig nConFID, double dfCost, double dfInvCost, GNMDirection eDir) -> CPLErr"""
    211          return _gnm.GenericNetwork_ReconnectFeatures(self, *args)
    212
    213 -    def CreateRule(self, *args):
    214          r"""CreateRule(GenericNetwork self, char const * pszRuleStr) -> CPLErr"""
    215          return _gnm.GenericNetwork_CreateRule(self, *args)
    216
    217 -    def DeleteAllRules(self, *args):
    218          r"""DeleteAllRules(GenericNetwork self) -> CPLErr"""
    219          return _gnm.GenericNetwork_DeleteAllRules(self, *args)
    220
    221 -    def DeleteRule(self, *args):
    222          r"""DeleteRule(GenericNetwork self, char const * pszRuleStr) -> CPLErr"""
    223          return _gnm.GenericNetwork_DeleteRule(self, *args)
    224
    225 -    def GetRules(self, *args):
    226          r"""GetRules(GenericNetwork self) -> char **"""
    227          return _gnm.GenericNetwork_GetRules(self, *args)
    228
    229 -    def ConnectPointsByLines(self, *args, **kwargs):
    230          r"""ConnectPointsByLines(GenericNetwork self, char ** papszLayerList, double dfTolerance, double dfCost, double dfInvCost, GNMDirection eDir) -> CPLErr"""
    231          return _gnm.GenericNetwork_ConnectPointsByLines(self, *args, **kwargs)
    232
    233 -    def ChangeBlockState(self, *args):
    234          r"""ChangeBlockState(GenericNetwork self, GIntBig nFID, bool bIsBlock) -> CPLErr"""
    235          return _gnm.GenericNetwork_ChangeBlockState(self, *args)
    236
    237 -    def ChangeAllBlockState(self, *args):
    238          r"""ChangeAllBlockState(GenericNetwork self, bool bIsBlock=False) -> CPLErr"""
    239          return _gnm.GenericNetwork_ChangeAllBlockState(self, *args)
    240
    241  # Register GenericNetwork in _gnm:
    242  _gnm.GenericNetwork_swigregister(GenericNetwork)
    243