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: 2025-01-18 12:42:00 Functions: 4 5 80.0 %

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

Generated by: LCOV version 1.14