/src/gdal/ogr/ogrsf_frmts/s101/ogrs101layer.cpp
Line | Count | Source |
1 | | /****************************************************************************** |
2 | | * |
3 | | * Project: S-101 driver |
4 | | * Purpose: Implements OGRS101Layer |
5 | | * Author: Even Rouault <even dot rouault at spatialys.com> |
6 | | * |
7 | | ****************************************************************************** |
8 | | * Copyright (c) 2026, Even Rouault <even dot rouault at spatialys.com> |
9 | | * |
10 | | * SPDX-License-Identifier: MIT |
11 | | ****************************************************************************/ |
12 | | |
13 | | #include "ogr_s101.h" |
14 | | |
15 | | /************************************************************************/ |
16 | | /* OGRS101Layer::OGRS101Layer() */ |
17 | | /************************************************************************/ |
18 | | |
19 | | OGRS101Layer::OGRS101Layer(OGRS101Dataset &oDS, const DDFRecordIndex &oIndex, |
20 | | OGRFeatureDefnRefCountedPtr poFeatureDefn) |
21 | 4.22k | : m_oDS(oDS), m_oIndex(oIndex), m_poFeatureDefn(std::move(poFeatureDefn)) |
22 | 4.22k | { |
23 | 4.22k | SetDescription(m_poFeatureDefn->GetName()); |
24 | 4.22k | } |
25 | | |
26 | | /************************************************************************/ |
27 | | /* OGRS101Layer::~OGRS101Layer() */ |
28 | | /************************************************************************/ |
29 | | |
30 | 4.22k | OGRS101Layer::~OGRS101Layer() = default; |
31 | | |
32 | | /************************************************************************/ |
33 | | /* OGRS101Layer::ResetReading() */ |
34 | | /************************************************************************/ |
35 | | |
36 | | void OGRS101Layer::ResetReading() |
37 | 0 | { |
38 | 0 | m_nRecordIdx = 0; |
39 | 0 | } |
40 | | |
41 | | /************************************************************************/ |
42 | | /* OGRS101Layer::TestCapability() */ |
43 | | /************************************************************************/ |
44 | | |
45 | | int OGRS101Layer::TestCapability(const char *pszCap) const |
46 | 0 | { |
47 | 0 | if (EQUAL(pszCap, OLCFastFeatureCount)) |
48 | 0 | return m_poAttrQuery == nullptr && m_poFilterGeom == nullptr; |
49 | | |
50 | 0 | if (EQUAL(pszCap, OLCStringsAsUTF8)) |
51 | 0 | return true; |
52 | | |
53 | 0 | if (EQUAL(pszCap, OLCZGeometries)) |
54 | 0 | { |
55 | 0 | const auto poSRS = GetSpatialRef(); |
56 | 0 | if (poSRS) |
57 | 0 | return poSRS->IsCompound(); |
58 | 0 | } |
59 | | |
60 | 0 | return false; |
61 | 0 | } |
62 | | |
63 | | /************************************************************************/ |
64 | | /* OGRS101Layer::GetFeatureCount() */ |
65 | | /************************************************************************/ |
66 | | |
67 | | GIntBig OGRS101Layer::GetFeatureCount(int bForce) |
68 | 0 | { |
69 | 0 | if (m_poAttrQuery || m_poFilterGeom) |
70 | 0 | return OGRLayer::GetFeatureCount(bForce); |
71 | 0 | return m_oIndex.GetCount(); |
72 | 0 | } |