- Main Page
- Related Pages
- Classes
- Files

- File List
- File Members

# ogrsf_frmts.h

Go to the documentation of this file.

    00001 /******************************************************************************
    00002  * $Id: ogrsf_frmts.h 29035 2015-04-27 12:38:54Z rouault $
    00003  *
    00004  * Project:  OpenGIS Simple Features Reference Implementation
    00005  * Purpose:  Classes related to format registration, and file opening.
    00006  * Author:   Frank Warmerdam, warmerda@home.com
    00007  *
    00008  ******************************************************************************
    00009  * Copyright (c) 1999,  Les Technologies SoftMap Inc.
    00010  * Copyright (c) 2007-2014, Even Rouault <even dot rouault at mines-paris dot org>
    00011  *
    00012  * Permission is hereby granted, free of charge, to any person obtaining a
    00013  * copy of this software and associated documentation files (the "Software"),
    00014  * to deal in the Software without restriction, including without limitation
    00015  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
    00016  * and/or sell copies of the Software, and to permit persons to whom the
    00017  * Software is furnished to do so, subject to the following conditions:
    00018  *
    00019  * The above copyright notice and this permission notice shall be included
    00020  * in all copies or substantial portions of the Software.
    00021  *
    00022  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
    00023  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    00024  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
    00025  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    00026  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    00027  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    00028  * DEALINGS IN THE SOFTWARE.
    00029  ****************************************************************************/
    00030
    00031 #ifndef _OGRSF_FRMTS_H_INCLUDED
    00032 #define _OGRSF_FRMTS_H_INCLUDED
    00033
    00034 #include "cpl_progress.h"
    00035 #include "ogr_feature.h"
    00036 #include "ogr_featurestyle.h"
    00037 #include "gdal_priv.h"
    00038
    00045 #if !defined(GDAL_COMPILATION) && !defined(SUPPRESS_DEPRECATION_WARNINGS)
    00046 #define OGR_DEPRECATED(x) CPL_WARN_DEPRECATED(x)
    00047 #else
    00048 #define OGR_DEPRECATED(x)
    00049 #endif
    00050
    00051 class OGRLayerAttrIndex;
    00052 class OGRSFDriver;
    00053
    00054 /************************************************************************/
    00055 /*                               OGRLayer                               */
    00056 /************************************************************************/
    00057
    00063 /* Note: any virtual method added to this class must also be added in the */
    00064 /* OGRLayerDecorator and OGRMutexedLayer classes. */
    00065
    00066 class CPL_DLL OGRLayer : public GDALMajorObject
    00067 {
    00068   private:
    00069     void         ConvertNonLinearGeomsIfNecessary( OGRFeature *poFeature );
    00070
    00071   protected:
    00072     int          m_bFilterIsEnvelope;
    00073     OGRGeometry *m_poFilterGeom;
    00074     OGRPreparedGeometry *m_pPreparedFilterGeom; /* m_poFilterGeom compiled as a prepared geometry */
    00075     OGREnvelope  m_sFilterEnvelope;
    00076     int          m_iGeomFieldFilter; // specify the index on which the spatial
    00077                                      // filter is active.
    00078
    00079     int          FilterGeometry( OGRGeometry * );
    00080     //int          FilterGeometry( OGRGeometry *, OGREnvelope* psGeometryEnvelope);
    00081     int          InstallFilter( OGRGeometry * );
    00082
    00083     OGRErr       GetExtentInternal(int iGeomField, OGREnvelope *psExtent, int bForce );
    00084
    00085     virtual OGRErr      ISetFeature( OGRFeature *poFeature );
    00086     virtual OGRErr      ICreateFeature( OGRFeature *poFeature );
    00087
    00088   public:
    00089     OGRLayer();
    00090     virtual     ~OGRLayer();
    00091
    00092     virtual OGRGeometry *GetSpatialFilter();
    00093     virtual void        SetSpatialFilter( OGRGeometry * );
    00094     virtual void        SetSpatialFilterRect( double dfMinX, double dfMinY,
    00095                                               double dfMaxX, double dfMaxY );
    00096
    00097     virtual void        SetSpatialFilter( int iGeomField, OGRGeometry * );
    00098     virtual void        SetSpatialFilterRect( int iGeomField,
    00099                                             double dfMinX, double dfMinY,
    00100                                             double dfMaxX, double dfMaxY );
    00101
    00102     virtual OGRErr      SetAttributeFilter( const char * );
    00103
    00104     virtual void        ResetReading() = 0;
    00105     virtual OGRFeature *GetNextFeature() = 0;
    00106     virtual OGRErr      SetNextByIndex( GIntBig nIndex );
    00107     virtual OGRFeature *GetFeature( GIntBig nFID );
    00108
    00109     OGRErr      SetFeature( OGRFeature *poFeature );
    00110     OGRErr      CreateFeature( OGRFeature *poFeature );
    00111
    00112     virtual OGRErr      DeleteFeature( GIntBig nFID );
    00113
    00114     virtual const char *GetName();
    00115     virtual OGRwkbGeometryType GetGeomType();
    00116     virtual OGRFeatureDefn *GetLayerDefn() = 0;
    00117     virtual int         FindFieldIndex( const char *pszFieldName, int bExactMatch );
    00118
    00119     virtual OGRSpatialReference *GetSpatialRef();
    00120
    00121     virtual GIntBig     GetFeatureCount( int bForce = TRUE );
    00122     virtual OGRErr      GetExtent(OGREnvelope *psExtent, int bForce = TRUE);
    00123     virtual OGRErr      GetExtent(int iGeomField, OGREnvelope *psExtent,
    00124                                   int bForce = TRUE);
    00125
    00126     virtual int         TestCapability( const char * ) = 0;
    00127
    00128     virtual OGRErr      CreateField( OGRFieldDefn *poField,
    00129                                      int bApproxOK = TRUE );
    00130     virtual OGRErr      DeleteField( int iField );
    00131     virtual OGRErr      ReorderFields( int* panMap );
    00132     virtual OGRErr      AlterFieldDefn( int iField, OGRFieldDefn* poNewFieldDefn, int nFlagsIn );
    00133
    00134     virtual OGRErr      CreateGeomField( OGRGeomFieldDefn *poField,
    00135                                      int bApproxOK = TRUE );
    00136
    00137     virtual OGRErr      SyncToDisk();
    00138
    00139     virtual OGRStyleTable *GetStyleTable();
    00140     virtual void        SetStyleTableDirectly( OGRStyleTable *poStyleTable );
    00141
    00142     virtual void        SetStyleTable(OGRStyleTable *poStyleTable);
    00143
    00144     virtual OGRErr      StartTransaction();
    00145     virtual OGRErr      CommitTransaction();
    00146     virtual OGRErr      RollbackTransaction();
    00147
    00148     virtual const char *GetFIDColumn();
    00149     virtual const char *GetGeometryColumn();
    00150
    00151     virtual OGRErr      SetIgnoredFields( const char **papszFields );
    00152
    00153     OGRErr              Intersection( OGRLayer *pLayerMethod,
    00154                                       OGRLayer *pLayerResult,
    00155                                       char** papszOptions = NULL,
    00156                                       GDALProgressFunc pfnProgress = NULL,
    00157                                       void * pProgressArg = NULL );
    00158     OGRErr              Union( OGRLayer *pLayerMethod,
    00159                                OGRLayer *pLayerResult,
    00160                                char** papszOptions = NULL,
    00161                                GDALProgressFunc pfnProgress = NULL,
    00162                                void * pProgressArg = NULL );
    00163     OGRErr              SymDifference( OGRLayer *pLayerMethod,
    00164                                        OGRLayer *pLayerResult,
    00165                                        char** papszOptions,
    00166                                        GDALProgressFunc pfnProgress,
    00167                                        void * pProgressArg );
    00168     OGRErr              Identity( OGRLayer *pLayerMethod,
    00169                                   OGRLayer *pLayerResult,
    00170                                   char** papszOptions = NULL,
    00171                                   GDALProgressFunc pfnProgress = NULL,
    00172                                   void * pProgressArg = NULL );
    00173     OGRErr              Update( OGRLayer *pLayerMethod,
    00174                                 OGRLayer *pLayerResult,
    00175                                 char** papszOptions = NULL,
    00176                                 GDALProgressFunc pfnProgress = NULL,
    00177                                 void * pProgressArg = NULL );
    00178     OGRErr              Clip( OGRLayer *pLayerMethod,
    00179                               OGRLayer *pLayerResult,
    00180                               char** papszOptions = NULL,
    00181                               GDALProgressFunc pfnProgress = NULL,
    00182                               void * pProgressArg = NULL );
    00183     OGRErr              Erase( OGRLayer *pLayerMethod,
    00184                                OGRLayer *pLayerResult,
    00185                                char** papszOptions = NULL,
    00186                                GDALProgressFunc pfnProgress = NULL,
    00187                                void * pProgressArg = NULL );
    00188
    00189     int                 Reference();
    00190     int                 Dereference();
    00191     int                 GetRefCount() const;
    00192
    00193     GIntBig             GetFeaturesRead();
    00194
    00195     /* non virtual : conveniency wrapper for ReorderFields() */
    00196     OGRErr              ReorderField( int iOldFieldPos, int iNewFieldPos );
    00197
    00198     int                 AttributeFilterEvaluationNeedsGeometry();
    00199
    00200     /* consider these private */
    00201     OGRErr               InitializeIndexSupport( const char * );
    00202     OGRLayerAttrIndex   *GetIndex() { return m_poAttrIndex; }
    00203
    00204  protected:
    00205     OGRStyleTable       *m_poStyleTable;
    00206     OGRFeatureQuery     *m_poAttrQuery;
    00207     char                *m_pszAttrQueryString;
    00208     OGRLayerAttrIndex   *m_poAttrIndex;
    00209
    00210     int                  m_nRefCount;
    00211
    00212     GIntBig              m_nFeaturesRead;
    00213 };
    00214
    00215 /************************************************************************/
    00216 /*                            OGRDataSource                             */
    00217 /************************************************************************/
    00218
    00238 class CPL_DLL OGRDataSource : public GDALDataset
    00239 {
    00240 public:
    00241                         OGRDataSource();
    00242
    00243     virtual const char  *GetName() OGR_DEPRECATED("Use GDALDataset class instead") = 0;
    00244
    00245     static void         DestroyDataSource( OGRDataSource * ) OGR_DEPRECATED("Use GDALDataset class instead");
    00246 };
    00247
    00248 /************************************************************************/
    00249 /*                             OGRSFDriver                              */
    00250 /************************************************************************/
    00251
    00270 class CPL_DLL OGRSFDriver : public GDALDriver
    00271 {
    00272   public:
    00273     virtual     ~OGRSFDriver();
    00274
    00275     virtual const char  *GetName() OGR_DEPRECATED("Use GDALDriver class instead") = 0;
    00276
    00277     virtual OGRDataSource *Open( const char *pszName, int bUpdate=FALSE ) OGR_DEPRECATED("Use GDALDriver class instead") = 0;
    00278
    00279     virtual int            TestCapability( const char *pszCap ) OGR_DEPRECATED("Use GDALDriver class instead") = 0;
    00280
    00281     virtual OGRDataSource *CreateDataSource( const char *pszName,
    00282                                              char ** = NULL ) OGR_DEPRECATED("Use GDALDriver class instead");
    00283     virtual OGRErr      DeleteDataSource( const char *pszName ) OGR_DEPRECATED("Use GDALDriver class instead");
    00284 };
    00285
    00286
    00287 /************************************************************************/
    00288 /*                         OGRSFDriverRegistrar                         */
    00289 /************************************************************************/
    00290
    00304 class CPL_DLL OGRSFDriverRegistrar
    00305 {
    00306
    00307                 OGRSFDriverRegistrar();
    00308                 ~OGRSFDriverRegistrar();
    00309
    00310     static GDALDataset* OpenWithDriverArg(GDALDriver* poDriver,
    00311                                                  GDALOpenInfo* poOpenInfo);
    00312     static GDALDataset* CreateVectorOnly( GDALDriver* poDriver,
    00313                                           const char * pszName,
    00314                                           char ** papszOptions );
    00315     static CPLErr       DeleteDataSource( GDALDriver* poDriver,
    00316                                           const char * pszName );
    00317
    00318   public:
    00319
    00320     static OGRSFDriverRegistrar *GetRegistrar() OGR_DEPRECATED("Use GDALDriverManager class instead");
    00321
    00322     void        RegisterDriver( OGRSFDriver * poDriver ) OGR_DEPRECATED("Use GDALDriverManager class instead");
    00323
    00324     int         GetDriverCount( void ) OGR_DEPRECATED("Use GDALDriverManager class instead");
    00325     GDALDriver *GetDriver( int iDriver ) OGR_DEPRECATED("Use GDALDriverManager class instead");
    00326     GDALDriver *GetDriverByName( const char * ) OGR_DEPRECATED("Use GDALDriverManager class instead");
    00327
    00328     int         GetOpenDSCount() OGR_DEPRECATED("Use GDALDriverManager class instead");
    00329     OGRDataSource *GetOpenDS( int ) OGR_DEPRECATED("Use GDALDriverManager class instead");
    00330 };
    00331
    00332 /* -------------------------------------------------------------------- */
    00333 /*      Various available registration methods.                         */
    00334 /* -------------------------------------------------------------------- */
    00335 CPL_C_START
    00336 void CPL_DLL OGRRegisterAll();
    00337 void OGRRegisterAllInternal();
    00338
    00339 void CPL_DLL RegisterOGRFileGDB();
    00340 void CPL_DLL RegisterOGRShape();
    00341 void CPL_DLL RegisterOGRNTF();
    00342 void CPL_DLL RegisterOGRFME();
    00343 void CPL_DLL RegisterOGRSDTS();
    00344 void CPL_DLL RegisterOGRTiger();
    00345 void CPL_DLL RegisterOGRS57();
    00346 void CPL_DLL RegisterOGRTAB();
    00347 void CPL_DLL RegisterOGRMIF();
    00348 void CPL_DLL RegisterOGROGDI();
    00349 void CPL_DLL RegisterOGRODBC();
    00350 void CPL_DLL RegisterOGRWAsP();
    00351 void CPL_DLL RegisterOGRPG();
    00352 void CPL_DLL RegisterOGRMSSQLSpatial();
    00353 void CPL_DLL RegisterOGRMySQL();
    00354 void CPL_DLL RegisterOGROCI();
    00355 void CPL_DLL RegisterOGRDGN();
    00356 void CPL_DLL RegisterOGRGML();
    00357 void CPL_DLL RegisterOGRLIBKML();
    00358 void CPL_DLL RegisterOGRKML();
    00359 void CPL_DLL RegisterOGRGeoJSON();
    00360 void CPL_DLL RegisterOGRAVCBin();
    00361 void CPL_DLL RegisterOGRAVCE00();
    00362 void CPL_DLL RegisterOGRREC();
    00363 void CPL_DLL RegisterOGRMEM();
    00364 void CPL_DLL RegisterOGRVRT();
    00365 void CPL_DLL RegisterOGRDODS();
    00366 void CPL_DLL RegisterOGRSQLite();
    00367 void CPL_DLL RegisterOGRCSV();
    00368 void CPL_DLL RegisterOGRILI1();
    00369 void CPL_DLL RegisterOGRILI2();
    00370 void CPL_DLL RegisterOGRGRASS();
    00371 void CPL_DLL RegisterOGRPGeo();
    00372 void CPL_DLL RegisterOGRDXFDWG();
    00373 void CPL_DLL RegisterOGRDXF();
    00374 void CPL_DLL RegisterOGRDWG();
    00375 void CPL_DLL RegisterOGRSDE();
    00376 void CPL_DLL RegisterOGRIDB();
    00377 void CPL_DLL RegisterOGRGMT();
    00378 void CPL_DLL RegisterOGRBNA();
    00379 void CPL_DLL RegisterOGRGPX();
    00380 void CPL_DLL RegisterOGRGeoconcept();
    00381 void CPL_DLL RegisterOGRIngres();
    00382 void CPL_DLL RegisterOGRXPlane();
    00383 void CPL_DLL RegisterOGRNAS();
    00384 void CPL_DLL RegisterOGRGeoRSS();
    00385 void CPL_DLL RegisterOGRGTM();
    00386 void CPL_DLL RegisterOGRVFK();
    00387 void CPL_DLL RegisterOGRPGDump();
    00388 void CPL_DLL RegisterOGROSM();
    00389 void CPL_DLL RegisterOGRGPSBabel();
    00390 void CPL_DLL RegisterOGRSUA();
    00391 void CPL_DLL RegisterOGROpenAir();
    00392 void CPL_DLL RegisterOGRPDS();
    00393 void CPL_DLL RegisterOGRWFS();
    00394 void CPL_DLL RegisterOGRSOSI();
    00395 void CPL_DLL RegisterOGRHTF();
    00396 void CPL_DLL RegisterOGRAeronavFAA();
    00397 void CPL_DLL RegisterOGRGeomedia();
    00398 void CPL_DLL RegisterOGRMDB();
    00399 void CPL_DLL RegisterOGREDIGEO();
    00400 void CPL_DLL RegisterOGRGFT();
    00401 void CPL_DLL RegisterOGRGME();
    00402 void CPL_DLL RegisterOGRSVG();
    00403 void CPL_DLL RegisterOGRCouchDB();
    00404 void CPL_DLL RegisterOGRCloudant();
    00405 void CPL_DLL RegisterOGRIdrisi();
    00406 void CPL_DLL RegisterOGRARCGEN();
    00407 void CPL_DLL RegisterOGRSEGUKOOA();
    00408 void CPL_DLL RegisterOGRSEGY();
    00409 void CPL_DLL RegisterOGRXLS();
    00410 void CPL_DLL RegisterOGRODS();
    00411 void CPL_DLL RegisterOGRXLSX();
    00412 void CPL_DLL RegisterOGRElastic();
    00413 void CPL_DLL RegisterOGRGeoPackage();
    00414 void CPL_DLL RegisterOGRWalk();
    00415 void CPL_DLL RegisterOGRCartoDB();
    00416 void CPL_DLL RegisterOGRSXF();
    00417 void CPL_DLL RegisterOGROpenFileGDB();
    00418 void CPL_DLL RegisterOGRSelafin();
    00419 void CPL_DLL RegisterOGRJML();
    00420 void CPL_DLL RegisterOGRPLSCENES();
    00421 void CPL_DLL RegisterOGRCSW();
    00422 CPL_C_END
    00423
    00424
    00425 #endif /* ndef _OGRSF_FRMTS_H_INCLUDED */

Generated for GDAL by 1.7.1.