GDAL

gnm.h
1 /******************************************************************************
2 * $Id$
3 *
4 * Project: GDAL/OGR Geography Network support (Geographic Network Model)
5 * Purpose: GNM general public declarations.
6 * Authors: Mikhail Gusev (gusevmihs at gmail dot com)
7 * Dmitry Baryshnikov, polimax@mail.ru
8 *
9 ******************************************************************************
10 * Copyright (c) 2014, Mikhail Gusev
11 * Copyright (c) 2014-2015, NextGIS <info@nextgis.com>
12 *
13 * Permission is hereby granted, free of charge, to any person obtaining a
14 * copy of this software and associated documentation files (the "Software"),
15 * to deal in the Software without restriction, including without limitation
16 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 * and/or sell copies of the Software, and to permit persons to whom the
18 * Software is furnished to do so, subject to the following conditions:
19 *
20 * The above copyright notice and this permission notice shall be included
21 * in all copies or substantial portions of the Software.
22 *
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 * DEALINGS IN THE SOFTWARE.
30 ****************************************************************************/
31
32 #ifndef GNM
33 #define GNM
34
35 #if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
36 #include "ogrsf_frmts.h"
37 #endif
38 #include "gnmgraph.h"
39
40 // Direction of an edge.
41 typedef int GNMDirection; // We use int values in order to save them to the
42 // network data.
43
44 // Network's metadata parameters names.
45 #define GNM_MD_NAME "net_name"
46 #define GNM_MD_DESCR "net_description"
47 #define GNM_MD_SRS "net_srs"
48 #define GNM_MD_VERSION "net_version"
49 #define GNM_MD_RULE "net_rule"
50 #define GNM_MD_FORMAT "FORMAT"
51 #define GNM_MD_FETCHEDGES "fetch_edge"
52 #define GNM_MD_FETCHVERTEX "fetch_vertex"
53 #define GNM_MD_NUM_PATHS "num_paths"
54 #define GNM_MD_EMITTER "emitter"
55
56 // TODO: Constants for capabilities.
57 //#define GNMCanChangeConnections "CanChangeConnections"
58
59 typedef enum
60 { GATDijkstraShortestPath = 1, GATKShortestPath, GATConnectedComponents
64 } GNMGraphAlgorithmType;
65
66 #if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
67
74 class CPL_DLL GNMNetwork : public GDALDataset
75 {
76 public:
77 GNMNetwork();
78 virtual ~GNMNetwork();
79
80 // GDALDataset Interface
81 const OGRSpatialReference* GetSpatialRef() const override;
82 virtual char **GetFileList(void) override;
83
84 // GNMNetwork Interface
85
106 virtual CPLErr Create( const char* pszFilename, char** papszOptions ) = 0;
107
113 virtual CPLErr Open( GDALOpenInfo* poOpenInfo ) = 0;
114
119 virtual CPLErr Delete() = 0;
120
127 virtual const char* GetName() const;
128
133 virtual int GetVersion() const { return 0;}
134
139 virtual CPLErr DisconnectAll () = 0;
140
148 virtual OGRFeature *GetFeatureByGlobalFID (GNMGFID nGFID) = 0;
149
160 virtual OGRLayer *GetPath (GNMGFID nStartFID, GNMGFID nEndFID,
161 GNMGraphAlgorithmType eAlgorithm, char** papszOptions) = 0;
162 protected:
169 virtual int CheckNetworkExist( const char* pszFilename,
170 char** papszOptions ) = 0;
171
172 protected:
174 CPLString m_soName;
175 OGRSpatialReference m_oSRS{};
177 };
178
179 class GNMRule;
180 class OGRGNMWrappedResultLayer;
181
188 class CPL_DLL GNMGenericNetwork: public GNMNetwork
189 {
190 public:
191 GNMGenericNetwork();
192 virtual ~GNMGenericNetwork();
193
194 // GDALDataset Interface
195
196 virtual int GetLayerCount() override;
197 virtual OGRLayer *GetLayer(int) override;
198 virtual OGRErr DeleteLayer(int) override;
199
200 virtual int TestCapability( const char * ) override;
201
202 virtual OGRLayer *CopyLayer( OGRLayer *poSrcLayer,
203 const char *pszNewName,
204 char **papszOptions = nullptr ) override;
205
206 virtual int CloseDependentDatasets() override;
207 virtual void FlushCache(bool bAtClosing) override;
208
209 // GNMNetwork Interface
210
211 virtual CPLErr Create( const char* pszFilename, char** papszOptions ) override = 0;
212 virtual CPLErr Delete() override;
213
214 virtual int GetVersion() const override;
219 virtual GNMGFID GetNewGlobalFID();
220
227 virtual CPLString GetAlgorithmName(GNMDirection eAlgorithm, bool bShortName);
228
236 virtual CPLErr AddFeatureGlobalFID(GNMGFID nFID, const char* pszLayerName);
237
251 virtual CPLErr ConnectFeatures (GNMGFID nSrcFID,
252 GNMGFID nTgtFID,
253 GNMGFID nConFID = -1,
254 double dfCost = 1,
255 double dfInvCost = 1,
256 GNMDirection eDir = GNM_EDGE_DIR_BOTH);
257
265 virtual CPLErr DisconnectFeatures (GNMGFID nSrcFID,
266 GNMGFID nTgtFID,
267 GNMGFID nConFID);
268
275 virtual CPLErr DisconnectFeaturesWithId(GNMGFID nFID);
276
289 virtual CPLErr ReconnectFeatures (GNMGFID nSrcFID,
290 GNMGFID nTgtFID,
291 GNMGFID nConFID,
292 double dfCost = 1,
293 double dfInvCost = 1,
294 GNMDirection eDir = GNM_EDGE_DIR_BOTH);
295
296 virtual CPLErr DisconnectAll() override;
297
298 virtual OGRFeature *GetFeatureByGlobalFID(GNMGFID nFID) override;
299
334 virtual CPLErr CreateRule (const char *pszRuleStr);
335
340 virtual CPLErr DeleteAllRules();
341
347 virtual CPLErr DeleteRule(const char *pszRuleStr);
348
353 virtual char** GetRules() const;
354
379 virtual CPLErr ConnectPointsByLines (char **papszLayerList,
380 double dfTolerance,
381 double dfCost,
382 double dfInvCost,
383 GNMDirection eDir);
384
391 virtual CPLErr ChangeBlockState (GNMGFID nFID, bool bIsBlock);
392
401 virtual CPLErr ChangeAllBlockState (bool bIsBlock = false);
402
403 virtual OGRLayer *GetPath (GNMGFID nStartFID, GNMGFID nEndFID,
404 GNMGraphAlgorithmType eAlgorithm, char** papszOptions) override;
405 protected:
412 virtual CPLErr CheckLayerDriver(const char* pszDefaultDriverName,
413 char** papszOptions);
419 virtual bool CheckStorageDriverSupport(const char* pszDriverName) = 0;
420 protected:
422 virtual CPLErr CreateMetadataLayer( GDALDataset* const pDS, int nVersion,
423 size_t nFieldSize = 1024 );
424 virtual CPLErr StoreNetworkSrs();
425 virtual CPLErr LoadNetworkSrs();
426 virtual CPLErr CreateGraphLayer( GDALDataset* const pDS );
427 virtual CPLErr CreateFeaturesLayer( GDALDataset* const pDS );
428 virtual CPLErr LoadMetadataLayer( GDALDataset* const pDS );
429 virtual CPLErr LoadGraphLayer( GDALDataset* const pDS );
430 virtual CPLErr LoadGraph();
431 virtual CPLErr LoadFeaturesLayer( GDALDataset* const pDS );
432 virtual CPLErr DeleteMetadataLayer() = 0;
433 virtual CPLErr DeleteGraphLayer() = 0;
434 virtual CPLErr DeleteFeaturesLayer() = 0;
435 virtual CPLErr LoadNetworkLayer(const char* pszLayername) = 0;
436 virtual CPLErr DeleteNetworkLayers() = 0;
437 virtual void ConnectPointsByMultiline(GIntBig nFID,
438 const OGRMultiLineString *poMultiLineString,
439 const std::vector<OGRLayer *> &paPointLayers,
440 double dfTolerance, double dfCost,
441 double dfInvCost, GNMDirection eDir);
442 virtual void ConnectPointsByLine(GIntBig nFID,
443 const OGRLineString *poLineString,
444 const std::vector<OGRLayer *> &paPointLayers,
445 double dfTolerance, double dfCost,
446 double dfInvCost, GNMDirection eDir);
447 virtual GNMGFID FindNearestPoint(const OGRPoint* poPoint,
448 const std::vector<OGRLayer*>& paPointLayers,
449 double dfTolerance);
450 virtual OGRFeature* FindConnection(GNMGFID nSrcFID, GNMGFID nTgtFID,
451 GNMGFID nConFID);
452 virtual void SaveRules();
453 virtual GNMGFID GetNewVirtualFID();
454 virtual void FillResultLayer(OGRGNMWrappedResultLayer* poResLayer,
455 const GNMPATH &path, int nNoOfPath,
456 bool bReturnVertices, bool bReturnEdges);
458 protected:
460 int m_nVersion;
461 GNMGFID m_nGID;
462 GNMGFID m_nVirtualConnectionGID;
463 OGRLayer* m_poMetadataLayer;
464 OGRLayer* m_poGraphLayer;
465 OGRLayer* m_poFeaturesLayer;
466
467 GDALDriver *m_poLayerDriver;
468
469 std::map<GNMGFID, CPLString> m_moFeatureFIDMap;
470 std::vector<OGRLayer*> m_apoLayers;
471 std::vector<GNMRule> m_asRules;
472 bool m_bIsRulesChanged;
473
474 GNMGraph m_oGraph;
475 bool m_bIsGraphLoaded;
477 };
478
486 class GNMGenericLayer : public OGRLayer
487 {
488 public:
489 GNMGenericLayer(OGRLayer* poLayer, GNMGenericNetwork* poNetwork);
490 virtual ~GNMGenericLayer();
491
492 // OGRLayer Interface
493
494 virtual OGRGeometry *GetSpatialFilter() override;
495 virtual void SetSpatialFilter( OGRGeometry * ) override;
496 virtual void SetSpatialFilterRect( double dfMinX, double dfMinY,
497 double dfMaxX, double dfMaxY ) override;
498
499 virtual void SetSpatialFilter( int iGeomField, OGRGeometry * ) override;
500 virtual void SetSpatialFilterRect( int iGeomField,
501 double dfMinX, double dfMinY,
502 double dfMaxX, double dfMaxY ) override;
503
504 virtual OGRErr SetAttributeFilter( const char * ) override;
505
506 virtual void ResetReading() override;
507 virtual OGRFeature *GetNextFeature() override;
508 virtual OGRErr SetNextByIndex( GIntBig nIndex ) override;
509
510 virtual OGRErr DeleteFeature( GIntBig nFID ) override;
511
512 virtual const char *GetName() override;
513 virtual OGRwkbGeometryType GetGeomType() override;
514 virtual OGRFeatureDefn *GetLayerDefn() override;
515 virtual int FindFieldIndex( const char *pszFieldName, int bExactMatch ) override;
516
517 virtual OGRSpatialReference *GetSpatialRef() override;
518
519 virtual GIntBig GetFeatureCount( int bForce = TRUE ) override;
520 virtual OGRErr GetExtent(OGREnvelope *psExtent, int bForce = TRUE) override;
521 virtual OGRErr GetExtent(int iGeomField, OGREnvelope *psExtent,
522 int bForce = TRUE) override;
523
524 virtual int TestCapability( const char * ) override;
525
526 virtual OGRErr CreateField( OGRFieldDefn *poField,
527 int bApproxOK = TRUE ) override;
528 virtual OGRErr DeleteField( int iField ) override;
529 virtual OGRErr ReorderFields( int* panMap ) override;
530 virtual OGRErr AlterFieldDefn( int iField, OGRFieldDefn* poNewFieldDefn,
531 int nFlagsIn ) override;
532
533 virtual OGRErr CreateGeomField( OGRGeomFieldDefn *poField,
534 int bApproxOK = TRUE ) override;
535
536 virtual OGRErr SyncToDisk() override;
537
538 virtual OGRStyleTable *GetStyleTable() override;
539 virtual void SetStyleTableDirectly( OGRStyleTable *poStyleTable ) override;
540
541 virtual void SetStyleTable(OGRStyleTable *poStyleTable) override;
542
543 virtual OGRErr StartTransaction() override;
544 virtual OGRErr CommitTransaction() override;
545 virtual OGRErr RollbackTransaction() override;
546
547 virtual const char *GetFIDColumn() override;
548 virtual const char *GetGeometryColumn() override;
549
550 virtual OGRErr SetIgnoredFields( const char **papszFields ) override;
551
553 OGRErr Intersection( OGRLayer *pLayerMethod,
554 OGRLayer *pLayerResult,
555 char** papszOptions = nullptr,
556 GDALProgressFunc pfnProgress = nullptr,
557 void * pProgressArg = nullptr );
559 OGRErr Union( OGRLayer *pLayerMethod,
560 OGRLayer *pLayerResult,
561 char** papszOptions = nullptr,
562 GDALProgressFunc pfnProgress = nullptr,
563 void * pProgressArg = nullptr );
565 OGRErr SymDifference( OGRLayer *pLayerMethod,
566 OGRLayer *pLayerResult,
567 char** papszOptions,
568 GDALProgressFunc pfnProgress,
569 void * pProgressArg );
571 OGRErr Identity( OGRLayer *pLayerMethod,
572 OGRLayer *pLayerResult,
573 char** papszOptions = nullptr,
574 GDALProgressFunc pfnProgress = nullptr,
575 void * pProgressArg = nullptr );
577 OGRErr Update( OGRLayer *pLayerMethod,
578 OGRLayer *pLayerResult,
579 char** papszOptions = nullptr,
580 GDALProgressFunc pfnProgress = nullptr,
581 void * pProgressArg = nullptr );
583 OGRErr Clip( OGRLayer *pLayerMethod,
584 OGRLayer *pLayerResult,
585 char** papszOptions = nullptr,
586 GDALProgressFunc pfnProgress = nullptr,
587 void * pProgressArg = nullptr );
589 OGRErr Erase( OGRLayer *pLayerMethod,
590 OGRLayer *pLayerResult,
591 char** papszOptions = nullptr,
592 GDALProgressFunc pfnProgress = nullptr,
593 void * pProgressArg = nullptr );
594
596 GIntBig GetFeaturesRead();
597
599 int AttributeFilterEvaluationNeedsGeometry();
600
602 /* consider these private */
603 OGRErr InitializeIndexSupport( const char * );
604 OGRLayerAttrIndex *GetIndex();
606
607 protected:
609 virtual OGRErr ISetFeature( OGRFeature *poFeature ) override;
610 virtual OGRErr ICreateFeature( OGRFeature *poFeature ) override;
611
612 protected:
613 CPLString m_soLayerName;
614 OGRLayer *m_poLayer;
615 GNMGenericNetwork* m_poNetwork;
616 std::map<GNMGFID, GIntBig> m_mnFIDMap;
618 };
619
620 typedef enum
621 { GRTConnection = 0
623 } GNMRuleType;
624
634 class CPL_DLL GNMRule
635 {
636 // to hopefully please Coverity Scan which complains about missing
637 // move assignment operator for performance reasons
638 GNMRule& operator==(GNMRule&&) = delete;
639
640 public:
642 GNMRule();
644 explicit GNMRule(const std::string &oRule );
646 explicit GNMRule(const char* pszRule);
648 GNMRule(const GNMRule &oRule);
649
651 GNMRule& operator=(const GNMRule&) = default;
652
653 virtual ~GNMRule();
658 virtual bool IsValid() const;
663 virtual bool IsAcceptAny() const;
669 virtual GNMRuleType GetType() const;
678 virtual bool CanConnect(const CPLString &soSrcLayerName,
679 const CPLString &soTgtLayerName,
680 const CPLString &soConnLayerName = "");
682 virtual CPLString GetSourceLayerName() const;
684 virtual CPLString GetTargetLayerName() const;
686 virtual CPLString GetConnectorLayerName() const;
688 const char* c_str() const;
690 operator const char* (void) const;
691 protected:
693 virtual bool ParseRuleString();
694 protected:
695 CPLString m_soSrcLayerName;
696 CPLString m_soTgtLayerName;
697 CPLString m_soConnLayerName;
698 bool m_bAllow = false;
699 bool m_bValid = false;
700 bool m_bAny = false;
701 CPLString m_soRuleString;
703 };
704
711 class OGRGNMWrappedResultLayer : public OGRLayer
712 {
713 public:
714 OGRGNMWrappedResultLayer(GDALDataset* poDS, OGRLayer* poLayer);
715 ~OGRGNMWrappedResultLayer();
716
717 // OGRLayer
718 virtual void ResetReading() override;
719 virtual OGRFeature *GetNextFeature() override;
720 virtual OGRErr SetNextByIndex( GIntBig nIndex ) override;
721 virtual OGRFeature *GetFeature( GIntBig nFID ) override;
722 virtual OGRFeatureDefn *GetLayerDefn() override;
723 virtual GIntBig GetFeatureCount( int bForce = TRUE ) override;
724 virtual int TestCapability( const char * pszCap ) override;
725 virtual OGRErr CreateField( OGRFieldDefn *poField, int bApproxOK = TRUE ) override;
726 virtual OGRErr CreateGeomField( OGRGeomFieldDefn *poField,
727 int bApproxOK = TRUE ) override;
728 virtual const char *GetFIDColumn() override;
729 virtual const char *GetGeometryColumn() override;
730 virtual OGRSpatialReference *GetSpatialRef() override;
731
732 // OGRGNMWrappedResultLayer
733 virtual OGRErr InsertFeature(OGRFeature* poFeature,
734 const CPLString &soLayerName, int nPathNo,
735 bool bIsEdge);
736 protected:
737 virtual OGRErr ISetFeature( OGRFeature *poFeature ) override;
738 virtual OGRErr ICreateFeature( OGRFeature *poFeature ) override;
739 protected:
741 GDALDataset *poDS;
742 OGRLayer *poLayer;
744 };
745
746 #endif // __cplusplus
747
748 #endif // GNM
OGRGNMWrappedResultLayer
The OGRGNMWrappedResultLayer class for search paths queries results.
Definition: gnm.h:711
GNMNetwork::Create
virtual CPLErr Create(const char *pszFilename, char **papszOptions)=0
Create network system layers.
OGRLineString
Concrete representation of a multi-vertex line.
Definition: ogr_geometry.h:1467
GNMGenericLayer::SetIgnoredFields
virtual OGRErr SetIgnoredFields(const char **papszFields) override
Set which fields can be omitted when retrieving features from the layer.
Definition: gnmlayer.cpp:61
GNMGenericLayer::GetStyleTable
virtual OGRStyleTable * GetStyleTable() override
Returns layer style table.
Definition: gnmlayer.cpp:332
GDALOpenInfo
Class for dataset open functions.
Definition: gdal_priv.h:271
GNMGenericLayer::ResetReading
virtual void ResetReading() override
Reset feature reading to start on the first feature.
Definition: gnmlayer.cpp:208
OGRLayer::ICreateFeature
virtual OGRErr ICreateFeature(OGRFeature *poFeature)
Create and write a new feature within a layer.
Definition: ogrlayer.cpp:647
GNMGenericLayer::GetGeomType
virtual OGRwkbGeometryType GetGeomType() override
Return the layer geometry type.
Definition: gnmlayer.cpp:259
GNMGenericLayer::GetFIDColumn
virtual const char * GetFIDColumn() override
This method returns the name of the underlying database column being used as the FID column,...
Definition: gnmlayer.cpp:51
OGRGNMWrappedResultLayer::ResetReading
virtual void ResetReading() override
Reset feature reading to start on the first feature.
Definition: gnmresultlayer.cpp:62
GNMGenericLayer::GetNextFeature
virtual OGRFeature * GetNextFeature() override
Fetch the next available feature from this layer.
Definition: gnmlayer.cpp:213
OGRStyleTable
This class represents a style table.
Definition: ogr_featurestyle.h:84
GNMGenericLayer::CreateField
virtual OGRErr CreateField(OGRFieldDefn *poField, int bApproxOK=TRUE) override
Create a new field on a layer.
Definition: gnmlayer.cpp:294
OGRGNMWrappedResultLayer::GetSpatialRef
virtual OGRSpatialReference * GetSpatialRef() override
Fetch the spatial reference system for this layer.
Definition: gnmresultlayer.cpp:118
GNMGenericLayer::SetStyleTable
virtual void SetStyleTable(OGRStyleTable *poStyleTable) override
Set layer style table.
Definition: gnmlayer.cpp:342
GNMGraph
The simple graph class, which holds the appropriate for calculations graph in memory (based on STL co...
Definition: gnmgraph.h:89
GNMNetwork::DisconnectAll
virtual CPLErr DisconnectAll()=0
DisconnectAll method clears the network graph.
GDALDriver
Format specific driver.
Definition: gdal_priv.h:1558
OGRGNMWrappedResultLayer::GetFeatureCount
virtual GIntBig GetFeatureCount(int bForce=TRUE) override
Fetch the feature count in this layer.
Definition: gnmresultlayer.cpp:87
OGRSpatialReference
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:157
GNMGenericLayer
GNM layer which represents a geography network layer of generic format.
Definition: gnm.h:486
GNMGenericLayer::SetSpatialFilterRect
virtual void SetSpatialFilterRect(double dfMinX, double dfMinY, double dfMaxX, double dfMaxY) override
Set a new rectangular spatial filter.
Definition: gnmlayer.cpp:185
GDALDataset::GetLayer
virtual OGRLayer * GetLayer(int iLayer)
Fetch a layer by index.
Definition: gdaldataset.cpp:6857
GNMGenericLayer::DeleteField
virtual OGRErr DeleteField(int iField) override
Delete an existing field on a layer.
Definition: gnmlayer.cpp:299
GNMGenericLayer::TestCapability
virtual int TestCapability(const char *) override
Test if this layer supported the named capability.
Definition: gnmlayer.cpp:289
GNMGenericLayer::GetExtent
virtual OGRErr GetExtent(OGREnvelope *psExtent, int bForce=TRUE) override
Fetch the extent of this layer.
Definition: gnmlayer.cpp:279
OGRGeometry
Abstract base class for all geometry classes.
Definition: ogr_geometry.h:326
GNMGenericLayer::SymDifference
OGRErr SymDifference(OGRLayer *pLayerMethod, OGRLayer *pLayerResult, char **papszOptions, GDALProgressFunc pfnProgress, void *pProgressArg)
SymDifference.
Definition: gnmlayer.cpp:84
OGRLayer
This class represents a layer of simple features, with access methods.
Definition: ogrsf_frmts.h:72
CPLString
Convenient string class based on std::string.
Definition: cpl_string.h:320
GNMGenericLayer::GetFeatureCount
virtual GIntBig GetFeatureCount(int bForce=TRUE) override
Fetch the feature count in this layer.
Definition: gnmlayer.cpp:274
GNMGenericLayer::SetSpatialFilter
virtual void SetSpatialFilter(OGRGeometry *) override
Set a new spatial filter.
Definition: gnmlayer.cpp:180
OGRPoint
Point class.
Definition: ogr_geometry.h:936
OGRLayer::ISetFeature
virtual OGRErr ISetFeature(OGRFeature *poFeature)
Rewrite an existing feature.
Definition: ogrlayer.cpp:608
GDALDataset::CopyLayer
virtual OGRLayer * CopyLayer(OGRLayer *poSrcLayer, const char *pszNewName, char **papszOptions=nullptr)
Duplicate an existing layer.
Definition: gdaldataset.cpp:4992
GDALDataset
A set of associated raster bands, usually from one file.
Definition: gdal_priv.h:342
GNMGenericLayer::CommitTransaction
virtual OGRErr CommitTransaction() override
For datasources which support transactions, CommitTransaction commits a transaction.
Definition: gnmlayer.cpp:352
GNMNetwork
General GNM class which represents a geography network of common format.
Definition: gnm.h:74
GNMGenericLayer::RollbackTransaction
virtual OGRErr RollbackTransaction() override
For datasources which support transactions, RollbackTransaction will roll back a datasource to its st...
Definition: gnmlayer.cpp:357
GNMGenericLayer::SetStyleTableDirectly
virtual void SetStyleTableDirectly(OGRStyleTable *poStyleTable) override
Set layer style table.
Definition: gnmlayer.cpp:337
GNMNetwork::GetPath
virtual OGRLayer * GetPath(GNMGFID nStartFID, GNMGFID nEndFID, GNMGraphAlgorithmType eAlgorithm, char **papszOptions)=0
Create path between start and end GFIDs.
OGRMultiLineString
A collection of OGRLineString.
Definition: ogr_geometry.h:3188
GNMGenericLayer::SetAttributeFilter
virtual OGRErr SetAttributeFilter(const char *) override
Set a new attribute query.
Definition: gnmlayer.cpp:203
GNMGenericLayer::Erase
OGRErr Erase(OGRLayer *pLayerMethod, OGRLayer *pLayerResult, char **papszOptions=nullptr, GDALProgressFunc pfnProgress=nullptr, void *pProgressArg=nullptr)
Erase.
Definition: gnmlayer.cpp:116
GNMNetwork::GetVersion
virtual int GetVersion() const
GetVersion return the network version if applicable.
Definition: gnm.h:133
GDALDataset::Open
static GDALDataset * Open(const char *pszFilename, unsigned int nOpenFlags=0, const char *const *papszAllowedDrivers=nullptr, const char *const *papszOpenOptions=nullptr, const char *const *papszSiblingFiles=nullptr)
Definition: gdal_priv.h:668
GNMGenericLayer::CreateGeomField
virtual OGRErr CreateGeomField(OGRGeomFieldDefn *poField, int bApproxOK=TRUE) override
Create a new geometry field on a layer.
Definition: gnmlayer.cpp:322
GNMGenericLayer::FindFieldIndex
virtual int FindFieldIndex(const char *pszFieldName, int bExactMatch) override
Find the index of field in the layer.
Definition: gnmlayer.cpp:264
OGRGNMWrappedResultLayer::GetGeometryColumn
virtual const char * GetGeometryColumn() override
This method returns the name of the underlying database column being used as the geometry column,...
Definition: gnmresultlayer.cpp:113
ogrsf_frmts.h
GNMGenericLayer::GetFeaturesRead
GIntBig GetFeaturesRead()
GetFeaturesRead.
Definition: gnmlayer.cpp:124
GNMGenericLayer::SyncToDisk
virtual OGRErr SyncToDisk() override
Flush pending changes to disk.
Definition: gnmlayer.cpp:327
GNMGenericLayer::GNMGenericLayer
GNMGenericLayer(OGRLayer *poLayer, GNMGenericNetwork *poNetwork)
GNMGenericLayer.
Definition: gnmlayer.cpp:37
OGRGNMWrappedResultLayer::GetLayerDefn
virtual OGRFeatureDefn * GetLayerDefn() override
Fetch the schema information for this layer.
Definition: gnmresultlayer.cpp:82
OGRFieldDefn
Definition of an attribute of an OGRFeatureDefn.
Definition: ogr_feature.h:100
OGRGNMWrappedResultLayer::GetFIDColumn
virtual const char * GetFIDColumn() override
This method returns the name of the underlying database column being used as the FID column,...
Definition: gnmresultlayer.cpp:108
OGRGNMWrappedResultLayer::TestCapability
virtual int TestCapability(const char *pszCap) override
Test if this layer supported the named capability.
Definition: gnmresultlayer.cpp:92
GNMGenericLayer::DeleteFeature
virtual OGRErr DeleteFeature(GIntBig nFID) override
Delete feature from layer.
Definition: gnmlayer.cpp:229
GDALDataset::CloseDependentDatasets
virtual int CloseDependentDatasets()
Drop references to any other datasets referenced by this dataset.
Definition: gdaldataset.cpp:4028
OGRGeomFieldDefn
Definition of a geometry field of an OGRFeatureDefn.
Definition: ogr_feature.h:203
OGRGNMWrappedResultLayer::OGRGNMWrappedResultLayer
OGRGNMWrappedResultLayer(GDALDataset *poDS, OGRLayer *poLayer)
Constructor.
Definition: gnmresultlayer.cpp:35
OGRGNMWrappedResultLayer::GetNextFeature
virtual OGRFeature * GetNextFeature() override
Fetch the next available feature from this layer.
Definition: gnmresultlayer.cpp:67
GNMGenericLayer::GetLayerDefn
virtual OGRFeatureDefn * GetLayerDefn() override
Fetch the schema information for this layer.
Definition: gnmlayer.cpp:362
GNMGenericLayer::~GNMGenericLayer
virtual ~GNMGenericLayer()
~GNMGenericLayer
Definition: gnmlayer.cpp:49
OGRGNMWrappedResultLayer::CreateField
virtual OGRErr CreateField(OGRFieldDefn *poField, int bApproxOK=TRUE) override
Create a new field on a layer.
Definition: gnmresultlayer.cpp:97
OGRErr
int OGRErr
Type for a OGR error.
Definition: ogr_core.h:341
GDALDataset::GetSpatialRef
virtual const OGRSpatialReference * GetSpatialRef() const
Fetch the spatial reference for this dataset.
Definition: gdaldataset.cpp:911
GIntBig
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition: cpl_port.h:230
GDALDataset::GetFileList
virtual char ** GetFileList(void)
Fetch files forming dataset.
Definition: gdaldataset.cpp:2907
OGRwkbGeometryType
OGRwkbGeometryType
List of well known binary geometry types.
Definition: ogr_core.h:368
GNMGenericLayer::GetGeometryColumn
virtual const char * GetGeometryColumn() override
This method returns the name of the underlying database column being used as the geometry column,...
Definition: gnmlayer.cpp:56
GNMNetwork::GetFeatureByGlobalFID
virtual OGRFeature * GetFeatureByGlobalFID(GNMGFID nGFID)=0
GetFeatureByGlobalFID search all network layers for given feature identificator.
GNMGenericLayer::Intersection
OGRErr Intersection(OGRLayer *pLayerMethod, OGRLayer *pLayerResult, char **papszOptions=nullptr, GDALProgressFunc pfnProgress=nullptr, void *pProgressArg=nullptr)
Intersection.
Definition: gnmlayer.cpp:66
GNMGenericLayer::SetNextByIndex
virtual OGRErr SetNextByIndex(GIntBig nIndex) override
Move read cursor to the nIndex'th feature in the current resultset.
Definition: gnmlayer.cpp:224
GDALDataset::FlushCache
virtual void FlushCache(bool bAtClosing=false)
Flush all write cached data to disk.
Definition: gdaldataset.cpp:434
OGRFeature
A simple feature, including geometry and attributes.
Definition: ogr_feature.h:381
GNMGenericLayer::Clip
OGRErr Clip(OGRLayer *pLayerMethod, OGRLayer *pLayerResult, char **papszOptions=nullptr, GDALProgressFunc pfnProgress=nullptr, void *pProgressArg=nullptr)
Clip.
Definition: gnmlayer.cpp:108
OGRGNMWrappedResultLayer::ICreateFeature
virtual OGRErr ICreateFeature(OGRFeature *poFeature) override
Create and write a new feature within a layer.
Definition: gnmresultlayer.cpp:211
GDALDataset::GetLayerCount
virtual int GetLayerCount()
Get the number of layers in this dataset.
Definition: gdaldataset.cpp:6830
GNMGenericLayer::Union
OGRErr Union(OGRLayer *pLayerMethod, OGRLayer *pLayerResult, char **papszOptions=nullptr, GDALProgressFunc pfnProgress=nullptr, void *pProgressArg=nullptr)
Union.
Definition: gnmlayer.cpp:76
CPLErr
CPLErr
Error category.
Definition: cpl_error.h:52
GNMGenericLayer::Identity
OGRErr Identity(OGRLayer *pLayerMethod, OGRLayer *pLayerResult, char **papszOptions=nullptr, GDALProgressFunc pfnProgress=nullptr, void *pProgressArg=nullptr)
Identity.
Definition: gnmlayer.cpp:92
OGRGNMWrappedResultLayer::GetFeature
virtual OGRFeature * GetFeature(GIntBig nFID) override
Fetch a feature by its identifier.
Definition: gnmresultlayer.cpp:77
OGRGNMWrappedResultLayer::InsertFeature
virtual OGRErr InsertFeature(OGRFeature *poFeature, const CPLString &soLayerName, int nPathNo, bool bIsEdge)
Undocumented.
Definition: gnmresultlayer.cpp:124
GNMGenericLayer::AttributeFilterEvaluationNeedsGeometry
int AttributeFilterEvaluationNeedsGeometry()
AttributeFilterEvaluationNeedsGeometry.
Definition: gnmlayer.cpp:129
OGRGNMWrappedResultLayer::ISetFeature
virtual OGRErr ISetFeature(OGRFeature *poFeature) override
Rewrite an existing feature.
Definition: gnmresultlayer.cpp:206
GNMGenericLayer::Update
OGRErr Update(OGRLayer *pLayerMethod, OGRLayer *pLayerResult, char **papszOptions=nullptr, GDALProgressFunc pfnProgress=nullptr, void *pProgressArg=nullptr)
Update.
Definition: gnmlayer.cpp:100
OGREnvelope
Simple container for a bounding region (rectangle)
Definition: ogr_core.h:57
GNMGenericLayer::StartTransaction
virtual OGRErr StartTransaction() override
For datasources which support transactions, StartTransaction creates a transaction.
Definition: gnmlayer.cpp:347
OGRFeatureDefn
Definition of a feature class or feature layer.
Definition: ogr_feature.h:280
GDALDataset::TestCapability
virtual int TestCapability(const char *)
Test if capability is available.
Definition: gdaldataset.cpp:7210
GNMGenericLayer::ReorderFields
virtual OGRErr ReorderFields(int *panMap) override
Reorder all the fields of a layer.
Definition: gnmlayer.cpp:308
GNMGenericLayer::GetName
virtual const char * GetName() override
Return the layer name.
Definition: gnmlayer.cpp:254
OGRGNMWrappedResultLayer::CreateGeomField
virtual OGRErr CreateGeomField(OGRGeomFieldDefn *poField, int bApproxOK=TRUE) override
Create a new geometry field on a layer.
Definition: gnmresultlayer.cpp:102
GNMGenericNetwork
GNM class which represents a geography network of generic format.
Definition: gnm.h:188
GNMGenericLayer::GetSpatialRef
virtual OGRSpatialReference * GetSpatialRef() override
Fetch the spatial reference system for this layer.
Definition: gnmlayer.cpp:269
GNMRule
The simple class for rules.
Definition: gnm.h:634
OGRGNMWrappedResultLayer::SetNextByIndex
virtual OGRErr SetNextByIndex(GIntBig nIndex) override
Move read cursor to the nIndex'th feature in the current resultset.
Definition: gnmresultlayer.cpp:72
GNMGenericLayer::GetSpatialFilter
virtual OGRGeometry * GetSpatialFilter() override
This method returns the current spatial filter for this layer.
Definition: gnmlayer.cpp:175
GDALDataset::DeleteLayer
virtual OGRErr DeleteLayer(int iLayer)
Delete the indicated layer from the datasource.
Definition: gdaldataset.cpp:5358
GNMGenericLayer::AlterFieldDefn
virtual OGRErr AlterFieldDefn(int iField, OGRFieldDefn *poNewFieldDefn, int nFlagsIn) override
Alter the definition of an existing field on a layer.
Definition: gnmlayer.cpp:313
GNMNetwork::Delete
virtual CPLErr Delete()=0
Delete network.