OGR
ograpispy.h
Go to the documentation of this file.
1 /******************************************************************************
2  * $Id: ograpispy.h 35912 2016-10-24 16:41:45Z goatbar $
3  *
4  * Project: OpenGIS Simple Features Reference Implementation
5  * Purpose: OGR C API "Spy"
6  * Author: Even Rouault, even.rouault at spatialys.com
7  *
8  ******************************************************************************
9  * Copyright (c) 2014, Even Rouault <even.rouault at spatialys.com>
10  *
11  * Permission is hereby granted, free of charge, to any person obtaining a
12  * copy of this software and associated documentation files (the "Software"),
13  * to deal in the Software without restriction, including without limitation
14  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
15  * and/or sell copies of the Software, and to permit persons to whom the
16  * Software is furnished to do so, subject to the following conditions:
17  *
18  * The above copyright notice and this permission notice shall be included
19  * in all copies or substantial portions of the Software.
20  *
21  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27  * DEALINGS IN THE SOFTWARE.
28  ****************************************************************************/
29 
30 #ifndef OGRAPISPY_H_INCLUDED
31 #define OGRAPISPY_H_INCLUDED
32 
33 #include "gdal.h"
34 
64 #ifdef DEBUG
65 #define OGRAPISPY_ENABLED
66 #endif
67 
68 #ifdef OGRAPISPY_ENABLED
69 
71 
72 extern int bOGRAPISpyEnabled;
73 
74 int OGRAPISpyOpenTakeSnapshot(const char* pszName, int bUpdate);
75 void OGRAPISpyOpen(const char* pszName, int bUpdate, int iSnapshot,
76  GDALDatasetH* phDS);
77 void OGRAPISpyPreClose(OGRDataSourceH hDS);
78 void OGRAPISpyPostClose();
79 void OGRAPISpyCreateDataSource(OGRSFDriverH hDriver, const char* pszName,
80  char** papszOptions, OGRDataSourceH hDS);
81 void OGRAPISpyDeleteDataSource(OGRSFDriverH hDriver, const char* pszName);
82 
83 void OGRAPISpy_DS_GetLayerCount( OGRDataSourceH hDS );
84 void OGRAPISpy_DS_GetLayer( OGRDataSourceH hDS, int iLayer, OGRLayerH hLayer );
85 void OGRAPISpy_DS_GetLayerByName( OGRDataSourceH hDS, const char* pszLayerName,
86  OGRLayerH hLayer );
87 void OGRAPISpy_DS_ExecuteSQL( OGRDataSourceH hDS,
88  const char *pszStatement,
89  OGRGeometryH hSpatialFilter,
90  const char *pszDialect,
91  OGRLayerH hLayer);
92 void OGRAPISpy_DS_ReleaseResultSet( OGRDataSourceH hDS, OGRLayerH hLayer);
93 
94 void OGRAPISpy_DS_CreateLayer( OGRDataSourceH hDS,
95  const char * pszName,
96  OGRSpatialReferenceH hSpatialRef,
97  OGRwkbGeometryType eType,
98  char ** papszOptions,
99  OGRLayerH hLayer);
100 void OGRAPISpy_DS_DeleteLayer( OGRDataSourceH hDS, int iLayer );
101 
102 void OGRAPISpy_Dataset_StartTransaction( GDALDatasetH hDS, int bForce );
103 void OGRAPISpy_Dataset_CommitTransaction( GDALDatasetH hDS );
104 void OGRAPISpy_Dataset_RollbackTransaction( GDALDatasetH hDS );
105 
106 void OGRAPISpy_L_GetFeatureCount( OGRLayerH hLayer, int bForce );
107 void OGRAPISpy_L_GetExtent( OGRLayerH hLayer, int bForce );
108 void OGRAPISpy_L_GetExtentEx( OGRLayerH hLayer, int iGeomField, int bForce );
109 void OGRAPISpy_L_SetAttributeFilter( OGRLayerH hLayer, const char* pszFilter );
110 void OGRAPISpy_L_GetFeature( OGRLayerH hLayer, GIntBig nFeatureId );
111 void OGRAPISpy_L_SetNextByIndex( OGRLayerH hLayer, GIntBig nIndex );
112 void OGRAPISpy_L_GetNextFeature( OGRLayerH hLayer );
113 void OGRAPISpy_L_SetFeature( OGRLayerH hLayer, OGRFeatureH hFeat );
114 void OGRAPISpy_L_CreateFeature( OGRLayerH hLayer, OGRFeatureH hFeat );
115 void OGRAPISpy_L_CreateField( OGRLayerH hLayer, OGRFieldDefnH hField,
116  int bApproxOK );
117 void OGRAPISpy_L_DeleteField( OGRLayerH hLayer, int iField );
118 void OGRAPISpy_L_ReorderFields( OGRLayerH hLayer, int* panMap );
119 void OGRAPISpy_L_ReorderField( OGRLayerH hLayer, int iOldFieldPos,
120  int iNewFieldPos );
121 void OGRAPISpy_L_AlterFieldDefn( OGRLayerH hLayer, int iField,
122  OGRFieldDefnH hNewFieldDefn,
123  int nFlags );
124 void OGRAPISpy_L_CreateGeomField( OGRLayerH hLayer, OGRGeomFieldDefnH hField,
125  int bApproxOK );
126 void OGRAPISpy_L_StartTransaction( OGRLayerH hLayer );
127 void OGRAPISpy_L_CommitTransaction( OGRLayerH hLayer );
128 void OGRAPISpy_L_RollbackTransaction( OGRLayerH hLayer );
129 void OGRAPISpy_L_GetLayerDefn( OGRLayerH hLayer );
130 void OGRAPISpy_L_FindFieldIndex( OGRLayerH hLayer, const char *pszFieldName,
131  int bExactMatch );
132 void OGRAPISpy_L_GetSpatialRef( OGRLayerH hLayer );
133 void OGRAPISpy_L_TestCapability( OGRLayerH hLayer, const char* pszCap );
134 void OGRAPISpy_L_GetSpatialFilter( OGRLayerH hLayer );
135 void OGRAPISpy_L_SetSpatialFilter( OGRLayerH hLayer, OGRGeometryH hGeom );
136 void OGRAPISpy_L_SetSpatialFilterEx( OGRLayerH hLayer, int iGeomField,
137  OGRGeometryH hGeom );
138 void OGRAPISpy_L_SetSpatialFilterRect( OGRLayerH hLayer,
139  double dfMinX, double dfMinY,
140  double dfMaxX, double dfMaxY);
141 void OGRAPISpy_L_SetSpatialFilterRectEx( OGRLayerH hLayer, int iGeomField,
142  double dfMinX, double dfMinY,
143  double dfMaxX, double dfMaxY);
144 void OGRAPISpy_L_ResetReading( OGRLayerH hLayer );
145 void OGRAPISpy_L_SyncToDisk( OGRLayerH hLayer );
146 void OGRAPISpy_L_DeleteFeature( OGRLayerH hLayer, GIntBig nFID );
147 void OGRAPISpy_L_GetFIDColumn( OGRLayerH hLayer );
148 void OGRAPISpy_L_GetGeometryColumn( OGRLayerH hLayer );
149 void OGRAPISpy_L_GetName( OGRLayerH hLayer );
150 void OGRAPISpy_L_GetGeomType( OGRLayerH hLayer );
151 void OGRAPISpy_L_SetIgnoredFields( OGRLayerH hLayer,
152  const char** papszIgnoredFields );
153 
154 void OGRAPISpy_FD_GetGeomType(OGRFeatureDefnH hDefn);
155 void OGRAPISpy_FD_GetFieldCount(OGRFeatureDefnH hDefn);
156 void OGRAPISpy_FD_GetFieldDefn(OGRFeatureDefnH hDefn, int iField,
157  OGRFieldDefnH hGeomField);
158 void OGRAPISpy_FD_GetFieldIndex(OGRFeatureDefnH hDefn, const char* pszFieldName);
159 
160 void OGRAPISpy_Fld_GetXXXX(OGRFieldDefnH hField, const char* pszOp);
161 
162 void OGRAPISpy_FD_GetGeomFieldCount(OGRFeatureDefnH hDefn);
163 void OGRAPISpy_FD_GetGeomFieldDefn(OGRFeatureDefnH hDefn, int iGeomField,
164  OGRGeomFieldDefnH hGeomField);
165 void OGRAPISpy_FD_GetGeomFieldIndex(OGRFeatureDefnH hDefn, const char* pszFieldName);
166 void OGRAPISpy_GFld_GetXXXX(OGRGeomFieldDefnH hGeomField, const char* pszOp);
167 
168 CPL_C_END
169 
170 #endif /* OGRAPISPY_ENABLED */
171 
172 #endif /* OGRAPISPY_H_INCLUDED */
wkbTINM
@ wkbTINM
Definition: ogr_core.h:373
wkbSurfaceM
@ wkbSurfaceM
Definition: ogr_core.h:371
ogr_spatialref.h
wkbPointZM
@ wkbPointZM
Definition: ogr_core.h:376
wkbCurvePolygonZM
@ wkbCurvePolygonZM
Definition: ogr_core.h:385
OFTWideString
@ OFTWideString
Definition: ogr_core.h:592
OGRFeature::GetFieldAsInteger
int GetFieldAsInteger(int i)
Fetch field value as integer.
Definition: ogrfeature.cpp:1661
wkbMultiCurveZM
@ wkbMultiCurveZM
Definition: ogr_core.h:386
wkbMultiLineStringZM
@ wkbMultiLineStringZM
Definition: ogr_core.h:380
OFTBinary
@ OFTBinary
Definition: ogr_core.h:594
wkbPoint
@ wkbPoint
Definition: ogr_core.h:316
OGRFeature::GetStyleString
virtual const char * GetStyleString()
Fetch style string for this feature.
Definition: ogrfeature.cpp:5907
wkbCurvePolygonZ
@ wkbCurvePolygonZ
Definition: ogr_core.h:349
wkbMultiSurfaceZM
@ wkbMultiSurfaceZM
Definition: ogr_core.h:387
wkbTriangleZ
@ wkbTriangleZ
Definition: ogr_core.h:356
wkbCompoundCurveZM
@ wkbCompoundCurveZM
Definition: ogr_core.h:384
wkbMultiSurfaceM
@ wkbMultiSurfaceM
Definition: ogr_core.h:369
wkbMultiPolygon
@ wkbMultiPolygon
Definition: ogr_core.h:324
CPLCopyFile
int CPLCopyFile(const char *pszNewPath, const char *pszOldPath)
Definition: cpl_conv.cpp:2568
wkbMultiPoint25D
@ wkbMultiPoint25D
Definition: ogr_core.h:397
OGRFieldDefn::GetWidth
int GetWidth() const
Get the formatting width for this field.
Definition: ogr_feature.h:97
OGRSpatialReference
Definition: ogr_spatialref.h:132
wkbCompoundCurve
@ wkbCompoundCurve
Definition: ogr_core.h:330
wkbPolygon25D
@ wkbPolygon25D
Definition: ogr_core.h:396
OFTWideStringList
@ OFTWideStringList
Definition: ogr_core.h:593
wkbPolygonZM
@ wkbPolygonZM
Definition: ogr_core.h:378
OGRFeature::GetFieldCount
int GetFieldCount() const
Fetch number of fields on this feature. This will always be the same as the field count for the OGRFe...
Definition: ogr_feature.h:326
OFTDateTime
@ OFTDateTime
Definition: ogr_core.h:597
wkbPolygonM
@ wkbPolygonM
Definition: ogr_core.h:360
OGRGeometry
Definition: ogr_geometry.h:118
wkbTriangleM
@ wkbTriangleM
Definition: ogr_core.h:374
OGRSFDriverH
void * OGRSFDriverH
Definition: ogr_api.h:501
ograpispy.h
wkbCircularString
@ wkbCircularString
Definition: ogr_core.h:328
OGRLayer
Definition: ogrsf_frmts.h:68
CPLString
Convenient string class based on std::string.
Definition: cpl_string.h:338
wkbMultiPolygonZM
@ wkbMultiPolygonZM
Definition: ogr_core.h:381
OGRFieldDefn::GetPrecision
int GetPrecision() const
Get the formatting precision for this field. This should normally be zero for fields of types other t...
Definition: ogr_feature.h:100
wkbCurveM
@ wkbCurveM
Definition: ogr_core.h:370
ogr_geometry.h
wkbPolyhedralSurfaceZM
@ wkbPolyhedralSurfaceZM
Definition: ogr_core.h:390
wkbPoint25D
@ wkbPoint25D
Definition: ogr_core.h:394
wkbSurfaceZM
@ wkbSurfaceZM
Definition: ogr_core.h:389
wkbCircularStringZM
@ wkbCircularStringZM
Definition: ogr_core.h:383
OGRFeatureH
void * OGRFeatureH
Definition: ogr_api.h:291
CPL_FRMT_GIB
#define CPL_FRMT_GIB
Definition: cpl_port.h:326
EQUAL
#define EQUAL(a, b)
Definition: cpl_port.h:622
wkbCircularStringZ
@ wkbCircularStringZ
Definition: ogr_core.h:347
wkbCurve
@ wkbCurve
Definition: ogr_core.h:336
OGRFeatureDefnH
void * OGRFeatureDefnH
Definition: ogr_api.h:289
OGRLayer::GetLayerDefn
virtual OGRFeatureDefn * GetLayerDefn()=0
Fetch the schema information for this layer.
wkbMultiPointZM
@ wkbMultiPointZM
Definition: ogr_core.h:379
wkbTINZM
@ wkbTINZM
Definition: ogr_core.h:391
OGRGeomFieldDefnH
struct OGRGeomFieldDefnHS * OGRGeomFieldDefnH
Definition: ogr_api.h:296
wkbLineStringZM
@ wkbLineStringZM
Definition: ogr_core.h:377
CPL_C_START
#define CPL_C_START
Definition: cpl_port.h:352
OGRFieldDefn::GetDefault
const char * GetDefault() const
Get default field value.
Definition: ogrfielddefn.cpp:518
OGRSpatialReferenceH
void * OGRSpatialReferenceH
Definition: ogr_api.h:69
OGRFeature::GetFieldDefnRef
OGRFieldDefn * GetFieldDefnRef(int iField) const
Fetch definition for this field.
Definition: ogr_feature.h:328
wkbCurvePolygon
@ wkbCurvePolygon
Definition: ogr_core.h:331
wkbLineStringM
@ wkbLineStringM
Definition: ogr_core.h:359
OFTString
@ OFTString
Definition: ogr_core.h:590
OGRFeature::GetGeomFieldCount
int GetGeomFieldCount() const
Fetch number of geometry fields on this feature. This will always be the same as the geometry field c...
Definition: ogr_feature.h:310
wkbMultiPolygon25D
@ wkbMultiPolygon25D
Definition: ogr_core.h:399
wkbCircularStringM
@ wkbCircularStringM
Definition: ogr_core.h:365
OFTIntegerList
@ OFTIntegerList
Definition: ogr_core.h:587
wkbMultiSurface
@ wkbMultiSurface
Definition: ogr_core.h:335
ogrsf_frmts.h
wkbPolyhedralSurface
@ wkbPolyhedralSurface
Definition: ogr_core.h:338
wkbCurvePolygonM
@ wkbCurvePolygonM
Definition: ogr_core.h:367
CPL_C_END
#define CPL_C_END
Definition: cpl_port.h:354
wkbMultiPointM
@ wkbMultiPointM
Definition: ogr_core.h:361
wkbGeometryCollectionM
@ wkbGeometryCollectionM
Definition: ogr_core.h:364
OGRDataSourceH
void * OGRDataSourceH
Definition: ogr_api.h:499
OGRFieldDefn
Definition: ogr_feature.h:62
CPLFormFilename
const char * CPLFormFilename(const char *pszPath, const char *pszBasename, const char *pszExtension)
Definition: cpl_path.cpp:501
OFTInteger
@ OFTInteger
Definition: ogr_core.h:586
VSIStatL
int VSIStatL(const char *, VSIStatBufL *)
Get filesystem object info.
Definition: cpl_vsil.cpp:451
OGRGeomFieldDefn::IsNullable
int IsNullable() const
Return whether this geometry field can receive null values.
Definition: ogr_feature.h:173
ogr_feature.h
wkbNone
@ wkbNone
Definition: ogr_core.h:344
OGRFeature::IsFieldSet
int IsFieldSet(int iField)
Test if a field has ever been assigned a value or not.
Definition: ogrfeature.cpp:1245
OFTInteger64List
@ OFTInteger64List
Definition: ogr_core.h:599
wkbPolygon
@ wkbPolygon
Definition: ogr_core.h:319
cpl_string.h
wkbMultiCurveM
@ wkbMultiCurveM
Definition: ogr_core.h:368
wkbMultiLineString25D
@ wkbMultiLineString25D
Definition: ogr_core.h:398
wkbCompoundCurveM
@ wkbCompoundCurveM
Definition: ogr_core.h:366
wkbPolyhedralSurfaceM
@ wkbPolyhedralSurfaceM
Definition: ogr_core.h:372
CPLSPrintf
const char * CPLSPrintf(const char *fmt,...)
Definition: cpl_string.cpp:975
OFTStringList
@ OFTStringList
Definition: ogr_core.h:591
wkbSurface
@ wkbSurface
Definition: ogr_core.h:337
OGRFieldDefnH
void * OGRFieldDefnH
Definition: ogr_api.h:287
OGRGeometryH
void * OGRGeometryH
Definition: ogr_api.h:56
OGRGeomFieldDefn
Definition: ogr_feature.h:141
OGRFieldDefn::GetNameRef
const char * GetNameRef()
Fetch name of this field.
Definition: ogr_feature.h:83
wkbLinearRing
@ wkbLinearRing
Definition: ogr_core.h:345
OFTTime
@ OFTTime
Definition: ogr_core.h:596
OGRFieldDefn::GetType
OGRFieldType GetType() const
Fetch type of this field.
Definition: ogr_feature.h:85
OGRGeomFieldDefn::GetNameRef
const char * GetNameRef()
Fetch name of this field.
Definition: ogr_feature.h:162
wkbCompoundCurveZ
@ wkbCompoundCurveZ
Definition: ogr_core.h:348
CSLDestroy
void CSLDestroy(char **papszStrList)
Definition: cpl_string.cpp:200
GIntBig
long long GIntBig
Definition: cpl_port.h:250
wkbCurveZ
@ wkbCurveZ
Definition: ogr_core.h:352
OGRFeature::IsFieldNull
bool IsFieldNull(int iField)
Test if a field is null.
Definition: ogrfeature.cpp:1400
OGRwkbGeometryType
OGRwkbGeometryType
Definition: ogr_core.h:312
wkbTINZ
@ wkbTINZ
Definition: ogr_core.h:355
OFTDate
@ OFTDate
Definition: ogr_core.h:595
OGRFeature
Definition: ogr_feature.h:279
VSIStatBufL
struct stat64 VSIStatBufL
Definition: cpl_vsi.h:190
cpl_port.h
OGRGeomFieldDefn::GetType
OGRwkbGeometryType GetType() const
Fetch geometry type of this field.
Definition: ogr_feature.h:164
wkbTriangleZM
@ wkbTriangleZM
Definition: ogr_core.h:392
OFTRealList
@ OFTRealList
Definition: ogr_core.h:589
wkbGeometryCollection25D
@ wkbGeometryCollection25D
Definition: ogr_core.h:400
VSIMkdir
int VSIMkdir(const char *pathname, long mode)
Create a directory.
Definition: cpl_vsil.cpp:329
wkbGeometryCollection
@ wkbGeometryCollection
Definition: ogr_core.h:325
OGRFieldDefn::IsNullable
int IsNullable() const
Return whether this field can receive null values.
Definition: ogr_feature.h:114
OGRFieldType
OGRFieldType
Definition: ogr_core.h:584
wkbMultiCurveZ
@ wkbMultiCurveZ
Definition: ogr_core.h:350
OGRFeature::GetFieldAsDouble
double GetFieldAsDouble(int i)
Fetch field value as a double.
Definition: ogrfeature.cpp:1918
wkbPolyhedralSurfaceZ
@ wkbPolyhedralSurfaceZ
Definition: ogr_core.h:354
wkbMultiCurve
@ wkbMultiCurve
Definition: ogr_core.h:334
wkbMultiPolygonM
@ wkbMultiPolygonM
Definition: ogr_core.h:363
wkbLineString25D
@ wkbLineString25D
Definition: ogr_core.h:395
OFTInteger64
@ OFTInteger64
Definition: ogr_core.h:598
wkbGeometryCollectionZM
@ wkbGeometryCollectionZM
Definition: ogr_core.h:382
OGRGeomFieldDefn::GetSpatialRef
virtual OGRSpatialReference * GetSpatialRef()
Fetch spatial reference system of this field.
Definition: ogrgeomfielddefn.cpp:435
OGRFeatureDefn
Definition: ogr_feature.h:207
wkbMultiSurfaceZ
@ wkbMultiSurfaceZ
Definition: ogr_core.h:351
wkbTriangle
@ wkbTriangle
Definition: ogr_core.h:342
wkbLineString
@ wkbLineString
Definition: ogr_core.h:317
OGRFeature::GetGeomFieldRef
OGRGeometry * GetGeomFieldRef(int iField)
Fetch pointer to feature geometry.
Definition: ogrfeature.cpp:630
wkbMultiLineString
@ wkbMultiLineString
Definition: ogr_core.h:323
OGRFeature::GetFieldAsString
const char * GetFieldAsString(int i)
Fetch field value as a string.
Definition: ogrfeature.cpp:2090
wkbCurveZM
@ wkbCurveZM
Definition: ogr_core.h:388
OFTReal
@ OFTReal
Definition: ogr_core.h:588
OGRLayerH
void * OGRLayerH
Definition: ogr_api.h:497
wkbMultiLineStringM
@ wkbMultiLineStringM
Definition: ogr_core.h:362
CPLFree
#define CPLFree
Definition: cpl_conv.h:81
wkbUnknown
@ wkbUnknown
Definition: ogr_core.h:314
wkbTIN
@ wkbTIN
Definition: ogr_core.h:340
CPLGetFilename
const char * CPLGetFilename(const char *)
Definition: cpl_path.cpp:260
OGRFeature::GetFID
GIntBig GetFID() const
Get feature identifier.
Definition: ogr_feature.h:435
wkbPointM
@ wkbPointM
Definition: ogr_core.h:358
wkbMultiPoint
@ wkbMultiPoint
Definition: ogr_core.h:322
wkbSurfaceZ
@ wkbSurfaceZ
Definition: ogr_core.h:353
CPLGetConfigOption
const char * CPLGetConfigOption(const char *, const char *)
Definition: cpl_conv.cpp:1625

Generated for GDAL by doxygen 1.8.17.