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;
197 const char *pszNewName,
198 char **papszOptions = NULL );
205 virtual CPLErr
Create(
const char* pszFilename,
char** papszOptions ) = 0;
213 virtual GNMGFID GetNewGlobalFID();
221 virtual CPLString GetAlgorithmName(GNMDirection eAlgorithm,
bool bShortName);
230 virtual CPLErr AddFeatureGlobalFID(GNMGFID nFID,
const char* pszLayerName);
245 virtual CPLErr ConnectFeatures (GNMGFID nSrcFID,
247 GNMGFID nConFID = -1,
249 double dfInvCost = 1,
250 GNMDirection eDir = GNM_EDGE_DIR_BOTH);
259 virtual CPLErr DisconnectFeatures (GNMGFID nSrcFID,
269 virtual CPLErr DisconnectFeaturesWithId(GNMGFID nFID);
283 virtual CPLErr ReconnectFeatures (GNMGFID nSrcFID,
287 double dfInvCost = 1,
288 GNMDirection eDir = GNM_EDGE_DIR_BOTH);
328 virtual CPLErr CreateRule (
const char *pszRuleStr);
334 virtual CPLErr DeleteAllRules();
341 virtual CPLErr DeleteRule(
const char *pszRuleStr);
347 virtual char** GetRules()
const;
370 virtual CPLErr ConnectPointsByLines (
char **papszLayerList,
382 virtual CPLErr ChangeBlockState (GNMGFID nFID,
bool bIsBlock);
392 virtual CPLErr ChangeAllBlockState (
bool bIsBlock =
false);
395 GNMGraphAlgorithmType eAlgorithm,
char** papszOptions);
403 virtual CPLErr CheckLayerDriver(
const char* pszDefaultDriverName,
404 char** papszOptions);
410 virtual bool CheckStorageDriverSupport(
const char* pszDriverName) = 0;
412 virtual CPLErr CreateMetadataLayer(
GDALDataset*
const pDS,
int nVersion,
413 size_t nFieldSize = 1024 );
414 virtual CPLErr StoreNetworkSrs();
415 virtual CPLErr LoadNetworkSrs();
416 virtual CPLErr CreateGraphLayer(
GDALDataset*
const pDS );
417 virtual CPLErr CreateFeaturesLayer(
GDALDataset*
const pDS );
418 virtual CPLErr LoadMetadataLayer(
GDALDataset*
const pDS );
419 virtual CPLErr LoadGraphLayer(
GDALDataset*
const pDS );
420 virtual CPLErr LoadGraph();
421 virtual CPLErr LoadFeaturesLayer(
GDALDataset*
const pDS );
422 virtual CPLErr DeleteMetadataLayer() = 0;
423 virtual CPLErr DeleteGraphLayer() = 0;
424 virtual CPLErr DeleteFeaturesLayer() = 0;
425 virtual CPLErr LoadNetworkLayer(
const char* pszLayername) = 0;
426 virtual CPLErr DeleteNetworkLayers() = 0;
427 virtual void ConnectPointsByMultiline(GIntBig nFID,
429 const std::vector<OGRLayer *> &paPointLayers,
430 double dfTolerance,
double dfCost,
431 double dfInvCost, GNMDirection eDir);
432 virtual void ConnectPointsByLine(GIntBig nFID,
434 const std::vector<OGRLayer *> &paPointLayers,
435 double dfTolerance,
double dfCost,
436 double dfInvCost, GNMDirection eDir);
437 virtual GNMGFID FindNearestPoint(
const OGRPoint* poPoint,
438 const std::vector<OGRLayer*>& paPointLayers,
440 virtual OGRFeature* FindConnection(GNMGFID nSrcFID, GNMGFID nTgtFID,
442 virtual void SaveRules();
443 virtual GNMGFID GetNewVirtualFID();
445 const GNMPATH &path,
int nNoOfPath,
446 bool bReturnVertices,
bool bReturnEdges);
450 GNMGFID m_nVirtualConnectionGID;
457 std::map<GNMGFID, CPLString> m_moFeatureFIDMap;
458 std::vector<OGRLayer*> m_apoLayers;
459 std::vector<GNMRule> m_asRules;
460 bool m_bIsRulesChanged;
463 bool m_bIsGraphLoaded;
483 virtual void SetSpatialFilterRect(
double dfMinX,
double dfMinY,
484 double dfMaxX,
double dfMaxY );
486 virtual void SetSpatialFilter(
int iGeomField,
OGRGeometry * );
487 virtual void SetSpatialFilterRect(
int iGeomField,
488 double dfMinX,
double dfMinY,
489 double dfMaxX,
double dfMaxY );
491 virtual OGRErr SetAttributeFilter(
const char * );
493 virtual void ResetReading();
495 virtual OGRErr SetNextByIndex( GIntBig nIndex );
497 virtual OGRErr DeleteFeature( GIntBig nFID );
499 virtual const char *GetName();
502 virtual int FindFieldIndex(
const char *pszFieldName,
int bExactMatch );
506 virtual GIntBig GetFeatureCount(
int bForce = TRUE );
507 virtual OGRErr GetExtent(
OGREnvelope *psExtent,
int bForce = TRUE);
508 virtual OGRErr GetExtent(
int iGeomField,
OGREnvelope *psExtent,
511 virtual int TestCapability(
const char * );
514 int bApproxOK = TRUE );
515 virtual OGRErr DeleteField(
int iField );
516 virtual OGRErr ReorderFields(
int* panMap );
517 virtual OGRErr AlterFieldDefn(
int iField,
OGRFieldDefn* poNewFieldDefn,
521 int bApproxOK = TRUE );
523 virtual OGRErr SyncToDisk();
526 virtual void SetStyleTableDirectly(
OGRStyleTable *poStyleTable );
530 virtual OGRErr StartTransaction();
531 virtual OGRErr CommitTransaction();
532 virtual OGRErr RollbackTransaction();
534 virtual const char *GetFIDColumn();
535 virtual const char *GetGeometryColumn();
537 virtual OGRErr SetIgnoredFields(
const char **papszFields );
539 OGRErr Intersection(
OGRLayer *pLayerMethod,
541 char** papszOptions = NULL,
542 GDALProgressFunc pfnProgress = NULL,
543 void * pProgressArg = NULL );
544 OGRErr Union(
OGRLayer *pLayerMethod,
546 char** papszOptions = NULL,
547 GDALProgressFunc pfnProgress = NULL,
548 void * pProgressArg = NULL );
549 OGRErr SymDifference(
OGRLayer *pLayerMethod,
552 GDALProgressFunc pfnProgress,
553 void * pProgressArg );
554 OGRErr Identity(
OGRLayer *pLayerMethod,
556 char** papszOptions = NULL,
557 GDALProgressFunc pfnProgress = NULL,
558 void * pProgressArg = NULL );
559 OGRErr Update(
OGRLayer *pLayerMethod,
561 char** papszOptions = NULL,
562 GDALProgressFunc pfnProgress = NULL,
563 void * pProgressArg = NULL );
564 OGRErr Clip(
OGRLayer *pLayerMethod,
566 char** papszOptions = NULL,
567 GDALProgressFunc pfnProgress = NULL,
568 void * pProgressArg = NULL );
569 OGRErr Erase(
OGRLayer *pLayerMethod,
571 char** papszOptions = NULL,
572 GDALProgressFunc pfnProgress = NULL,
573 void * pProgressArg = NULL );
575 GIntBig GetFeaturesRead();
577 int AttributeFilterEvaluationNeedsGeometry();
580 OGRErr InitializeIndexSupport(
const char * );
584 virtual OGRErr ISetFeature(
OGRFeature *poFeature );
585 virtual OGRErr ICreateFeature(
OGRFeature *poFeature );
591 std::map<GNMGFID, GIntBig> m_mnFIDMap;
612 GNMRule(
const std::string &oRule );
620 virtual bool IsValid()
const;
625 virtual bool IsAcceptAny()
const;
631 virtual GNMRuleType GetType()
const;
640 virtual bool CanConnect(
const CPLString &soSrcLayerName,
643 virtual CPLString GetSourceLayerName()
const;
644 virtual CPLString GetTargetLayerName()
const;
645 virtual CPLString GetConnectorLayerName()
const;
646 const char* c_str()
const;
647 operator const char* (void)
const;
649 virtual bool ParseRuleString();
673 virtual void ResetReading();
675 virtual OGRErr SetNextByIndex( GIntBig nIndex );
676 virtual OGRFeature *GetFeature( GIntBig nFID );
678 virtual GIntBig GetFeatureCount(
int bForce = TRUE );
679 virtual int TestCapability(
const char * pszCap );
680 virtual OGRErr CreateField(
OGRFieldDefn *poField,
int bApproxOK = TRUE );
682 int bApproxOK = TRUE );
683 virtual const char *GetFIDColumn();
684 virtual const char *GetGeometryColumn();
688 virtual OGRErr InsertFeature(
OGRFeature* poFeature,
689 const CPLString &soLayerName,
int nPathNo,
692 virtual OGRErr ISetFeature(
OGRFeature *poFeature );
693 virtual OGRErr ICreateFeature(
OGRFeature *poFeature );
GNM layer which represents a geography network layer of generic format.
Definition: gnm.h:473
virtual void FlushCache(void)
Flush all write cached data to disk.
Definition: gdaldataset.cpp:382
Concrete representation of a multi-vertex line.
Definition: ogr_geometry.h:527
Definition of a geometry field of an OGRFeatureDefn.
Definition: ogr_feature.h:143
virtual const char * GetProjectionRef(void)
Fetch the projection definition string for this dataset.
Definition: gdaldataset.cpp:811
GNM class which represents a geography network of generic format.
Definition: gnm.h:182
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:283
Definition of a feature class or feature layer.
Definition: ogr_feature.h:206
virtual CPLErr Delete()=0
Delete network.
virtual OGRLayer * GetLayer(int)
Fetch a layer by index.
Definition: gdaldataset.cpp:5820
virtual OGRErr DeleteLayer(int)
Delete the indicated layer from the datasource.
Definition: gdaldataset.cpp:4377
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:4022
OGRwkbGeometryType
List of well known binary geometry types.
Definition: ogr_core.h:333
A collection of OGRLineString.
Definition: ogr_geometry.h:1292
The simple graph class, which holds the appropriate for calculations graph in memory (based on STL co...
Definition: gnmgraph.h:74
Abstract base class for all geometry classes.
Definition: ogr_geometry.h:104
Classes related to registration of format support, and opening datasets.
Definition: gdal_priv.h:238
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:3288
virtual int GetVersion() const
GetVersion return the network version if applicable.
Definition: gnm.h:129
virtual char ** GetFileList(void)
Fetch files forming dataset.
Definition: gdaldataset.cpp:2311
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:129
virtual CPLErr Create(const char *pszFilename, char **papszOptions)=0
Create network system layers.
The simple class for rules.
Definition: gnm.h:608
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:264
Simple container for a bounding region.
Definition: ogr_core.h:48
This class represents a layer of simple features, with access methods.
Definition: ogrsf_frmts.h:66
A simple feature, including geometry and attributes.
Definition: ogr_feature.h:274
This class represents a style table.
Definition: ogr_featurestyle.h:82
virtual CPLErr DisconnectAll()=0
DisconnectAll method clears the network graph.
A set of associated raster bands, usually from one file.
Definition: gdal_priv.h:296
virtual int GetLayerCount()
Get the number of layers in this dataset.
Definition: gdaldataset.cpp:5795
Definition: ogr_attrind.h:66
The OGRGNMWrappedResultLayer class for search paths queries results.
Definition: gnm.h:666
virtual int TestCapability(const char *)
Test if capability is available.
Definition: gdaldataset.cpp:5859
Format specific driver.
Definition: gdal_priv.h:1036