LCOV - code coverage report
Current view: top level - ogr/ogrsf_frmts/idrisi - ogr_idrisi.h (source / functions) Hit Total Coverage
Test: gdal_filtered.info Lines: 6 8 75.0 %
Date: 2024-11-21 22:18:42 Functions: 4 5 80.0 %

          Line data    Source code
       1             : /******************************************************************************
       2             :  * $Id$
       3             :  *
       4             :  * Project:  Idrisi Translator
       5             :  * Purpose:  Definition of classes for OGR Idrisi driver.
       6             :  * Author:   Even Rouault, even dot rouault at spatialys.com
       7             :  *
       8             :  ******************************************************************************
       9             :  * Copyright (c) 2011-2012, Even Rouault <even dot rouault at spatialys.com>
      10             :  *
      11             :  * SPDX-License-Identifier: MIT
      12             :  ****************************************************************************/
      13             : 
      14             : #ifndef OGR_IDRISI_H_INCLUDED
      15             : #define OGR_IDRISI_H_INCLUDED
      16             : 
      17             : #include "ogrsf_frmts.h"
      18             : 
      19             : /************************************************************************/
      20             : /*                         OGRIdrisiLayer                               */
      21             : /************************************************************************/
      22             : 
      23             : class OGRIdrisiLayer final : public OGRLayer,
      24             :                              public OGRGetNextFeatureThroughRaw<OGRIdrisiLayer>
      25             : {
      26             :   protected:
      27             :     OGRFeatureDefn *poFeatureDefn;
      28             :     OGRSpatialReference *poSRS;
      29             :     OGRwkbGeometryType eGeomType;
      30             : 
      31             :     VSILFILE *fp;
      32             :     VSILFILE *fpAVL;
      33             :     bool bEOF;
      34             : 
      35             :     int nNextFID;
      36             : 
      37             :     bool bExtentValid;
      38             :     double dfMinX;
      39             :     double dfMinY;
      40             :     double dfMaxX;
      41             :     double dfMaxY;
      42             : 
      43             :     unsigned int nTotalFeatures;
      44             : 
      45             :     bool Detect_AVL_ADC(const char *pszFilename);
      46             :     void ReadAVLLine(OGRFeature *poFeature);
      47             : 
      48             :     OGRFeature *GetNextRawFeature();
      49             : 
      50             :   public:
      51             :     OGRIdrisiLayer(const char *pszFilename, const char *pszLayerName,
      52             :                    VSILFILE *fp, OGRwkbGeometryType eGeomType,
      53             :                    const char *pszWTKString);
      54             :     virtual ~OGRIdrisiLayer();
      55             : 
      56             :     virtual void ResetReading() override;
      57          10 :     DEFINE_GET_NEXT_FEATURE_THROUGH_RAW(OGRIdrisiLayer)
      58             : 
      59          11 :     virtual OGRFeatureDefn *GetLayerDefn() override
      60             :     {
      61          11 :         return poFeatureDefn;
      62             :     }
      63             : 
      64             :     virtual int TestCapability(const char *) override;
      65             : 
      66             :     void SetExtent(double dfMinX, double dfMinY, double dfMaxX, double dfMaxY);
      67             :     virtual OGRErr GetExtent(OGREnvelope *psExtent, int bForce = TRUE) override;
      68             : 
      69           3 :     virtual OGRErr GetExtent(int iGeomField, OGREnvelope *psExtent,
      70             :                              int bForce) override
      71             :     {
      72           3 :         return OGRLayer::GetExtent(iGeomField, psExtent, bForce);
      73             :     }
      74             : 
      75             :     virtual GIntBig GetFeatureCount(int bForce = TRUE) override;
      76             : };
      77             : 
      78             : /************************************************************************/
      79             : /*                        OGRIdrisiDataSource                           */
      80             : /************************************************************************/
      81             : 
      82           3 : class OGRIdrisiDataSource final : public GDALDataset
      83             : {
      84             :     OGRLayer **papoLayers = nullptr;
      85             :     int nLayers = 0;
      86             : 
      87             :   public:
      88             :     OGRIdrisiDataSource();
      89             :     virtual ~OGRIdrisiDataSource();
      90             : 
      91             :     int Open(const char *pszFilename);
      92             : 
      93           0 :     virtual int GetLayerCount() override
      94             :     {
      95           0 :         return nLayers;
      96             :     }
      97             : 
      98             :     virtual OGRLayer *GetLayer(int) override;
      99             : };
     100             : 
     101             : #endif  // ndef OGR_IDRISI_H_INCLUDED

Generated by: LCOV version 1.14