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,
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;
497 double dfMinX,
double dfMinY,
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 );
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();
722 const CPLString &soLayerName,
int nPathNo,
virtual OGRErr ISetFeature(OGRFeature *poFeature) CPL_WARN_UNUSED_RESULT
Rewrite an existing feature.
Definition: ogrlayer.cpp:595
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 OGRFeatureDefn * GetLayerDefn() CPL_OVERRIDE
Fetch the schema information for this layer.
Definition: gnmlayer.cpp:363
virtual GIntBig GetFeatureCount(int bForce=TRUE) CPL_OVERRIDE
Fetch the feature count in this layer.
Definition: gnmlayer.cpp:275
virtual OGRwkbGeometryType GetGeomType() CPL_OVERRIDE
Return the layer geometry type.
Definition: gnmlayer.cpp:260
virtual OGRErr ICreateFeature(OGRFeature *poFeature) CPL_WARN_UNUSED_RESULT
Create and write a new feature within a layer.
Definition: ogrlayer.cpp:634
virtual void SetSpatialFilter(OGRGeometry *) CPL_OVERRIDE
Set a new spatial filter.
Definition: gnmlayer.cpp:181
virtual int TestCapability(const char *) CPL_OVERRIDE
Test if this layer supported the named capability.
Definition: gnmlayer.cpp:290
virtual OGRFeatureDefn * GetLayerDefn() CPL_OVERRIDE
Fetch the schema information for this layer.
Definition: gnmresultlayer.cpp:83
virtual void FlushCache(void)
Flush all write cached data to disk.
Definition: gdaldataset.cpp:430
virtual OGRErr GetExtent(OGREnvelope *psExtent, int bForce=TRUE) CPL_OVERRIDE
Fetch the extent of this layer.
Definition: gnmlayer.cpp:280
Concrete representation of a multi-vertex line.
Definition: ogr_geometry.h:623
virtual void SetStyleTableDirectly(OGRStyleTable *poStyleTable) CPL_OVERRIDE
Set layer style table.
Definition: gnmlayer.cpp:338
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 OGRErr AlterFieldDefn(int iField, OGRFieldDefn *poNewFieldDefn, int nFlagsIn) CPL_OVERRIDE
Alter the definition of an existing field on a layer.
Definition: gnmlayer.cpp:314
virtual ~GNMGenericLayer()
~GNMGenericLayer
Definition: gnmlayer.cpp:50
virtual OGRErr CreateGeomField(OGRGeomFieldDefn *poField, int bApproxOK=TRUE) CPL_OVERRIDE
Create a new geometry field on a layer.
Definition: gnmresultlayer.cpp:103
virtual OGRErr RollbackTransaction() CPL_OVERRIDE
For datasources which support transactions, RollbackTransaction will roll back a datasource to its ...
Definition: gnmlayer.cpp:358
virtual OGRErr SetIgnoredFields(const char **papszFields) CPL_OVERRIDE
Set which fields can be omitted when retrieving features from the layer.
Definition: gnmlayer.cpp:62
virtual const char * GetGeometryColumn() CPL_OVERRIDE
This method returns the name of the underlying database column being used as the geometry column...
Definition: gnmlayer.cpp:57
virtual void ResetReading() CPL_OVERRIDE
Reset feature reading to start on the first feature.
Definition: gnmresultlayer.cpp:63
virtual const char * GetProjectionRef(void)
Fetch the projection definition string for this dataset.
Definition: gdaldataset.cpp:857
virtual const char * GetGeometryColumn() CPL_OVERRIDE
This method returns the name of the underlying database column being used as the geometry column...
Definition: gnmresultlayer.cpp:114
GNM class which represents a geography network of generic format.
Definition: gnm.h:184
virtual OGRErr CreateField(OGRFieldDefn *poField, int bApproxOK=TRUE) CPL_OVERRIDE
Create a new field on a layer.
Definition: gnmlayer.cpp:295
virtual OGRErr DeleteFeature(GIntBig nFID) CPL_OVERRIDE
Delete feature from layer.
Definition: gnmlayer.cpp:230
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 OGRErr CreateGeomField(OGRGeomFieldDefn *poField, int bApproxOK=TRUE) CPL_OVERRIDE
Create a new geometry field on a layer.
Definition: gnmlayer.cpp:323
virtual OGRErr SyncToDisk() CPL_OVERRIDE
Flush pending changes to disk.
Definition: gnmlayer.cpp:328
virtual OGRErr DeleteField(int iField) CPL_OVERRIDE
Delete an existing field on a layer.
Definition: gnmlayer.cpp:300
virtual CPLErr Delete()=0
Delete network.
OGRErr Clip(OGRLayer *pLayerMethod, OGRLayer *pLayerResult, char **papszOptions=NULL, GDALProgressFunc pfnProgress=NULL, void *pProgressArg=NULL)
Clip.
Definition: gnmlayer.cpp:109
OGRErr Erase(OGRLayer *pLayerMethod, OGRLayer *pLayerResult, char **papszOptions=NULL, GDALProgressFunc pfnProgress=NULL, void *pProgressArg=NULL)
Erase.
Definition: gnmlayer.cpp:117
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
virtual int FindFieldIndex(const char *pszFieldName, int bExactMatch) CPL_OVERRIDE
Find the index of field in the layer.
Definition: gnmlayer.cpp:265
OGRErr Union(OGRLayer *pLayerMethod, OGRLayer *pLayerResult, char **papszOptions=NULL, GDALProgressFunc pfnProgress=NULL, void *pProgressArg=NULL)
Union.
Definition: gnmlayer.cpp:77
virtual OGRGeometry * GetSpatialFilter() CPL_OVERRIDE
This method returns the current spatial filter for this layer.
Definition: gnmlayer.cpp:176
virtual OGRErr CommitTransaction() CPL_OVERRIDE
For datasources which support transactions, CommitTransaction commits a transaction.
Definition: gnmlayer.cpp:353
virtual OGRErr ICreateFeature(OGRFeature *poFeature) CPL_OVERRIDE
Create and write a new feature within a layer.
Definition: gnmresultlayer.cpp:212
OGRwkbGeometryType
List of well known binary geometry types.
Definition: ogr_core.h:312
OGRErr SymDifference(OGRLayer *pLayerMethod, OGRLayer *pLayerResult, char **papszOptions, GDALProgressFunc pfnProgress, void *pProgressArg)
SymDifference.
Definition: gnmlayer.cpp:85
virtual OGRErr ISetFeature(OGRFeature *poFeature) CPL_OVERRIDE
Rewrite an existing feature.
Definition: gnmresultlayer.cpp:207
OGRGNMWrappedResultLayer(GDALDataset *poDS, OGRLayer *poLayer)
Constructor.
Definition: gnmresultlayer.cpp:36
virtual OGRErr SetAttributeFilter(const char *) CPL_OVERRIDE
Set a new attribute query.
Definition: gnmlayer.cpp:204
A collection of OGRLineString.
Definition: ogr_geometry.h:1692
virtual OGRErr ReorderFields(int *panMap) CPL_OVERRIDE
Reorder all the fields of a layer.
Definition: gnmlayer.cpp:309
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.
OGRErr Update(OGRLayer *pLayerMethod, OGRLayer *pLayerResult, char **papszOptions=NULL, GDALProgressFunc pfnProgress=NULL, void *pProgressArg=NULL)
Update.
Definition: gnmlayer.cpp:101
GIntBig GetFeaturesRead()
GetFeaturesRead.
Definition: gnmlayer.cpp:125
virtual const char * GetFIDColumn() CPL_OVERRIDE
This method returns the name of the underlying database column being used as the FID column...
Definition: gnmlayer.cpp:52
virtual const char * GetName() CPL_OVERRIDE
Return the layer name.
Definition: gnmlayer.cpp:255
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 OGRFeature * GetNextFeature() CPL_OVERRIDE
Fetch the next available feature from this layer.
Definition: gnmlayer.cpp:214
virtual OGRErr StartTransaction() CPL_OVERRIDE
For datasources which support transactions, StartTransaction creates a transaction.
Definition: gnmlayer.cpp:348
virtual int CloseDependentDatasets()
Drop references to any other datasets referenced by this dataset.
Definition: gdaldataset.cpp:3413
virtual GIntBig GetFeatureCount(int bForce=TRUE) CPL_OVERRIDE
Fetch the feature count in this layer.
Definition: gnmresultlayer.cpp:88
virtual void ResetReading() CPL_OVERRIDE
Reset feature reading to start on the first feature.
Definition: gnmlayer.cpp:209
virtual OGRFeature * GetFeature(GIntBig nFID) CPL_OVERRIDE
Fetch a feature by its identifier.
Definition: gnmresultlayer.cpp:78
virtual OGRErr SetNextByIndex(GIntBig nIndex) CPL_OVERRIDE
Move read cursor to the nIndex'th feature in the current resultset.
Definition: gnmresultlayer.cpp:73
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.
OGRErr Identity(OGRLayer *pLayerMethod, OGRLayer *pLayerResult, char **papszOptions=NULL, GDALProgressFunc pfnProgress=NULL, void *pProgressArg=NULL)
Identity.
Definition: gnmlayer.cpp:93
virtual OGRStyleTable * GetStyleTable() CPL_OVERRIDE
Returns layer style table.
Definition: gnmlayer.cpp:333
Point class.
Definition: ogr_geometry.h:322
int AttributeFilterEvaluationNeedsGeometry()
AttributeFilterEvaluationNeedsGeometry.
Definition: gnmlayer.cpp:130
virtual OGRSpatialReference * GetSpatialRef() CPL_OVERRIDE
Fetch the spatial reference system for this layer.
Definition: gnmlayer.cpp:270
virtual OGRSpatialReference * GetSpatialRef() CPL_OVERRIDE
Fetch the spatial reference system for this layer.
Definition: gnmresultlayer.cpp:119
virtual OGRFeature * GetNextFeature() CPL_OVERRIDE
Fetch the next available feature from this layer.
Definition: gnmresultlayer.cpp:68
virtual OGRErr CreateField(OGRFieldDefn *poField, int bApproxOK=TRUE) CPL_OVERRIDE
Create a new field on a layer.
Definition: gnmresultlayer.cpp:98
This class represents a layer of simple features, with access methods.
Definition: ogrsf_frmts.h:68
OGRErr Intersection(OGRLayer *pLayerMethod, OGRLayer *pLayerResult, char **papszOptions=NULL, GDALProgressFunc pfnProgress=NULL, void *pProgressArg=NULL)
Intersection.
Definition: gnmlayer.cpp:67
GNMGenericLayer(OGRLayer *poLayer, GNMGenericNetwork *poNetwork)
GNMGenericLayer.
Definition: gnmlayer.cpp:38
virtual int GetVersion() const
GetVersion return the network version if applicable.
Definition: gnm.h:129
virtual OGRErr InsertFeature(OGRFeature *poFeature, const CPLString &soLayerName, int nPathNo, bool bIsEdge)
Undocumented.
Definition: gnmresultlayer.cpp:125
virtual void SetStyleTable(OGRStyleTable *poStyleTable) CPL_OVERRIDE
Set layer style table.
Definition: gnmlayer.cpp:343
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
virtual OGRErr SetNextByIndex(GIntBig nIndex) CPL_OVERRIDE
Move read cursor to the nIndex'th feature in the current resultset.
Definition: gnmlayer.cpp:225
int OGRErr
Simple container for a bounding region.
Definition: ogr_core.h:285
virtual void SetSpatialFilterRect(double dfMinX, double dfMinY, double dfMaxX, double dfMaxY) CPL_OVERRIDE
Set a new rectangular spatial filter.
Definition: gnmlayer.cpp:186
The OGRGNMWrappedResultLayer class for search paths queries results.
Definition: gnm.h:699
virtual int TestCapability(const char *pszCap) CPL_OVERRIDE
Test if this layer supported the named capability.
Definition: gnmresultlayer.cpp:93
virtual const char * GetFIDColumn() CPL_OVERRIDE
This method returns the name of the underlying database column being used as the FID column...
Definition: gnmresultlayer.cpp:109
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