GDAL

- Main Page
- Related Pages
- Classes
- Files

- File List
- File Members

ogrsf_frmts.h
Go to the documentation of this file.
1 /******************************************************************************
2 * $Id: ogrsf_frmts.h 33631 2016-03-04 06:28:09Z goatbar $
3 *
4 * Project: OpenGIS Simple Features Reference Implementation
5 * Purpose: Classes related to format registration, and file opening.
6 * Author: Frank Warmerdam, warmerda@home.com
7 *
8 ******************************************************************************
9 * Copyright (c) 1999, Les Technologies SoftMap Inc.
10 * Copyright (c) 2007-2014, Even Rouault <even dot rouault at mines-paris dot org>
11 *
12 * Permission is hereby granted, free of charge, to any person obtaining a
13 * copy of this software and associated documentation files (the "Software"),
14 * to deal in the Software without restriction, including without limitation
15 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16 * and/or sell copies of the Software, and to permit persons to whom the
17 * Software is furnished to do so, subject to the following conditions:
18 *
19 * The above copyright notice and this permission notice shall be included
20 * in all copies or substantial portions of the Software.
21 *
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
28 * DEALINGS IN THE SOFTWARE.
29 ****************************************************************************/
30
31 #ifndef OGRSF_FRMTS_H_INCLUDED
32 #define OGRSF_FRMTS_H_INCLUDED
33
34 #include "cpl_progress.h"
35 #include "ogr_feature.h"
36 #include "ogr_featurestyle.h"
37 #include "gdal_priv.h"
38
45 #if !defined(GDAL_COMPILATION) && !defined(SUPPRESS_DEPRECATION_WARNINGS)
46 #define OGR_DEPRECATED(x) CPL_WARN_DEPRECATED(x)
47 #else
48 #define OGR_DEPRECATED(x)
49 #endif
50
51 class OGRLayerAttrIndex;
52 class OGRSFDriver;
53
54 /************************************************************************/
55 /* OGRLayer */
56 /************************************************************************/
57
63 /* Note: any virtual method added to this class must also be added in the */
64 /* OGRLayerDecorator and OGRMutexedLayer classes. */
65
66 class CPL_DLL OGRLayer : public GDALMajorObject
67 {
68 private:
69 void ConvertGeomsIfNecessary( OGRFeature *poFeature );
70
71 protected:
72 int m_bFilterIsEnvelope;
73 OGRGeometry *m_poFilterGeom;
74 OGRPreparedGeometry *m_pPreparedFilterGeom; /* m_poFilterGeom compiled as a prepared geometry */
75 OGREnvelope m_sFilterEnvelope;
76 int m_iGeomFieldFilter; // specify the index on which the spatial
77 // filter is active.
78
79 int FilterGeometry( OGRGeometry * );
80 //int FilterGeometry( OGRGeometry *, OGREnvelope* psGeometryEnvelope);
81 int InstallFilter( OGRGeometry * );
82
83 OGRErr GetExtentInternal(int iGeomField, OGREnvelope *psExtent, int bForce );
84
85 virtual OGRErr ISetFeature( OGRFeature *poFeature ) CPL_WARN_UNUSED_RESULT;
86 virtual OGRErr ICreateFeature( OGRFeature *poFeature ) CPL_WARN_UNUSED_RESULT;
87
88 public:
89 OGRLayer();
90 virtual ~OGRLayer();
91
92 virtual OGRGeometry *GetSpatialFilter();
93 virtual void SetSpatialFilter( OGRGeometry * );
94 virtual void SetSpatialFilterRect( double dfMinX, double dfMinY,
95 double dfMaxX, double dfMaxY );
96
97 virtual void SetSpatialFilter( int iGeomField, OGRGeometry * );
98 virtual void SetSpatialFilterRect( int iGeomField,
99 double dfMinX, double dfMinY,
100 double dfMaxX, double dfMaxY );
101
102 virtual OGRErr SetAttributeFilter( const char * );
103
104 virtual void ResetReading() = 0;
105 virtual OGRFeature *GetNextFeature() CPL_WARN_UNUSED_RESULT = 0;
106 virtual OGRErr SetNextByIndex( GIntBig nIndex );
107 virtual OGRFeature *GetFeature( GIntBig nFID ) CPL_WARN_UNUSED_RESULT;
108
109 OGRErr SetFeature( OGRFeature *poFeature ) CPL_WARN_UNUSED_RESULT;
110 OGRErr CreateFeature( OGRFeature *poFeature ) CPL_WARN_UNUSED_RESULT;
111
112 virtual OGRErr DeleteFeature( GIntBig nFID ) CPL_WARN_UNUSED_RESULT;
113
114 virtual const char *GetName();
115 virtual OGRwkbGeometryType GetGeomType();
116 virtual OGRFeatureDefn *GetLayerDefn() = 0;
117 virtual int FindFieldIndex( const char *pszFieldName, int bExactMatch );
118
119 virtual OGRSpatialReference *GetSpatialRef();
120
121 virtual GIntBig GetFeatureCount( int bForce = TRUE );
122 virtual OGRErr GetExtent(OGREnvelope *psExtent, int bForce = TRUE) CPL_WARN_UNUSED_RESULT;
123 virtual OGRErr GetExtent(int iGeomField, OGREnvelope *psExtent,
124 int bForce = TRUE) CPL_WARN_UNUSED_RESULT;
125
126 virtual int TestCapability( const char * ) = 0;
127
128 virtual OGRErr CreateField( OGRFieldDefn *poField,
129 int bApproxOK = TRUE );
130 virtual OGRErr DeleteField( int iField );
131 virtual OGRErr ReorderFields( int* panMap );
132 virtual OGRErr AlterFieldDefn( int iField, OGRFieldDefn* poNewFieldDefn, int nFlagsIn );
133
134 virtual OGRErr CreateGeomField( OGRGeomFieldDefn *poField,
135 int bApproxOK = TRUE );
136
137 virtual OGRErr SyncToDisk();
138
139 virtual OGRStyleTable *GetStyleTable();
140 virtual void SetStyleTableDirectly( OGRStyleTable *poStyleTable );
141
142 virtual void SetStyleTable(OGRStyleTable *poStyleTable);
143
144 virtual OGRErr StartTransaction() CPL_WARN_UNUSED_RESULT;
145 virtual OGRErr CommitTransaction() CPL_WARN_UNUSED_RESULT;
146 virtual OGRErr RollbackTransaction();
147
148 virtual const char *GetFIDColumn();
149 virtual const char *GetGeometryColumn();
150
151 virtual OGRErr SetIgnoredFields( const char **papszFields );
152
153 OGRErr Intersection( OGRLayer *pLayerMethod,
154 OGRLayer *pLayerResult,
155 char** papszOptions = NULL,
156 GDALProgressFunc pfnProgress = NULL,
157 void * pProgressArg = NULL );
158 OGRErr Union( OGRLayer *pLayerMethod,
159 OGRLayer *pLayerResult,
160 char** papszOptions = NULL,
161 GDALProgressFunc pfnProgress = NULL,
162 void * pProgressArg = NULL );
163 OGRErr SymDifference( OGRLayer *pLayerMethod,
164 OGRLayer *pLayerResult,
165 char** papszOptions,
166 GDALProgressFunc pfnProgress,
167 void * pProgressArg );
168 OGRErr Identity( OGRLayer *pLayerMethod,
169 OGRLayer *pLayerResult,
170 char** papszOptions = NULL,
171 GDALProgressFunc pfnProgress = NULL,
172 void * pProgressArg = NULL );
173 OGRErr Update( OGRLayer *pLayerMethod,
174 OGRLayer *pLayerResult,
175 char** papszOptions = NULL,
176 GDALProgressFunc pfnProgress = NULL,
177 void * pProgressArg = NULL );
178 OGRErr Clip( OGRLayer *pLayerMethod,
179 OGRLayer *pLayerResult,
180 char** papszOptions = NULL,
181 GDALProgressFunc pfnProgress = NULL,
182 void * pProgressArg = NULL );
183 OGRErr Erase( OGRLayer *pLayerMethod,
184 OGRLayer *pLayerResult,
185 char** papszOptions = NULL,
186 GDALProgressFunc pfnProgress = NULL,
187 void * pProgressArg = NULL );
188
189 int Reference();
190 int Dereference();
191 int GetRefCount() const;
192
193 GIntBig GetFeaturesRead();
194
195 /* non virtual : convenience wrapper for ReorderFields() */
196 OGRErr ReorderField( int iOldFieldPos, int iNewFieldPos );
197
198 int AttributeFilterEvaluationNeedsGeometry();
199
200 /* consider these private */
201 OGRErr InitializeIndexSupport( const char * );
202 OGRLayerAttrIndex *GetIndex() { return m_poAttrIndex; }
203
204 protected:
205 OGRStyleTable *m_poStyleTable;
206 OGRFeatureQuery *m_poAttrQuery;
207 char *m_pszAttrQueryString;
208 OGRLayerAttrIndex *m_poAttrIndex;
209
210 int m_nRefCount;
211
212 GIntBig m_nFeaturesRead;
213 };
214
215 /************************************************************************/
216 /* OGRDataSource */
217 /************************************************************************/
218
238 class CPL_DLL OGRDataSource : public GDALDataset
239 {
240 public:
241 OGRDataSource();
242
243 virtual const char *GetName() OGR_DEPRECATED("Use GDALDataset class instead") = 0;
244
245 static void DestroyDataSource( OGRDataSource * ) OGR_DEPRECATED("Use GDALDataset class instead");
246 };
247
248 /************************************************************************/
249 /* OGRSFDriver */
250 /************************************************************************/
251
270 class CPL_DLL OGRSFDriver : public GDALDriver
271 {
272 public:
273 virtual ~OGRSFDriver();
274
275 virtual const char *GetName() OGR_DEPRECATED("Use GDALDriver class instead") = 0;
276
277 virtual OGRDataSource *Open( const char *pszName, int bUpdate=FALSE ) OGR_DEPRECATED("Use GDALDriver class instead") = 0;
278
279 virtual int TestCapability( const char *pszCap ) OGR_DEPRECATED("Use GDALDriver class instead") = 0;
280
281 virtual OGRDataSource *CreateDataSource( const char *pszName,
282 char ** = NULL ) OGR_DEPRECATED("Use GDALDriver class instead");
283 virtual OGRErr DeleteDataSource( const char *pszName ) OGR_DEPRECATED("Use GDALDriver class instead");
284 };
285
286
287 /************************************************************************/
288 /* OGRSFDriverRegistrar */
289 /************************************************************************/
290
304 class CPL_DLL OGRSFDriverRegistrar
305 {
306
307 OGRSFDriverRegistrar();
308 ~OGRSFDriverRegistrar();
309
310 static GDALDataset* OpenWithDriverArg(GDALDriver* poDriver,
311 GDALOpenInfo* poOpenInfo);
312 static GDALDataset* CreateVectorOnly( GDALDriver* poDriver,
313 const char * pszName,
314 char ** papszOptions );
315 static CPLErr DeleteDataSource( GDALDriver* poDriver,
316 const char * pszName );
317
318 public:
319
320 static OGRSFDriverRegistrar *GetRegistrar() OGR_DEPRECATED("Use GDALDriverManager class instead");
321
322 void RegisterDriver( OGRSFDriver * poDriver ) OGR_DEPRECATED("Use GDALDriverManager class instead");
323
324 int GetDriverCount( void ) OGR_DEPRECATED("Use GDALDriverManager class instead");
325 GDALDriver *GetDriver( int iDriver ) OGR_DEPRECATED("Use GDALDriverManager class instead");
326 GDALDriver *GetDriverByName( const char * ) OGR_DEPRECATED("Use GDALDriverManager class instead");
327
328 int GetOpenDSCount() OGR_DEPRECATED("Use GDALDriverManager class instead");
329 OGRDataSource *GetOpenDS( int ) OGR_DEPRECATED("Use GDALDriverManager class instead");
330 };
331
332 /* -------------------------------------------------------------------- */
333 /* Various available registration methods. */
334 /* -------------------------------------------------------------------- */
335 CPL_C_START
336 void CPL_DLL OGRRegisterAll();
337 void OGRRegisterAllInternal();
338
339 void CPL_DLL RegisterOGRFileGDB();
340 void CPL_DLL RegisterOGRShape();
341 void CPL_DLL RegisterOGRDB2();
342 void CPL_DLL RegisterOGRNTF();
343 void CPL_DLL RegisterOGRFME();
344 void CPL_DLL RegisterOGRSDTS();
345 void CPL_DLL RegisterOGRTiger();
346 void CPL_DLL RegisterOGRS57();
347 void CPL_DLL RegisterOGRTAB();
348 void CPL_DLL RegisterOGRMIF();
349 void CPL_DLL RegisterOGROGDI();
350 void CPL_DLL RegisterOGRODBC();
351 void CPL_DLL RegisterOGRWAsP();
352 void CPL_DLL RegisterOGRPG();
353 void CPL_DLL RegisterOGRMSSQLSpatial();
354 void CPL_DLL RegisterOGRMySQL();
355 void CPL_DLL RegisterOGROCI();
356 void CPL_DLL RegisterOGRDGN();
357 void CPL_DLL RegisterOGRGML();
358 void CPL_DLL RegisterOGRLIBKML();
359 void CPL_DLL RegisterOGRKML();
360 void CPL_DLL RegisterOGRGeoJSON();
361 void CPL_DLL RegisterOGRAVCBin();
362 void CPL_DLL RegisterOGRAVCE00();
363 void CPL_DLL RegisterOGRREC();
364 void CPL_DLL RegisterOGRMEM();
365 void CPL_DLL RegisterOGRVRT();
366 void CPL_DLL RegisterOGRDODS();
367 void CPL_DLL RegisterOGRSQLite();
368 void CPL_DLL RegisterOGRCSV();
369 void CPL_DLL RegisterOGRILI1();
370 void CPL_DLL RegisterOGRILI2();
371 void CPL_DLL RegisterOGRGRASS();
372 void CPL_DLL RegisterOGRPGeo();
373 void CPL_DLL RegisterOGRDXFDWG();
374 void CPL_DLL RegisterOGRDXF();
375 void CPL_DLL RegisterOGRDWG();
376 void CPL_DLL RegisterOGRSDE();
377 void CPL_DLL RegisterOGRIDB();
378 void CPL_DLL RegisterOGRGMT();
379 void CPL_DLL RegisterOGRBNA();
380 void CPL_DLL RegisterOGRGPX();
381 void CPL_DLL RegisterOGRGeoconcept();
382 void CPL_DLL RegisterOGRIngres();
383 void CPL_DLL RegisterOGRXPlane();
384 void CPL_DLL RegisterOGRNAS();
385 void CPL_DLL RegisterOGRGeoRSS();
386 void CPL_DLL RegisterOGRGTM();
387 void CPL_DLL RegisterOGRVFK();
388 void CPL_DLL RegisterOGRPGDump();
389 void CPL_DLL RegisterOGROSM();
390 void CPL_DLL RegisterOGRGPSBabel();
391 void CPL_DLL RegisterOGRSUA();
392 void CPL_DLL RegisterOGROpenAir();
393 void CPL_DLL RegisterOGRPDS();
394 void CPL_DLL RegisterOGRWFS();
395 void CPL_DLL RegisterOGRSOSI();
396 void CPL_DLL RegisterOGRHTF();
397 void CPL_DLL RegisterOGRAeronavFAA();
398 void CPL_DLL RegisterOGRGeomedia();
399 void CPL_DLL RegisterOGRMDB();
400 void CPL_DLL RegisterOGREDIGEO();
401 void CPL_DLL RegisterOGRGFT();
402 void CPL_DLL RegisterOGRSVG();
403 void CPL_DLL RegisterOGRCouchDB();
404 void CPL_DLL RegisterOGRCloudant();
405 void CPL_DLL RegisterOGRIdrisi();
406 void CPL_DLL RegisterOGRARCGEN();
407 void CPL_DLL RegisterOGRSEGUKOOA();
408 void CPL_DLL RegisterOGRSEGY();
409 void CPL_DLL RegisterOGRXLS();
410 void CPL_DLL RegisterOGRODS();
411 void CPL_DLL RegisterOGRXLSX();
412 void CPL_DLL RegisterOGRElastic();
413 void CPL_DLL RegisterOGRGeoPackage();
414 void CPL_DLL RegisterOGRWalk();
415 void CPL_DLL RegisterOGRCartoDB();
416 void CPL_DLL RegisterOGRAmigoCloud();
417 void CPL_DLL RegisterOGRSXF();
418 void CPL_DLL RegisterOGROpenFileGDB();
419 void CPL_DLL RegisterOGRSelafin();
420 void CPL_DLL RegisterOGRJML();
421 void CPL_DLL RegisterOGRPLSCENES();
422 void CPL_DLL RegisterOGRCSW();
423 void CPL_DLL RegisterOGRMongoDB();
424 void CPL_DLL RegisterOGRVDV();
425 CPL_C_END
426
427 #endif /* ndef OGRSF_FRMTS_H_INCLUDED */
OGRDataSource
LEGACY class.
Definition: ogrsf_frmts.h:238
OGRRegisterAll
void OGRRegisterAll()
Register all drivers.
Definition: ogrregisterall.cpp:39
gdal_priv.h
C++ GDAL entry points.
OGRGeomFieldDefn
Definition of a geometry field of an OGRFeatureDefn.
Definition: ogr_feature.h:143
OGRFeatureDefn
Definition of a feature class or feature layer.
Definition: ogr_feature.h:206
ogr_featurestyle.h
Simple feature style classes.
OGRFieldDefn
Definition of an attribute of an OGRFeatureDefn.
Definition: ogr_feature.h:62
OGRwkbGeometryType
OGRwkbGeometryType
List of well known binary geometry types.
Definition: ogr_core.h:333
OGRGeometry
Abstract base class for all geometry classes.
Definition: ogr_geometry.h:104
OGRFeatureQuery
Definition: ogr_feature.h:461
GDALOpenInfo
Definition: gdal_priv.h:238
OGRSpatialReference
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:129
GDALMajorObject
Object with metadata.
Definition: gdal_priv.h:122
OGRSFDriverRegistrar
LEGACY class.
Definition: ogrsf_frmts.h:304
OGREnvelope
Simple container for a bounding region.
Definition: ogr_core.h:48
OGRLayer
This class represents a layer of simple features, with access methods.
Definition: ogrsf_frmts.h:66
ogr_feature.h
Simple feature classes.
OGRFeature
A simple feature, including geometry and attributes.
Definition: ogr_feature.h:274
OGRStyleTable
This class represents a style table.
Definition: ogr_featurestyle.h:82
GDALDataset
A set of associated raster bands, usually from one file.
Definition: gdal_priv.h:296
OGRLayerAttrIndex
Definition: ogr_attrind.h:66
GDALDriver
Format specific driver.
Definition: gdal_priv.h:1034
OGRSFDriver
LEGACY class.
Definition: ogrsf_frmts.h:270

Generated for GDAL by 1.8.8.