GDAL

- Main Page
- Related Pages
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
GNMGenericNetwork Class Referenceabstract

GNM class which represents a geography network of generic format. More...

`#include <gnm.h>`

Inheritance diagram for GNMGenericNetwork:

## Public Member Functions
virtual int | GetLayerCount ()
| Get the number of layers in this dataset. More...
virtual OGRLayer * | GetLayer (int)
| Fetch a layer by index. More...
virtual OGRErr | DeleteLayer (int)
| Delete the indicated layer from the datasource. More...
virtual int | TestCapability (const char *)
| Test if capability is available. More...
virtual OGRLayer * | CopyLayer (OGRLayer *poSrcLayer, const char *pszNewName, char **papszOptions=NULL)
| Duplicate an existing layer. More...
virtual int | CloseDependentDatasets ()
| Drop references to any other datasets referenced by this dataset. More...
virtual void | FlushCache (void)
| Flush all write cached data to disk. More...
virtual CPLErr | Create (const char *pszFilename, char **papszOptions)=0
| Create network system layers. More...
virtual CPLErr | Delete ()
| Delete network. More...
virtual int | GetVersion () const
| GetVersion return the network version if applicable. More...
virtual GNMGFID | GetNewGlobalFID ()
| GetNewGlobalFID increase the global ID counter. More...
virtual CPLString | GetAlgorithmName (GNMDirection eAlgorithm, bool bShortName)
| Get the algorithm name. More...
virtual CPLErr | AddFeatureGlobalFID (GNMGFID nFID, const char *pszLayerName)
| AddFeatureGlobalFID add the FID <-> Layer name link to fast access features by global FID. More...
virtual CPLErr | ConnectFeatures (GNMGFID nSrcFID, GNMGFID nTgtFID, GNMGFID nConFID=-1, double dfCost=1, double dfInvCost=1, GNMDirection eDir=GNM_EDGE_DIR_BOTH)
| Connects two features via third feature (may be virtual, so the identificator should be -1). More...
virtual CPLErr | DisconnectFeatures (GNMGFID nSrcFID, GNMGFID nTgtFID, GNMGFID nConFID)
| Remove features connection. More...
virtual CPLErr | DisconnectFeaturesWithId (GNMGFID nFID)
| Find the corresponding identificator in graph (source, target, connector) and remove such connections. More...
virtual CPLErr | ReconnectFeatures (GNMGFID nSrcFID, GNMGFID nTgtFID, GNMGFID nConFID, double dfCost=1, double dfInvCost=1, GNMDirection eDir=GNM_EDGE_DIR_BOTH)
| Change connection attributes. More...
virtual CPLErr | DisconnectAll ()
| DisconnectAll method clears the network graph. More...
virtual OGRFeature * | GetFeatureByGlobalFID (GNMGFID nFID)
| GetFeatureByGlobalFID search all network layers for given feature identificator. More...
virtual CPLErr | CreateRule (const char *pszRuleStr)
| Create network rule. More...
virtual CPLErr | DeleteAllRules ()
| Delete all rules from network. More...
virtual CPLErr | DeleteRule (const char *pszRuleStr)
| Delete the specified rule. More...
virtual char ** | GetRules () const
| Get the rule list. More...
virtual CPLErr | ConnectPointsByLines (char **papszLayerList, double dfTolerance, double dfCost, double dfInvCost, GNMDirection eDir)
| Attempts to build the network topology automatically. More...
virtual CPLErr | ChangeBlockState (GNMGFID nFID, bool bIsBlock)
| Change the block state of edge or vertex. More...
virtual CPLErr | ChangeAllBlockState (bool bIsBlock=false)
| Change all vertices and edges block state. More...
virtual OGRLayer * | GetPath (GNMGFID nStartFID, GNMGFID nEndFID, GNMGraphAlgorithmType eAlgorithm, char **papszOptions)
| Create path between start and end GFIDs. More...
Public Member Functions inherited from GNMNetwork
virtual const char * | GetProjectionRef (void)
| Fetch the projection definition string for this dataset. More...
virtual char ** | GetFileList (void)
| Fetch files forming dataset. More...
virtual CPLErr | Open (GDALOpenInfo *poOpenInfo)=0
| Open a network. More...
virtual const char * | GetName () const
| GetName - a network name. More...
Public Member Functions inherited from GDALDataset
virtual | ~GDALDataset ()
| Destroy an open GDALDataset. More...
int | GetRasterXSize (void)
| Fetch raster width in pixels. More...
int | GetRasterYSize (void)
| Fetch raster height in pixels. More...
int | GetRasterCount (void)
| Fetch the number of raster bands on this dataset. More...
GDALRasterBand * | GetRasterBand (int)
| Fetch a band object for a dataset. More...
virtual CPLErr | SetProjection (const char *)
| Set the projection reference string for this dataset. More...
virtual CPLErr | GetGeoTransform (double *)
| Fetch the affine transformation coefficients. More...
virtual CPLErr | SetGeoTransform (double *)
| Set the affine transformation coefficients. More...
virtual CPLErr | AddBand (GDALDataType eType, char **papszOptions=NULL)
| Add a band to a dataset. More...
virtual void * | GetInternalHandle (const char *)
| Fetch a format specific internally meaningful handle. More...
virtual GDALDriver * | GetDriver (void)
| Fetch the driver to which this dataset relates. More...
virtual const char * | GetDriverName ()
virtual int | GetGCPCount ()
| Get number of GCPs. More...
virtual const char * | GetGCPProjection ()
| Get output projection for GCPs. More...
virtual const GDAL_GCP * | GetGCPs ()
| Fetch GCPs. More...
virtual CPLErr | SetGCPs (int nGCPCount, const GDAL_GCP *pasGCPList, const char *pszGCPProjection)
| Assign GCPs. More...
virtual CPLErr | AdviseRead (int nXOff, int nYOff, int nXSize, int nYSize, int nBufXSize, int nBufYSize, GDALDataType eDT, int nBandCount, int *panBandList, char **papszOptions)
| Advise driver of upcoming read requests. More...
virtual CPLErr | CreateMaskBand (int nFlagsIn)
| Adds a mask band to the dataset. More...
virtual GDALAsyncReader * | BeginAsyncReader (int nXOff, int nYOff, int nXSize, int nYSize, void *pBuf, int nBufXSize, int nBufYSize, GDALDataType eBufType, int nBandCount, int *panBandMap, int nPixelSpace, int nLineSpace, int nBandSpace, char **papszOptions)
| Sets up an asynchronous data request. More...
virtual void | EndAsyncReader (GDALAsyncReader *)
| End asynchronous request. More...
CPLErr | RasterIO (GDALRWFlag, int, int, int, int, void *, int, int, GDALDataType, int, int *, GSpacing, GSpacing, GSpacing, GDALRasterIOExtraArg *psExtraArg) CPL_WARN_UNUSED_RESULT
| Read/write a region of image data from multiple bands. More...
int | Reference ()
| Add one to dataset reference count. More...
int | Dereference ()
| Subtract one from dataset reference count. More...
GDALAccess | GetAccess () const
int | GetShared ()
| Returns shared flag. More...
void | MarkAsShared ()
| Mark this dataset as available for sharing.
void | MarkSuppressOnClose ()
char ** | GetOpenOptions ()
CPLErr | BuildOverviews (const char *, int, int *, int, int *, GDALProgressFunc, void *)
| Build raster overview(s) More...
void | ReportError (CPLErr eErrClass, CPLErrorNum err_no, const char *fmt,...) CPL_PRINT_FUNC_FORMAT(4
| Emits an error related to a dataset. More...
virtual OGRLayer * | GetLayerByName (const char *)
| Fetch a layer by name. More...
virtual OGRLayer * | CreateLayer (const char *pszName, OGRSpatialReference *poSpatialRef=NULL, OGRwkbGeometryType eGType=wkbUnknown, char **papszOptions=NULL)
| This method attempts to create a new layer on the dataset with the indicated name, coordinate system, geometry type. More...
virtual OGRStyleTable * | GetStyleTable ()
| Returns dataset style table. More...
virtual void | SetStyleTableDirectly (OGRStyleTable *poStyleTable)
| Set dataset style table. More...
virtual void | SetStyleTable (OGRStyleTable *poStyleTable)
| Set dataset style table. More...
virtual OGRLayer * | ExecuteSQL (const char *pszStatement, OGRGeometry *poSpatialFilter, const char *pszDialect)
| Execute an SQL statement against the data store. More...
virtual void | ReleaseResultSet (OGRLayer *poResultsSet)
| Release results of ExecuteSQL(). More...
int | GetRefCount () const
| Fetch reference count. More...
int | GetSummaryRefCount () const
| Fetch reference count of datasource and all owned layers. More...
OGRErr | Release ()
| Drop a reference to this dataset, and if the reference count drops to one close (destroy) the dataset. More...
virtual OGRErr | StartTransaction (int bForce=FALSE)
| For datasources which support transactions, StartTransaction creates a `transaction. More...
virtual OGRErr | CommitTransaction ()
| For datasources which support transactions, CommitTransaction commits a transaction. More...
virtual OGRErr | RollbackTransaction ()
| For datasources which support transactions, RollbackTransaction will roll back a datasource to its state before the start of the current transaction. More...
GDALSQLParseInfo * | BuildParseInfo (swq_select *psSelectInfo, swq_select_parse_options *poSelectParseOptions)
void | DestroyParseInfo (GDALSQLParseInfo *psParseInfo)
OGRLayer * | ExecuteSQL (const char *pszStatement, OGRGeometry *poSpatialFilter, const char *pszDialect, swq_select_parse_options *poSelectParseOptions)
Public Member Functions inherited from GDALMajorObject
int | GetMOFlags ()
void | SetMOFlags (int nFlagsIn)
virtual const char * | GetDescription () const
| Fetch object description. More...
virtual void | SetDescription (const char *)
| Set object description. More...
virtual char ** | GetMetadataDomainList ()
| Fetch list of metadata domains. More...
virtual char ** | GetMetadata (const char *pszDomain="")
| Fetch metadata. More...
virtual CPLErr | SetMetadata (char **papszMetadata, const char *pszDomain="")
| Set metadata. More...
virtual const char * | GetMetadataItem (const char *pszName, const char *pszDomain="")
| Fetch single metadata item. More...
virtual CPLErr | SetMetadataItem (const char *pszName, const char *pszValue, const char *pszDomain="")
| Set single metadata item. More...

## Protected Member Functions
virtual CPLErr | CheckLayerDriver (const char *pszDefaultDriverName, char **papszOptions)
| Check or create layer OGR driver. More...
virtual bool | CheckStorageDriverSupport (const char *pszDriverName)=0
| Check if provided OGR driver accepted as storage for network data. More...
virtual CPLErr | CreateMetadataLayer (GDALDataset *const pDS, int nVersion, size_t nFieldSize=1024)
virtual CPLErr | StoreNetworkSrs ()
virtual CPLErr | LoadNetworkSrs ()
virtual CPLErr | CreateGraphLayer (GDALDataset *const pDS)
virtual CPLErr | CreateFeaturesLayer (GDALDataset *const pDS)
virtual CPLErr | LoadMetadataLayer (GDALDataset *const pDS)
virtual CPLErr | LoadGraphLayer (GDALDataset *const pDS)
virtual CPLErr | LoadGraph ()
virtual CPLErr | LoadFeaturesLayer (GDALDataset *const pDS)
virtual CPLErr | DeleteMetadataLayer ()=0
virtual CPLErr | DeleteGraphLayer ()=0
virtual CPLErr | DeleteFeaturesLayer ()=0
virtual CPLErr | LoadNetworkLayer (const char *pszLayername)=0
virtual CPLErr | DeleteNetworkLayers ()=0
virtual void | ConnectPointsByMultiline (GIntBig nFID, const OGRMultiLineString *poMultiLineString, const std::vector< OGRLayer * > &paPointLayers, double dfTolerance, double dfCost, double dfInvCost, GNMDirection eDir)
virtual void | ConnectPointsByLine (GIntBig nFID, const OGRLineString *poLineString, const std::vector< OGRLayer * > &paPointLayers, double dfTolerance, double dfCost, double dfInvCost, GNMDirection eDir)
virtual GNMGFID | FindNearestPoint (const OGRPoint *poPoint, const std::vector< OGRLayer * > &paPointLayers, double dfTolerance)
virtual OGRFeature * | FindConnection (GNMGFID nSrcFID, GNMGFID nTgtFID, GNMGFID nConFID)
virtual void | SaveRules ()
virtual GNMGFID | GetNewVirtualFID ()
virtual void | FillResultLayer (OGRGNMWrappedResultLayer *poResLayer, const GNMPATH &path, int nNoOfPath, bool bReturnVertices, bool bReturnEdges)
Protected Member Functions inherited from GNMNetwork
virtual int | CheckNetworkExist (const char *pszFilename, char **papszOptions)=0
| Check if network already exist. More...
Protected Member Functions inherited from GDALDataset
| GDALDataset (int bForceCachedIO)
void | RasterInitialize (int, int)
void | SetBand (int, GDALRasterBand *)
virtual CPLErr | IBuildOverviews (const char *, int, int *, int, int *, GDALProgressFunc, void *)
virtual CPLErr | IRasterIO (GDALRWFlag, int, int, int, int, void *, int, int, GDALDataType, int, int *, GSpacing, GSpacing, GSpacing, GDALRasterIOExtraArg *psExtraArg) CPL_WARN_UNUSED_RESULT
CPLErr | BlockBasedRasterIO (GDALRWFlag, int, int, int, int, void *, int, int, GDALDataType, int, int *, GSpacing, GSpacing, GSpacing, GDALRasterIOExtraArg *psExtraArg) CPL_WARN_UNUSED_RESULT
void | BlockBasedFlushCache ()
CPLErr | BandBasedRasterIO (GDALRWFlag eRWFlag, int nXOff, int nYOff, int nXSize, int nYSize, void *pData, int nBufXSize, int nBufYSize, GDALDataType eBufType, int nBandCount, int *panBandMap, GSpacing nPixelSpace, GSpacing nLineSpace, GSpacing nBandSpace, GDALRasterIOExtraArg *psExtraArg) CPL_WARN_UNUSED_RESULT
CPLErr | RasterIOResampled (GDALRWFlag eRWFlag, int nXOff, int nYOff, int nXSize, int nYSize, void *pData, int nBufXSize, int nBufYSize, GDALDataType eBufType, int nBandCount, int *panBandMap, GSpacing nPixelSpace, GSpacing nLineSpace, GSpacing nBandSpace, GDALRasterIOExtraArg *psExtraArg) CPL_WARN_UNUSED_RESULT
CPLErr | ValidateRasterIOOrAdviseReadParameters (const char *pszCallingFunc, int *pbStopProcessingOnCENone, int nXOff, int nYOff, int nXSize, int nYSize, int nBufXSize, int nBufYSize, int nBandCount, int *panBandMap)
CPLErr | TryOverviewRasterIO (GDALRWFlag eRWFlag, int nXOff, int nYOff, int nXSize, int nYSize, void *pData, int nBufXSize, int nBufYSize, GDALDataType eBufType, int nBandCount, int *panBandMap, GSpacing nPixelSpace, GSpacing nLineSpace, GSpacing nBandSpace, GDALRasterIOExtraArg *psExtraArg, int *pbTried)
int | ValidateLayerCreationOptions (const char *const *papszLCO)
int | EnterReadWrite (GDALRWFlag eRWFlag)
void | LeaveReadWrite ()
void | TemporarilyDropReadWriteLock ()
void | ReacquireReadWriteLock ()
void | DisableReadWriteMutex ()
int | AcquireMutex ()
void | ReleaseMutex ()
virtual OGRLayer * | ICreateLayer (const char *pszName, OGRSpatialReference *poSpatialRef=NULL, OGRwkbGeometryType eGType=wkbUnknown, char **papszOptions=NULL)
| This method attempts to create a new layer on the dataset with the indicated name, coordinate system, geometry type. More...
OGRErr | ProcessSQLCreateIndex (const char *)
OGRErr | ProcessSQLDropIndex (const char *)
OGRErr | ProcessSQLDropTable (const char *)
OGRErr | ProcessSQLAlterTableAddColumn (const char *)
OGRErr | ProcessSQLAlterTableDropColumn (const char *)
OGRErr | ProcessSQLAlterTableAlterColumn (const char *)
OGRErr | ProcessSQLAlterTableRenameColumn (const char *)
Protected Member Functions inherited from GDALMajorObject
char ** | BuildMetadataDomainList (char **papszList, int bCheckNonEmpty,...) CPL_NULL_TERMINATED
| Helper function for custom implementations of GetMetadataDomainList() More...

## Protected Attributes
int | m_nVersion
GNMGFID | m_nGID
GNMGFID | m_nVirtualConnectionGID
OGRLayer * | m_poMetadataLayer
OGRLayer * | m_poGraphLayer
OGRLayer * | m_poFeaturesLayer
GDALDriver * | m_poLayerDriver
std::map< GNMGFID, CPLString > | m_moFeatureFIDMap
std::vector< OGRLayer * > | m_apoLayers
std::vector< GNMRule > | m_asRules
bool | m_bIsRulesChanged
GNMGraph | m_oGraph
bool | m_bIsGraphLoaded
Protected Attributes inherited from GNMNetwork
CPLString | m_soName
CPLString | m_soSRS
Protected Attributes inherited from GDALDataset
GDALDriver * | poDriver
GDALAccess | eAccess
int | nRasterXSize
int | nRasterYSize
int | nBands
GDALRasterBand ** | papoBands
int | nOpenFlags
int | nRefCount
GByte | bForceCachedIO
GByte | bShared
GByte | bIsInternal
GByte | bSuppressOnClose
GDALDefaultOverviews | oOvManager
char ** | papszOpenOptions
OGRStyleTable * | m_poStyleTable
Protected Attributes inherited from GDALMajorObject
int | nFlags
CPLString | sDescription
GDALMultiDomainMetadata | oMDMD

## Additional Inherited Members
Static Public Member Functions inherited from GDALDataset
static GDALDataset ** | GetOpenDatasets (int *pnDatasetCount)
| Fetch all open GDAL dataset handles. More...
static int | IsGenericSQLDialect (const char *pszDialect)

## Detailed Description

GNM class which represents a geography network of generic format.

Since
  GDAL 2.1

## Member Function Documentation

CPLErr GNMGenericNetwork::AddFeatureGlobalFID | ( | GNMGFID | nFID,
|  | const char * | pszLayerName
| ) |  |
| virtual

AddFeatureGlobalFID add the FID <-> Layer name link to fast access features by global FID.

Parameters

  nFID | - global FID
  pszLayerName | - layer name

Returns
  CE_None on success

CPLErr GNMGenericNetwork::ChangeAllBlockState | ( | bool | bIsBlock = `false` | ) |
| virtual

Change all vertices and edges block state.

This is mainly use for unblock all vertices and edges.

Parameters

  bIsBlock | Block or unblock

Returns
  CE_None on success

CPLErr GNMGenericNetwork::ChangeBlockState | ( | GNMGFID | nFID,
|  | bool | bIsBlock
| ) |  |
| virtual

Change the block state of edge or vertex.

Parameters

  nFID | Identificator
  bIsBlock | Block or unblock

Returns
  CE_None on success

CPLErr GNMGenericNetwork::CheckLayerDriver | ( | const char * | pszDefaultDriverName,
|  | char ** | papszOptions
| ) |  |
| protectedvirtual

Check or create layer OGR driver.

Parameters

  pszDefaultDriverName | - default driver name
  papszOptions | - create options

Returns
  CE_None if driver is exist or CE_Failure

virtual bool GNMGenericNetwork::CheckStorageDriverSupport | ( | const char * | pszDriverName | ) |
| protectedpure virtual

Check if provided OGR driver accepted as storage for network data.

Parameters

  pszDriverName | The driver name

Returns
  true if supported, else false

int GNMGenericNetwork::CloseDependentDatasets | ( |  | ) |
| virtual

Drop references to any other datasets referenced by this dataset.

This method should release any reference to other datasets (e.g. a VRT dataset to its sources), but not close the current dataset itself.

If at least, one reference to a dependent dataset has been dropped, this method should return TRUE. Otherwise it should return FALSE. (Failure to return the proper value might result in infinite loop)

This method can be called several times on a given dataset. After the first time, it should not do anything and return FALSE.

The driver implementation may choose to destroy its raster bands, so be careful not to call any method on the raster bands afterwards.

Basically the only safe action you can do after calling CloseDependentDatasets() is to call the destructor.

Note: the only legitimate caller of CloseDependentDatasets() is GDALDriverManager::~GDALDriverManager()

Returns
  TRUE if at least one reference to another dataset has been dropped.

Reimplemented from GDALDataset.

CPLErr GNMGenericNetwork::ConnectFeatures | ( | GNMGFID | nSrcFID,
|  | GNMGFID | nTgtFID,
|  | GNMGFID | nConFID = `-1`,
|  | double | dfCost = `1`,
|  | double | dfInvCost = `1`,
|  | GNMDirection | eDir = `GNM_EDGE_DIR_BOTH`
| ) |  |
| virtual

Connects two features via third feature (may be virtual, so the identificator should be -1).

The features may be at the same layer or different layers.

Parameters

  nSrcFID | - source feature identificator
  nTgtFID | - target feature identificator
  nConFID | - connection feature identificator (-1 for virtual connection)
  dfCost | - cost moving from source to target (default 1)
  dfInvCost | - cost moving from target to source (default 1)
  eDir | - direction, may be source to target, traget to source or both. (default - both)

Returns
  CE_None on success

CPLErr GNMGenericNetwork::ConnectPointsByLines | ( | char ** | papszLayerList,
|  | double | dfTolerance,
|  | double | dfCost,
|  | double | dfInvCost,
|  | GNMDirection | eDir
| ) |  |
| virtual

Attempts to build the network topology automatically.

The method simply gets point and line or multiline layers from the papszLayerList and searches for each line which connects two points: start and end, so it can be not so effective in performance when it is called on huge networks. Note, when passing your tolerance value: this value will depend of spatial reference system of the network, and especially of its 0,0 position because dfTolerance is just divided by 2 and added/subtracted to/from both sides of each line-feature end point forming thus the square area around it. The first point-feature occurred inside this area will be given as a start/end point for the current connection. So it is also desirable that at least two layers are passed in papszLayerList (one point and one line), and they are already connected "visually" ("geometrically").

Parameters

  papszLayerList | A list of layers to connect. The list should be freed via CSLDestroy.
  dfTolerance | Snapping tolerance.

Returns
  CE_None on success

OGRLayer * GNMGenericNetwork::CopyLayer | ( | OGRLayer * | poSrcLayer,
|  | const char * | pszNewName,
|  | char ** | papszOptions = `NULL`
| ) |  |
| virtual

Duplicate an existing layer.

This method creates a new layer, duplicate the field definitions of the source layer and then duplicate each features of the source layer. The papszOptions argument can be used to control driver specific creation options. These options are normally documented in the format specific documentation. The source layer may come from another dataset.

This method is the same as the C function GDALDatasetCopyLayer() and the deprecated OGR_DS_CopyLayer().

In GDAL 1.X, this method used to be in the OGRDataSource class.

Parameters

  poSrcLayer | source layer.
  pszNewName | the name of the layer to create.
  papszOptions | a StringList of name=value options. Options are driver specific. There is a common option to set output layer spatial reference: DST_SRSWKT. The option should be in WKT format.

Returns
  an handle to the layer, or NULL if an error occurs.

Reimplemented from GDALDataset.

virtual CPLErr GNMGenericNetwork::Create | ( | const char * | pszFilename,
|  | char ** | papszOptions
| ) |  |
| pure virtual

Create network system layers.

Creates the connectivity (the "network path" of data) over the dataset and returns the resulting network. NOTE: This method does not create any connections among features but creates the necessary set of fields, layers, etc. NOTE: After the successful creation the passed dataset must not be modified outside (but can be read as usual). NOTE: For the common network format the creation is forbidden if the passed dataset already has network system layers and OVERWRITE creation option is FALSE.

Parameters

  pszFilename | - A path there the network folder (schema, etc.) will be created. The folder (schema, etc.) name get options.
  papszOptions | - create network options. The create options specific for gnm driver.

Returns
  CE_None on success

Implements GNMNetwork.

CPLErr GNMGenericNetwork::CreateRule | ( | const char * | pszRuleStr | ) |
| virtual

Create network rule.

Creates the rule in the network according to the special syntax. These rules are declarative and make an effect for the network when they exist. Each rule for layer can be created only if the corresponding layer existed and removed when the layer is being deleted.

Rules syntax for the common network format in GNM contains the key words (words in capital letters or signs) and the modifiers which refers to the network objects. All the following combinations are available:

Notation: layer1, layer2, layer3 - a layer names (the corresponding layers must be exist; field1 - a field name (field must be exist); constant1 - any double constant; string1 - any string;

Rules describing which layer can be connected or not connected with each other, and (optional) which layer must serve as a connector. By default all connections are forbidden. But while network creation process the rule to allow any connection added. During the connection process each rule tested if this connection can be created.

"ALLOW CONNECTS ANY" "DENY CONNECTS ANY" "DENY CONNECTS layer1 WITH layer2" "ALLOW CONNECTS layer1 WITH layer2 VIA layer3"

Parameters

  pszRuleStr | Rule string which will parsed. If the parsing was successful, the rule will start having effect immediately.

Returns
  CE_None on success.

CPLErr GNMGenericNetwork::Delete | ( |  | ) |
| virtual

Delete network.

Delete all dependent layers

Returns
  CE_None on success

Implements GNMNetwork.

CPLErr GNMGenericNetwork::DeleteAllRules | ( |  | ) |
| virtual

Delete all rules from network.

Returns
  CE_None on success.

OGRErr GNMGenericNetwork::DeleteLayer | ( | int | iLayer | ) |
| virtual

Delete the indicated layer from the datasource.

If this method is supported the ODsCDeleteLayer capability will test TRUE on the GDALDataset.

This method is the same as the C function GDALDatasetDeleteLayer() and the deprecated OGR_DS_DeleteLayer().

In GDAL 1.X, this method used to be in the OGRDataSource class.

Parameters

  iLayer | the index of the layer to delete.

Returns
  OGRERR_NONE on success, or OGRERR_UNSUPPORTED_OPERATION if deleting layers is not supported for this datasource.

Reimplemented from GDALDataset.

CPLErr GNMGenericNetwork::DeleteRule | ( | const char * | pszRuleStr | ) |
| virtual

Delete the specified rule.

Parameters

  pszRuleStr | - the rule to delete

Returns
  CE_None on success.

CPLErr GNMGenericNetwork::DisconnectAll | ( |  | ) |
| virtual

DisconnectAll method clears the network graph.

Returns
  CE_None on success

Implements GNMNetwork.

CPLErr GNMGenericNetwork::DisconnectFeatures | ( | GNMGFID | nSrcFID,
|  | GNMGFID | nTgtFID,
|  | GNMGFID | nConFID
| ) |  |
| virtual

Remove features connection.

Parameters

  nSrcFID | - source feature identificator
  nTgtFID | - target feature identificator
  nConFID | - connection feature identificator

Returns
  CE_None on success

CPLErr GNMGenericNetwork::DisconnectFeaturesWithId | ( | GNMGFID | nFID | ) |
| virtual

Find the corresponding identificator in graph (source, target, connector) and remove such connections.

Parameters

  nFID | - identificator to find.

Returns
  CE_None on success

void GNMGenericNetwork::FlushCache | ( | void |  | ) |
| virtual

Flush all write cached data to disk.

Any raster (or other GDAL) data written via GDAL calls, but buffered internally will be written to disk.

The default implementation of this method just calls the FlushCache() method on each of the raster bands and the SyncToDisk() method on each of the layers. Conceptionally, calling FlushCache() on a dataset should include any work that might be accomplished by calling SyncToDisk() on layers in that dataset.

Using this method does not prevent use from calling GDALClose() to properly close a dataset and ensure that important data not addressed by FlushCache() is written in the file.

This method is the same as the C function GDALFlushCache().

Reimplemented from GDALDataset.

CPLString GNMGenericNetwork::GetAlgorithmName | ( | GNMDirection | eAlgorithm,
|  | bool | bShortName
| ) |  |
| virtual

Get the algorithm name.

Parameters

  eAlgorithm | GNM algorithm type
  bShortName | Indicator which name to return - short or long

Returns
  String with algorithm name

OGRFeature * GNMGenericNetwork::GetFeatureByGlobalFID | ( | GNMGFID | nGFID | ) |
| virtual

GetFeatureByGlobalFID search all network layers for given feature identificator.

Parameters

  nGFID | feature identificator.

Returns
  OGRFeature pointer or NULL. The pointer should be freed via OGRFeature::DestroyFeature().

Implements GNMNetwork.

OGRLayer * GNMGenericNetwork::GetLayer | ( | int | iLayer | ) |
| virtual

Fetch a layer by index.

The returned layer remains owned by the GDALDataset and should not be deleted by the application.

This method is the same as the C function GDALDatasetGetLayer() and the deprecated OGR_DS_GetLayer().

In GDAL 1.X, this method used to be in the OGRDataSource class.

Parameters

  iLayer | a layer number between 0 and GetLayerCount()-1.

Returns
  the layer, or NULL if iLayer is out of range or an error occurs.

Reimplemented from GDALDataset.

int GNMGenericNetwork::GetLayerCount | ( |  | ) |
| virtual

Get the number of layers in this dataset.

This method is the same as the C function GDALDatasetGetLayerCount(), and the deprecated OGR_DS_GetLayerCount().

In GDAL 1.X, this method used to be in the OGRDataSource class.

Returns
  layer count.

Reimplemented from GDALDataset.

GIntBig GNMGenericNetwork::GetNewGlobalFID | ( |  | ) |
| virtual

GetNewGlobalFID increase the global ID counter.

Returns
  New global feature ID.

OGRLayer * GNMGenericNetwork::GetPath | ( | GNMGFID | nStartFID,
|  | GNMGFID | nEndFID,
|  | GNMGraphAlgorithmType | eAlgorithm,
|  | char ** | papszOptions
| ) |  |
| virtual

Create path between start and end GFIDs.

Parameters

  nStartGFID | - start identificator
  nEndGFID | - end identificator
  eAlgorithm | - The algorithm to get path
  papszOptions | - algorithm specific options

Returns
  In memory OGRLayer pointer with features constituting the shortest path (or paths). The caller have to free the pointer via

See also
  ReleaseResultSet().

Implements GNMNetwork.

char ** GNMGenericNetwork::GetRules | ( |  | ) | const
| virtual

Get the rule list.

Returns
  list of rule strings. The caller have to free the lis via CPLDestroy.

int GNMGenericNetwork::GetVersion | ( |  | ) | const
| virtual

GetVersion return the network version if applicable.

Returns
  version value

Reimplemented from GNMNetwork.

CPLErr GNMGenericNetwork::ReconnectFeatures | ( | GNMGFID | nSrcFID,
|  | GNMGFID | nTgtFID,
|  | GNMGFID | nConFID,
|  | double | dfCost = `1`,
|  | double | dfInvCost = `1`,
|  | GNMDirection | eDir = `GNM_EDGE_DIR_BOTH`
| ) |  |
| virtual

Change connection attributes.

Search the connection by source feature identificator, target feature identificator and connection identificator.

Parameters

  nSrcFID | - source feature identificator
  nTgtFID | - target feature identificator
  nConFID | - connection feature identificator
  dfCost | - new cost moving from source to target
  dfInvCost | - new cost moving from target to source
  eDir | - new direction

Returns
  CE_None on success

int GNMGenericNetwork::TestCapability | ( | const char * | pszCap | ) |
| virtual

Test if capability is available.

One of the following dataset capability names can be passed into this method, and a TRUE or FALSE value will be returned indicating whether or not the capability is available for this object.

- ODsCCreateLayer: True if this datasource can create new layers.

- ODsCDeleteLayer: True if this datasource can delete existing layers.

- ODsCCreateGeomFieldAfterCreateLayer: True if the layers of this datasource support CreateGeomField() just after layer creation.

- ODsCCurveGeometries: True if this datasource supports curve geometries.

- ODsCTransactions: True if this datasource supports (efficient) transactions.

- ODsCEmulatedTransactions: True if this datasource supports transactions through emulation.

The #define macro forms of the capability names should be used in preference to the strings themselves to avoid misspelling.

This method is the same as the C function GDALDatasetTestCapability() and the deprecated OGR_DS_TestCapability().

In GDAL 1.X, this method used to be in the OGRDataSource class.

Parameters

  pszCap | the capability to test.

Returns
  TRUE if capability available otherwise FALSE.

Reimplemented from GDALDataset.

The documentation for this class was generated from the following files:

- gnm.h
- gnmgenericnetwork.cpp

Generated for GDAL by 1.8.8.