39 typedef int GNMDirection;
43 #define GNM_MD_NAME "net_name" 44 #define GNM_MD_DESCR "net_description" 45 #define GNM_MD_SRS "net_srs" 46 #define GNM_MD_VERSION "net_version" 47 #define GNM_MD_RULE "net_rule" 48 #define GNM_MD_FORMAT "FORMAT" 49 #define GNM_MD_FETCHEDGES "fetch_edge" 50 #define GNM_MD_FETCHVERTEX "fetch_vertex" 51 #define GNM_MD_NUM_PATHS "num_paths" 52 #define GNM_MD_EMITTER "emitter" 58 { GATDijkstraShortestPath = 1, GATKShortestPath, GATConnectedComponents
62 } GNMGraphAlgorithmType;
102 virtual CPLErr Create(
const char* pszFilename,
char** papszOptions ) = 0;
115 virtual CPLErr Delete() = 0;
123 virtual const char* GetName()
const;
135 virtual CPLErr DisconnectAll () = 0;
144 virtual OGRFeature *GetFeatureByGlobalFID (GNMGFID nGFID) = 0;
156 virtual OGRLayer *GetPath (GNMGFID nStartFID, GNMGFID nEndFID,
157 GNMGraphAlgorithmType eAlgorithm,
char** papszOptions) = 0;
165 virtual int CheckNetworkExist(
const char* pszFilename,
166 char** papszOptions ) = 0;
199 const char *pszNewName,
207 virtual CPLErr Create(
const char* pszFilename,
char** papszOptions ) CPL_OVERRIDE = 0;
215 virtual GNMGFID GetNewGlobalFID();
223 virtual CPLString GetAlgorithmName(GNMDirection eAlgorithm,
bool bShortName);
232 virtual CPLErr AddFeatureGlobalFID(GNMGFID nFID,
const char* pszLayerName);
247 virtual CPLErr ConnectFeatures (GNMGFID nSrcFID,
249 GNMGFID nConFID = -1,
251 double dfInvCost = 1,
252 GNMDirection eDir = GNM_EDGE_DIR_BOTH);
261 virtual CPLErr DisconnectFeatures (GNMGFID nSrcFID,
271 virtual CPLErr DisconnectFeaturesWithId(GNMGFID nFID);
285 virtual CPLErr ReconnectFeatures (GNMGFID nSrcFID,
289 double dfInvCost = 1,
290 GNMDirection eDir = GNM_EDGE_DIR_BOTH);
330 virtual CPLErr CreateRule (
const char *pszRuleStr);
336 virtual CPLErr DeleteAllRules();
343 virtual CPLErr DeleteRule(
const char *pszRuleStr);
349 virtual char** GetRules()
const;
375 virtual CPLErr ConnectPointsByLines (
char **papszLayerList,
387 virtual CPLErr ChangeBlockState (GNMGFID nFID,
bool bIsBlock);
397 virtual CPLErr ChangeAllBlockState (
bool bIsBlock =
false);
400 GNMGraphAlgorithmType eAlgorithm,
char** papszOptions)
CPL_OVERRIDE;
408 virtual CPLErr CheckLayerDriver(
const char* pszDefaultDriverName,
409 char** papszOptions);
415 virtual bool CheckStorageDriverSupport(
const char* pszDriverName) = 0;
419 size_t nFieldSize = 1024 );
420 virtual CPLErr StoreNetworkSrs();
421 virtual CPLErr LoadNetworkSrs();
426 virtual CPLErr LoadGraph();
428 virtual CPLErr DeleteMetadataLayer() = 0;
429 virtual CPLErr DeleteGraphLayer() = 0;
430 virtual CPLErr DeleteFeaturesLayer() = 0;
431 virtual CPLErr LoadNetworkLayer(
const char* pszLayername) = 0;
432 virtual CPLErr DeleteNetworkLayers() = 0;
433 virtual void ConnectPointsByMultiline(
GIntBig nFID,
435 const std::vector<OGRLayer *> &paPointLayers,
436 double dfTolerance,
double dfCost,
437 double dfInvCost, GNMDirection eDir);
438 virtual void ConnectPointsByLine(
GIntBig nFID,
440 const std::vector<OGRLayer *> &paPointLayers,
441 double dfTolerance,
double dfCost,
442 double dfInvCost, GNMDirection eDir);
443 virtual GNMGFID FindNearestPoint(
const OGRPoint* poPoint,
444 const std::vector<OGRLayer*>& paPointLayers,
446 virtual OGRFeature* FindConnection(GNMGFID nSrcFID, GNMGFID nTgtFID,
448 virtual void SaveRules();
449 virtual GNMGFID GetNewVirtualFID();
451 const GNMPATH &path,
int nNoOfPath,
452 bool bReturnVertices,
bool bReturnEdges);
458 GNMGFID m_nVirtualConnectionGID;
465 std::map<GNMGFID, CPLString> m_moFeatureFIDMap;
466 std::vector<OGRLayer*> m_apoLayers;
467 std::vector<GNMRule> m_asRules;
468 bool m_bIsRulesChanged;
471 bool m_bIsGraphLoaded;
492 virtual void SetSpatialFilterRect(
double dfMinX,
double dfMinY,
496 virtual void SetSpatialFilterRect(
int iGeomField,
497 double dfMinX,
double dfMinY,
511 virtual int FindFieldIndex(
const char *pszFieldName,
int bExactMatch )
CPL_OVERRIDE;
517 virtual OGRErr GetExtent(
int iGeomField, OGREnvelope *psExtent,
520 virtual int TestCapability(
const char * )
CPL_OVERRIDE;
551 char** papszOptions = NULL,
552 GDALProgressFunc pfnProgress = NULL,
553 void * pProgressArg = NULL );
557 char** papszOptions = NULL,
558 GDALProgressFunc pfnProgress = NULL,
559 void * pProgressArg = NULL );
564 GDALProgressFunc pfnProgress,
565 void * pProgressArg );
569 char** papszOptions = NULL,
570 GDALProgressFunc pfnProgress = NULL,
571 void * pProgressArg = NULL );
575 char** papszOptions = NULL,
576 GDALProgressFunc pfnProgress = NULL,
577 void * pProgressArg = NULL );
581 char** papszOptions = NULL,
582 GDALProgressFunc pfnProgress = NULL,
583 void * pProgressArg = NULL );
587 char** papszOptions = NULL,
588 GDALProgressFunc pfnProgress = NULL,
589 void * pProgressArg = NULL );
595 int AttributeFilterEvaluationNeedsGeometry();
599 OGRErr InitializeIndexSupport(
const char * );
600 OGRLayerAttrIndex *GetIndex();
612 std::map<GNMGFID, GIntBig> m_mnFIDMap;
636 explicit GNMRule(
const std::string &oRule );
638 explicit GNMRule(
const char* pszRule);
646 virtual bool IsValid()
const;
651 virtual bool IsAcceptAny()
const;
657 virtual GNMRuleType GetType()
const;
666 virtual bool CanConnect(
const CPLString &soSrcLayerName,
670 virtual CPLString GetSourceLayerName()
const;
672 virtual CPLString GetTargetLayerName()
const;
674 virtual CPLString GetConnectorLayerName()
const;
676 const char* c_str()
const;
678 operator const char* (void)
const;
681 virtual bool ParseRuleString();
712 virtual int TestCapability(
const char * pszCap )
CPL_OVERRIDE;
722 const CPLString &soLayerName,
int nPathNo,
virtual OGRErr DeleteLayer(int iLayer)
Delete the indicated layer from the datasource.
Definition: gdaldataset.cpp:4598
GNM layer which represents a geography network layer of generic format.
Definition: gnm.h:482
virtual OGRLayer * GetLayer(int iLayer)
Fetch a layer by index.
Definition: gdaldataset.cpp:6050
virtual void FlushCache(void)
Flush all write cached data to disk.
Definition: gdaldataset.cpp:430
Concrete representation of a multi-vertex line.
Definition: ogr_geometry.h:623
Definition of a geometry field of an OGRFeatureDefn.
Definition: ogr_feature.h:141
#define CPL_OVERRIDE
To be used in public headers only.
Definition: cpl_port.h:1049
virtual const char * GetProjectionRef(void)
Fetch the projection definition string for this dataset.
Definition: gdaldataset.cpp:857
GNM class which represents a geography network of generic format.
Definition: gnm.h:184
virtual OGRFeature * GetFeatureByGlobalFID(GNMGFID nGFID)=0
GetFeatureByGlobalFID search all network layers for given feature identificator.
Convenient string class based on std::string.
Definition: cpl_string.h:338
Definition of a feature class or feature layer.
Definition: ogr_feature.h:207
virtual CPLErr Delete()=0
Delete network.
Definition of an attribute of an OGRFeatureDefn.
Definition: ogr_feature.h:62
virtual OGRLayer * CopyLayer(OGRLayer *poSrcLayer, const char *pszNewName, char **papszOptions=NULL)
Duplicate an existing layer.
Definition: gdaldataset.cpp:4234
OGRwkbGeometryType
List of well known binary geometry types.
Definition: ogr_core.h:312
A collection of OGRLineString.
Definition: ogr_geometry.h:1689
The simple graph class, which holds the appropriate for calculations graph in memory (based on STL co...
Definition: gnmgraph.h:83
Abstract base class for all geometry classes.
Definition: ogr_geometry.h:118
Classes related to registration of format support, and opening datasets.
Class for dataset open functions.
Definition: gdal_priv.h:246
General GNM class which represents a geography network of common format.
Definition: gnm.h:70
virtual int CloseDependentDatasets()
Drop references to any other datasets referenced by this dataset.
Definition: gdaldataset.cpp:3413
virtual char ** GetFileList(void)
Fetch files forming dataset.
Definition: gdaldataset.cpp:2374
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:132
virtual CPLErr Create(const char *pszFilename, char **papszOptions)=0
Create network system layers.
The simple class for rules.
Definition: gnm.h:630
virtual OGRLayer * GetPath(GNMGFID nStartFID, GNMGFID nEndFID, GNMGraphAlgorithmType eAlgorithm, char **papszOptions)=0
Create path between start and end GFIDs.
Point class.
Definition: ogr_geometry.h:322
This class represents a layer of simple features, with access methods.
Definition: ogrsf_frmts.h:68
virtual int GetVersion() const
GetVersion return the network version if applicable.
Definition: gnm.h:129
A simple feature, including geometry and attributes.
Definition: ogr_feature.h:279
This class represents a style table.
Definition: ogr_featurestyle.h:83
virtual CPLErr DisconnectAll()=0
DisconnectAll method clears the network graph.
A set of associated raster bands, usually from one file.
Definition: gdal_priv.h:322
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition: cpl_port.h:250
virtual int GetLayerCount()
Get the number of layers in this dataset.
Definition: gdaldataset.cpp:6027
int OGRErr
Simple container for a bounding region.
Definition: ogr_core.h:285
The OGRGNMWrappedResultLayer class for search paths queries results.
Definition: gnm.h:699
virtual int TestCapability(const char *)
Test if capability is available.
Definition: gdaldataset.cpp:6384
Format specific driver.
Definition: gdal_priv.h:1163
CPLErr
Error category.
Definition: cpl_error.h:52