| 1 | /****************************************************************************** |
| 2 | * |
| 3 | * Project: LV BAG Translator |
| 4 | * Purpose: Implements OGRLVBAGLayer. |
| 5 | * Author: Laixer B.V., info at laixer dot com |
| 6 | * |
| 7 | ****************************************************************************** |
| 8 | * Copyright (c) 2020, Laixer B.V. <info at laixer dot com> |
| 9 | * |
| 10 | * SPDX-License-Identifier: MIT |
| 11 | ****************************************************************************/ |
| 12 | |
| 13 | #include "cpl_conv.h"cxx . . $ `<file>/port/cpl_conv.h`/ |
| 14 | #include "ogr_geos.h"cxx . . $ `<file>/ogr/ogr_geos.h`/ |
| 15 | #include "ogr_lvbag.h"cxx . . $ `<file>/ogr/ogrsf_frmts/lvbag/ogr_lvbag.h`/ |
| 16 | #include "ogr_p.h"cxx . . $ `<file>/ogr/ogr_p.h`/ |
| 17 | |
| 18 | constexpr const char *pszSpecificationUrncxx . . $ pszSpecificationUrn. = "urn:ogc:def:crs:EPSG::28992"; |
| 19 | constexpr const size_tcxx . . $ size_t# nDefaultIdentifierSizecxx . . $ nDefaultIdentifierSize. = 16; |
| 20 | |
| 21 | /************************************************************************/ |
| 22 | /* OGRLVBAGLayer() */ |
| 23 | /* */ |
| 24 | /* Note that the OGRLVBAGLayer assumes ownership of the passed */ |
| 25 | /* file pointer. */ |
| 26 | /************************************************************************/ |
| 27 | |
| 28 | OGRLVBAGLayercxx . . $ OGRLVBAGLayer#::OGRLVBAGLayercxx . . $ OGRLVBAGLayer#OGRLVBAGLayer(1454ef78f417a8de).(const char *pszFilename, OGRLayerPoolcxx . . $ OGRLayerPool# *poPoolIn, |
| 29 | char **papszOpenOptions) |
| 30 | : OGRAbstractProxiedLayercxx . . $ OGRAbstractProxiedLayer#{poPoolIn}, poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.{new OGRFeatureDefncxx . . $ OGRFeatureDefn#{}}, |
| 31 | fpcxx . . $ OGRLVBAGLayer#fp.{nullptr}, osFilenamecxx . . $ OGRLVBAGLayer#osFilename.{pszFilename}, eFileDescriptorsStatecxx . . $ OGRLVBAGLayer#eFileDescriptorsState.{FD_CLOSEDcxx . . $ OGRLVBAGLayer#FD_CLOSED.}, |
| 32 | oParsercxx . . $ OGRLVBAGLayer#oParser.{nullptr}, bSchemaOnlycxx . . $ OGRLVBAGLayer#bSchemaOnly.{false}, bHasReadSchemacxx . . $ OGRLVBAGLayer#bHasReadSchema.{false}, |
| 33 | bFixInvalidDatacxx . . $ OGRLVBAGLayer#bFixInvalidData.{ |
| 34 | CPLFetchBool(papszOpenOptions, "AUTOCORRECT_INVALID_DATA", false)}, |
| 35 | bLegacyIdcxx . . $ OGRLVBAGLayer#bLegacyId.{CPLFetchBool(papszOpenOptions, "LEGACY_ID", false)}, |
| 36 | nNextFIDcxx . . $ OGRLVBAGLayer#nNextFID.{0}, nCurrentDepthcxx . . $ OGRLVBAGLayer#nCurrentDepth.{0}, nGeometryElementDepthcxx . . $ OGRLVBAGLayer#nGeometryElementDepth.{0}, |
| 37 | nFeatureCollectionDepthcxx . . $ OGRLVBAGLayer#nFeatureCollectionDepth.{0}, nFeatureElementDepthcxx . . $ OGRLVBAGLayer#nFeatureElementDepth.{0}, |
| 38 | nAttributeElementDepthcxx . . $ OGRLVBAGLayer#nAttributeElementDepth.{0}, |
| 39 | eAddressRefStatecxx . . $ OGRLVBAGLayer#eAddressRefState.{AddressRefStatecxx . . $ OGRLVBAGLayer#AddressRefState#::ADDRESS_PRIMARYcxx . . $ OGRLVBAGLayer#ADDRESS_PRIMARY.}, osElementStringcxx . . $ OGRLVBAGLayer#osElementString.{}, |
| 40 | osAttributeStringcxx . . $ OGRLVBAGLayer#osAttributeString.{}, bCollectDatacxx . . $ OGRLVBAGLayer#bCollectData.{false} |
| 41 | { |
| 42 | SetDescriptioncxx . . $ GDALMajorObject#SetDescription(85c52e162fed56f9).(CPLGetBasenameSafe(pszFilename).c_str()); |
| 43 | |
| 44 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->Referencecxx . . $ OGRFeatureDefn#Reference(b126dc7c1de90089).(); |
| 45 | } |
| 46 | |
| 47 | /************************************************************************/ |
| 48 | /* ~OGRLVBAGLayer() */ |
| 49 | /************************************************************************/ |
| 50 | |
| 51 | OGRLVBAGLayercxx . . $ OGRLVBAGLayer#::~cxx . . $ OGRLVBAGLayer#`~OGRLVBAGLayer`(ced63f7c635d850d).OGRLVBAGLayercxx . . $ OGRLVBAGLayer#() |
| 52 | { |
| 53 | delete m_poFeaturecxx . . $ OGRLVBAGLayer#m_poFeature.; |
| 54 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->Releasecxx . . $ OGRFeatureDefn#Release(49f6e7a06ebc5aa8).(); |
| 55 | OGRLVBAGLayercxx . . $ OGRLVBAGLayer#::CloseUnderlyingLayercxx . . $ OGRLVBAGLayer#CloseUnderlyingLayer(49f6e7a06ebc5aa8).(); |
| 56 | } |
| 57 | |
| 58 | /************************************************************************/ |
| 59 | /* ResetReading() */ |
| 60 | /************************************************************************/ |
| 61 | |
| 62 | void OGRLVBAGLayercxx . . $ OGRLVBAGLayer#::ResetReadingcxx . . $ OGRLVBAGLayer#ResetReading(49f6e7a06ebc5aa8).() |
| 63 | { |
| 64 | if (!TouchLayercxx . . $ OGRLVBAGLayer#TouchLayer(c9857a73d68e59ba).()) |
| 65 | { |
| 66 | return; |
| 67 | } |
| 68 | |
| 69 | VSIRewindL(fpcxx . . $ OGRLVBAGLayer#fp.); |
| 70 | |
| 71 | nNextFIDcxx . . $ OGRLVBAGLayer#nNextFID. = 0; |
| 72 | nCurrentDepthcxx . . $ OGRLVBAGLayer#nCurrentDepth. = 0; |
| 73 | nGeometryElementDepthcxx . . $ OGRLVBAGLayer#nGeometryElementDepth. = 0; |
| 74 | nFeatureCollectionDepthcxx . . $ OGRLVBAGLayer#nFeatureCollectionDepth. = 0; |
| 75 | nFeatureElementDepthcxx . . $ OGRLVBAGLayer#nFeatureElementDepth. = 0; |
| 76 | nAttributeElementDepthcxx . . $ OGRLVBAGLayer#nAttributeElementDepth. = 0; |
| 77 | eAddressRefStatecxx . . $ OGRLVBAGLayer#eAddressRefState. = AddressRefStatecxx . . $ OGRLVBAGLayer#AddressRefState#::ADDRESS_PRIMARYcxx . . $ OGRLVBAGLayer#ADDRESS_PRIMARY.; |
| 78 | bCollectDatacxx . . $ OGRLVBAGLayer#bCollectData. = false; |
| 79 | } |
| 80 | |
| 81 | /************************************************************************/ |
| 82 | /* GetLayerDefn() */ |
| 83 | /************************************************************************/ |
| 84 | |
| 85 | const OGRFeatureDefncxx . . $ OGRFeatureDefn# *OGRLVBAGLayercxx . . $ OGRLVBAGLayer#::GetLayerDefncxx . . $ OGRLVBAGLayer#GetLayerDefn(448b209f43d15bcc).() const |
| 86 | { |
| 87 | if (!bHasReadSchemacxx . . $ OGRLVBAGLayer#bHasReadSchema.) |
| 88 | { |
| 89 | if (!const_cast<OGRLVBAGLayercxx . . $ OGRLVBAGLayer# *>(this)->TouchLayercxx . . $ OGRLVBAGLayer#TouchLayer(c9857a73d68e59ba).()) |
| 90 | { |
| 91 | return nullptr; |
| 92 | } |
| 93 | |
| 94 | bSchemaOnlycxx . . $ OGRLVBAGLayer#bSchemaOnly. = true; |
| 95 | |
| 96 | const_cast<OGRLVBAGLayercxx . . $ OGRLVBAGLayer# *>(this)->ConfigureParsercxx . . $ OGRLVBAGLayer#ConfigureParser(49f6e7a06ebc5aa8).(); |
| 97 | const_cast<OGRLVBAGLayercxx . . $ OGRLVBAGLayer# *>(this)->ParseDocumentcxx . . $ OGRLVBAGLayer#ParseDocument(49f6e7a06ebc5aa8).(); |
| 98 | } |
| 99 | |
| 100 | return poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.; |
| 101 | } |
| 102 | |
| 103 | /************************************************************************/ |
| 104 | /* XMLTagSplit() */ |
| 105 | /************************************************************************/ |
| 106 | |
| 107 | static inline const char *XMLTagSplitcxx . . $ XMLTagSplit(fb58d2e09a2a1ce6).(const char *pszName) |
| 108 | { |
| 109 | const char *pszTag = pszName; |
| 110 | const char *pszSep = strchr(pszTag, ':'); |
| 111 | if (pszSep) |
| 112 | { |
| 113 | pszTag = pszSep + 1; |
| 114 | } |
| 115 | |
| 116 | return pszTag; |
| 117 | } |
| 118 | |
| 119 | /************************************************************************/ |
| 120 | /* AddSpatialRef() */ |
| 121 | /************************************************************************/ |
| 122 | |
| 123 | void OGRLVBAGLayercxx . . $ OGRLVBAGLayer#::AddSpatialRefcxx . . $ OGRLVBAGLayer#AddSpatialRef(f47ce3f1fe923726).(OGRwkbGeometryType eTypeIn) |
| 124 | { |
| 125 | OGRGeomFieldDefncxx . . $ OGRGeomFieldDefn# *poGeomField = poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->GetGeomFieldDefncxx . . $ OGRFeatureDefn#GetGeomFieldDefn(39768c424f32bab2).(0); |
| 126 | OGRSpatialReferencecxx . . $ OGRSpatialReference# *poSRS = new OGRSpatialReferencecxx . . $ OGRSpatialReference#OGRSpatialReference(85c52e162fed56f9).(); |
| 127 | poSRS->importFromURNcxx . . $ OGRSpatialReference#importFromURN(5c4306d8553b3696).(pszSpecificationUrncxx . . $ pszSpecificationUrn.); |
| 128 | poGeomField->SetSpatialRefcxx . . $ OGRGeomFieldDefn#SetSpatialRef(9ff39b79387a6086).(poSRS); |
| 129 | poGeomField->SetTypecxx . . $ OGRGeomFieldDefn#SetType(f47ce3f1fe923726).(eTypeIn); |
| 130 | poSRS->Releasecxx . . $ OGRSpatialReference#Release(49f6e7a06ebc5aa8).(); |
| 131 | } |
| 132 | |
| 133 | /************************************************************************/ |
| 134 | /* AddIdentifierFieldDefn() */ |
| 135 | /************************************************************************/ |
| 136 | |
| 137 | void OGRLVBAGLayercxx . . $ OGRLVBAGLayer#::AddIdentifierFieldDefncxx . . $ OGRLVBAGLayer#AddIdentifierFieldDefn(49f6e7a06ebc5aa8).() |
| 138 | { |
| 139 | OGRFieldDefncxx . . $ OGRFieldDefn# oField0cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("identificatie", OFTString); |
| 140 | |
| 141 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField0); |
| 142 | } |
| 143 | |
| 144 | /************************************************************************/ |
| 145 | /* AddDocumentFieldDefn() */ |
| 146 | /************************************************************************/ |
| 147 | |
| 148 | void OGRLVBAGLayercxx . . $ OGRLVBAGLayer#::AddDocumentFieldDefncxx . . $ OGRLVBAGLayer#AddDocumentFieldDefn(49f6e7a06ebc5aa8).() |
| 149 | { |
| 150 | OGRFieldDefncxx . . $ OGRFieldDefn# oField0cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("status", OFTString); |
| 151 | OGRFieldDefncxx . . $ OGRFieldDefn# oField1cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("geconstateerd", OFTInteger); |
| 152 | oField1.SetSubTypecxx . . $ OGRFieldDefn#SetSubType(89cba9d8fed1b3f9).(OFSTBoolean); |
| 153 | OGRFieldDefncxx . . $ OGRFieldDefn# oField2cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("documentDatum", OFTDate); |
| 154 | OGRFieldDefncxx . . $ OGRFieldDefn# oField3cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("documentNummer", OFTString); |
| 155 | |
| 156 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField0); |
| 157 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField1); |
| 158 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField2); |
| 159 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField3); |
| 160 | } |
| 161 | |
| 162 | /************************************************************************/ |
| 163 | /* AddOccurrenceFieldDefn() */ |
| 164 | /************************************************************************/ |
| 165 | |
| 166 | void OGRLVBAGLayercxx . . $ OGRLVBAGLayer#::AddOccurrenceFieldDefncxx . . $ OGRLVBAGLayer#AddOccurrenceFieldDefn(49f6e7a06ebc5aa8).() |
| 167 | { |
| 168 | OGRFieldDefncxx . . $ OGRFieldDefn# oField0cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("voorkomenIdentificatie", OFTInteger); |
| 169 | OGRFieldDefncxx . . $ OGRFieldDefn# oField1cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("beginGeldigheid", OFTDate); |
| 170 | OGRFieldDefncxx . . $ OGRFieldDefn# oField2cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("eindGeldigheid", OFTDate); |
| 171 | OGRFieldDefncxx . . $ OGRFieldDefn# oField3cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("tijdstipRegistratie", OFTDateTime); |
| 172 | OGRFieldDefncxx . . $ OGRFieldDefn# oField4cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("eindRegistratie", OFTDateTime); |
| 173 | OGRFieldDefncxx . . $ OGRFieldDefn# oField5cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("tijdstipInactief", OFTDateTime); |
| 174 | OGRFieldDefncxx . . $ OGRFieldDefn# oField6cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("tijdstipRegistratieLV", OFTDateTime); |
| 175 | OGRFieldDefncxx . . $ OGRFieldDefn# oField7cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("tijdstipEindRegistratieLV", OFTDateTime); |
| 176 | OGRFieldDefncxx . . $ OGRFieldDefn# oField8cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("tijdstipInactiefLV", OFTDateTime); |
| 177 | OGRFieldDefncxx . . $ OGRFieldDefn# oField9cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("tijdstipNietBagLV", OFTDateTime); |
| 178 | |
| 179 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField0); |
| 180 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField1); |
| 181 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField2); |
| 182 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField3); |
| 183 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField4); |
| 184 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField5); |
| 185 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField6); |
| 186 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField7); |
| 187 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField8); |
| 188 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField9); |
| 189 | } |
| 190 | |
| 191 | /************************************************************************/ |
| 192 | /* CreateFeatureDefn() */ |
| 193 | /************************************************************************/ |
| 194 | |
| 195 | void OGRLVBAGLayercxx . . $ OGRLVBAGLayer#::CreateFeatureDefncxx . . $ OGRLVBAGLayer#CreateFeatureDefn(85c52e162fed56f9).(const char *pszDataset) |
| 196 | { |
| 197 | if (EQUALcxx . . $ `port/cpl_port.h:532:9`!("pnd", pszDataset)) |
| 198 | { |
| 199 | OGRFieldDefncxx . . $ OGRFieldDefn# oField0cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("oorspronkelijkBouwjaar", OFTInteger); |
| 200 | |
| 201 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField0); |
| 202 | |
| 203 | AddIdentifierFieldDefncxx . . $ OGRLVBAGLayer#AddIdentifierFieldDefn(49f6e7a06ebc5aa8).(); |
| 204 | AddDocumentFieldDefncxx . . $ OGRLVBAGLayer#AddDocumentFieldDefn(49f6e7a06ebc5aa8).(); |
| 205 | AddOccurrenceFieldDefncxx . . $ OGRLVBAGLayer#AddOccurrenceFieldDefn(49f6e7a06ebc5aa8).(); |
| 206 | |
| 207 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->SetNamecxx . . $ OGRFeatureDefn#SetName(85c52e162fed56f9).("Pand"); |
| 208 | SetDescriptioncxx . . $ GDALMajorObject#SetDescription(85c52e162fed56f9).(poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->GetNamecxx . . $ OGRFeatureDefn#GetName(a9f41ea0e82d88cf).()); |
| 209 | |
| 210 | AddSpatialRefcxx . . $ OGRLVBAGLayer#AddSpatialRef(f47ce3f1fe923726).(wkbPolygon); |
| 211 | } |
| 212 | else if (EQUALcxx . . $ `port/cpl_port.h:532:9`!("num", pszDataset)) |
| 213 | { |
| 214 | OGRFieldDefncxx . . $ OGRFieldDefn# oField0cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("huisnummer", OFTInteger); |
| 215 | OGRFieldDefncxx . . $ OGRFieldDefn# oField1cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("huisletter", OFTString); |
| 216 | OGRFieldDefncxx . . $ OGRFieldDefn# oField2cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("huisnummerToevoeging", OFTString); |
| 217 | OGRFieldDefncxx . . $ OGRFieldDefn# oField3cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("postcode", OFTString); |
| 218 | OGRFieldDefncxx . . $ OGRFieldDefn# oField4cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("typeAdresseerbaarObject", OFTString); |
| 219 | OGRFieldDefncxx . . $ OGRFieldDefn# oField5cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("openbareruimteRef", OFTString); |
| 220 | OGRFieldDefncxx . . $ OGRFieldDefn# oField6cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("woonplaatsRef", OFTString); |
| 221 | |
| 222 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField0); |
| 223 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField1); |
| 224 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField2); |
| 225 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField3); |
| 226 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField4); |
| 227 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField5); |
| 228 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField6); |
| 229 | |
| 230 | AddIdentifierFieldDefncxx . . $ OGRLVBAGLayer#AddIdentifierFieldDefn(49f6e7a06ebc5aa8).(); |
| 231 | AddDocumentFieldDefncxx . . $ OGRLVBAGLayer#AddDocumentFieldDefn(49f6e7a06ebc5aa8).(); |
| 232 | AddOccurrenceFieldDefncxx . . $ OGRLVBAGLayer#AddOccurrenceFieldDefn(49f6e7a06ebc5aa8).(); |
| 233 | |
| 234 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->SetNamecxx . . $ OGRFeatureDefn#SetName(85c52e162fed56f9).("Nummeraanduiding"); |
| 235 | SetDescriptioncxx . . $ GDALMajorObject#SetDescription(85c52e162fed56f9).(poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->GetNamecxx . . $ OGRFeatureDefn#GetName(a9f41ea0e82d88cf).()); |
| 236 | } |
| 237 | else if (EQUALcxx . . $ `port/cpl_port.h:532:9`!("lig", pszDataset)) |
| 238 | { |
| 239 | OGRFieldDefncxx . . $ OGRFieldDefn# oField0cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("hoofdadresNummeraanduidingRef", OFTString); |
| 240 | OGRFieldDefncxx . . $ OGRFieldDefn# oField1cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("nevenadresNummeraanduidingRef", OFTStringList); |
| 241 | |
| 242 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField0); |
| 243 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField1); |
| 244 | |
| 245 | AddIdentifierFieldDefncxx . . $ OGRLVBAGLayer#AddIdentifierFieldDefn(49f6e7a06ebc5aa8).(); |
| 246 | AddDocumentFieldDefncxx . . $ OGRLVBAGLayer#AddDocumentFieldDefn(49f6e7a06ebc5aa8).(); |
| 247 | AddOccurrenceFieldDefncxx . . $ OGRLVBAGLayer#AddOccurrenceFieldDefn(49f6e7a06ebc5aa8).(); |
| 248 | |
| 249 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->SetNamecxx . . $ OGRFeatureDefn#SetName(85c52e162fed56f9).("Ligplaats"); |
| 250 | SetDescriptioncxx . . $ GDALMajorObject#SetDescription(85c52e162fed56f9).(poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->GetNamecxx . . $ OGRFeatureDefn#GetName(a9f41ea0e82d88cf).()); |
| 251 | |
| 252 | AddSpatialRefcxx . . $ OGRLVBAGLayer#AddSpatialRef(f47ce3f1fe923726).(wkbPolygon); |
| 253 | } |
| 254 | else if (EQUALcxx . . $ `port/cpl_port.h:532:9`!("sta", pszDataset)) |
| 255 | { |
| 256 | OGRFieldDefncxx . . $ OGRFieldDefn# oField0cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("hoofdadresNummeraanduidingRef", OFTString); |
| 257 | OGRFieldDefncxx . . $ OGRFieldDefn# oField1cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("nevenadresNummeraanduidingRef", OFTStringList); |
| 258 | |
| 259 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField0); |
| 260 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField1); |
| 261 | |
| 262 | AddIdentifierFieldDefncxx . . $ OGRLVBAGLayer#AddIdentifierFieldDefn(49f6e7a06ebc5aa8).(); |
| 263 | AddDocumentFieldDefncxx . . $ OGRLVBAGLayer#AddDocumentFieldDefn(49f6e7a06ebc5aa8).(); |
| 264 | AddOccurrenceFieldDefncxx . . $ OGRLVBAGLayer#AddOccurrenceFieldDefn(49f6e7a06ebc5aa8).(); |
| 265 | |
| 266 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->SetNamecxx . . $ OGRFeatureDefn#SetName(85c52e162fed56f9).("Standplaats"); |
| 267 | SetDescriptioncxx . . $ GDALMajorObject#SetDescription(85c52e162fed56f9).(poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->GetNamecxx . . $ OGRFeatureDefn#GetName(a9f41ea0e82d88cf).()); |
| 268 | |
| 269 | AddSpatialRefcxx . . $ OGRLVBAGLayer#AddSpatialRef(f47ce3f1fe923726).(wkbPolygon); |
| 270 | } |
| 271 | else if (EQUALcxx . . $ `port/cpl_port.h:532:9`!("opr", pszDataset)) |
| 272 | { |
| 273 | OGRFieldDefncxx . . $ OGRFieldDefn# oField0cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("naam", OFTString); |
| 274 | OGRFieldDefncxx . . $ OGRFieldDefn# oField1cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("type", OFTString); |
| 275 | OGRFieldDefncxx . . $ OGRFieldDefn# oField2cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("woonplaatsRef", OFTString); |
| 276 | OGRFieldDefncxx . . $ OGRFieldDefn# oField3cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("verkorteNaam", OFTString); |
| 277 | |
| 278 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField0); |
| 279 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField1); |
| 280 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField2); |
| 281 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField3); |
| 282 | |
| 283 | AddIdentifierFieldDefncxx . . $ OGRLVBAGLayer#AddIdentifierFieldDefn(49f6e7a06ebc5aa8).(); |
| 284 | AddDocumentFieldDefncxx . . $ OGRLVBAGLayer#AddDocumentFieldDefn(49f6e7a06ebc5aa8).(); |
| 285 | AddOccurrenceFieldDefncxx . . $ OGRLVBAGLayer#AddOccurrenceFieldDefn(49f6e7a06ebc5aa8).(); |
| 286 | |
| 287 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->SetNamecxx . . $ OGRFeatureDefn#SetName(85c52e162fed56f9).("Openbareruimte"); |
| 288 | SetDescriptioncxx . . $ GDALMajorObject#SetDescription(85c52e162fed56f9).(poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->GetNamecxx . . $ OGRFeatureDefn#GetName(a9f41ea0e82d88cf).()); |
| 289 | } |
| 290 | else if (EQUALcxx . . $ `port/cpl_port.h:532:9`!("vbo", pszDataset)) |
| 291 | { |
| 292 | OGRFieldDefncxx . . $ OGRFieldDefn# oField0cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("gebruiksdoel", OFTStringList); |
| 293 | OGRFieldDefncxx . . $ OGRFieldDefn# oField1cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("oppervlakte", OFTInteger); |
| 294 | OGRFieldDefncxx . . $ OGRFieldDefn# oField2cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("hoofdadresNummeraanduidingRef", OFTString); |
| 295 | OGRFieldDefncxx . . $ OGRFieldDefn# oField3cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("nevenadresNummeraanduidingRef", OFTStringList); |
| 296 | OGRFieldDefncxx . . $ OGRFieldDefn# oField4cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("pandRef", OFTStringList); |
| 297 | |
| 298 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField0); |
| 299 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField1); |
| 300 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField2); |
| 301 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField3); |
| 302 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField4); |
| 303 | |
| 304 | AddIdentifierFieldDefncxx . . $ OGRLVBAGLayer#AddIdentifierFieldDefn(49f6e7a06ebc5aa8).(); |
| 305 | AddDocumentFieldDefncxx . . $ OGRLVBAGLayer#AddDocumentFieldDefn(49f6e7a06ebc5aa8).(); |
| 306 | AddOccurrenceFieldDefncxx . . $ OGRLVBAGLayer#AddOccurrenceFieldDefn(49f6e7a06ebc5aa8).(); |
| 307 | |
| 308 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->SetNamecxx . . $ OGRFeatureDefn#SetName(85c52e162fed56f9).("Verblijfsobject"); |
| 309 | SetDescriptioncxx . . $ GDALMajorObject#SetDescription(85c52e162fed56f9).(poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->GetNamecxx . . $ OGRFeatureDefn#GetName(a9f41ea0e82d88cf).()); |
| 310 | |
| 311 | AddSpatialRefcxx . . $ OGRLVBAGLayer#AddSpatialRef(f47ce3f1fe923726).(wkbPoint); |
| 312 | } |
| 313 | else if (EQUALcxx . . $ `port/cpl_port.h:532:9`!("wpl", pszDataset)) |
| 314 | { |
| 315 | OGRFieldDefncxx . . $ OGRFieldDefn# oField0cxx . . $ OGRFieldDefn#OGRFieldDefn(786ecb48a0b3b841).("naam", OFTString); |
| 316 | |
| 317 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->AddFieldDefncxx . . $ OGRFeatureDefn#AddFieldDefn(f8bad7d30df65bbb).(&oField0); |
| 318 | |
| 319 | AddIdentifierFieldDefncxx . . $ OGRLVBAGLayer#AddIdentifierFieldDefn(49f6e7a06ebc5aa8).(); |
| 320 | AddDocumentFieldDefncxx . . $ OGRLVBAGLayer#AddDocumentFieldDefn(49f6e7a06ebc5aa8).(); |
| 321 | AddOccurrenceFieldDefncxx . . $ OGRLVBAGLayer#AddOccurrenceFieldDefn(49f6e7a06ebc5aa8).(); |
| 322 | |
| 323 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->SetNamecxx . . $ OGRFeatureDefn#SetName(85c52e162fed56f9).("Woonplaats"); |
| 324 | SetDescriptioncxx . . $ GDALMajorObject#SetDescription(85c52e162fed56f9).(poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->GetNamecxx . . $ OGRFeatureDefn#GetName(a9f41ea0e82d88cf).()); |
| 325 | |
| 326 | AddSpatialRefcxx . . $ OGRLVBAGLayer#AddSpatialRef(f47ce3f1fe923726).(wkbMultiPolygon); |
| 327 | } |
| 328 | else |
| 329 | { |
| 330 | CPLError(CE_Failure, CPLE_AppDefinedcxx . . $ `port/cpl_error.h:108:9`!, |
| 331 | "Parsing LV BAG extract failed : invalid layer definition"); |
| 332 | } |
| 333 | } |
| 334 | |
| 335 | /************************************************************************/ |
| 336 | /* StartDataCollect() */ |
| 337 | /************************************************************************/ |
| 338 | |
| 339 | void OGRLVBAGLayercxx . . $ OGRLVBAGLayer#::StartDataCollectcxx . . $ OGRLVBAGLayer#StartDataCollect(49f6e7a06ebc5aa8).() |
| 340 | { |
| 341 | osElementStringcxx . . $ OGRLVBAGLayer#osElementString..Clear(); |
| 342 | osAttributeStringcxx . . $ OGRLVBAGLayer#osAttributeString..Clear(); |
| 343 | bCollectDatacxx . . $ OGRLVBAGLayer#bCollectData. = true; |
| 344 | } |
| 345 | |
| 346 | /************************************************************************/ |
| 347 | /* StopDataCollect() */ |
| 348 | /************************************************************************/ |
| 349 | |
| 350 | void OGRLVBAGLayercxx . . $ OGRLVBAGLayer#::StopDataCollectcxx . . $ OGRLVBAGLayer#StopDataCollect(49f6e7a06ebc5aa8).() |
| 351 | { |
| 352 | bCollectDatacxx . . $ OGRLVBAGLayer#bCollectData. = false; |
| 353 | osElementStringcxx . . $ OGRLVBAGLayer#osElementString..Trim(); |
| 354 | osAttributeStringcxx . . $ OGRLVBAGLayer#osAttributeString..Trim(); |
| 355 | } |
| 356 | |
| 357 | /************************************************************************/ |
| 358 | /* DataHandlerCbk() */ |
| 359 | /************************************************************************/ |
| 360 | |
| 361 | void OGRLVBAGLayercxx . . $ OGRLVBAGLayer#::DataHandlerCbkcxx . . $ OGRLVBAGLayer#DataHandlerCbk(34d26762b42c433a).(const char *data, int nLen) |
| 362 | { |
| 363 | if (nLen && bCollectDatacxx . . $ OGRLVBAGLayer#bCollectData.) |
| 364 | { |
| 365 | osElementStringcxx . . $ OGRLVBAGLayer#osElementString..append(data, nLen); |
| 366 | } |
| 367 | } |
| 368 | |
| 369 | /************************************************************************/ |
| 370 | /* TouchLayer() */ |
| 371 | /************************************************************************/ |
| 372 | |
| 373 | bool OGRLVBAGLayercxx . . $ OGRLVBAGLayer#::TouchLayercxx . . $ OGRLVBAGLayer#TouchLayer(c9857a73d68e59ba).() |
| 374 | { |
| 375 | poPoolcxx . . $ OGRAbstractProxiedLayer#poPool.->SetLastUsedLayercxx . . $ OGRLayerPool#SetLastUsedLayer(824e035d1a843fc7).(this); |
| 376 | |
| 377 | switch (eFileDescriptorsStatecxx . . $ OGRLVBAGLayer#eFileDescriptorsState.) |
| 378 | { |
| 379 | case FD_OPENEDcxx . . $ OGRLVBAGLayer#FD_OPENED.: |
| 380 | return true; |
| 381 | case FD_CANNOT_REOPENcxx . . $ OGRLVBAGLayer#FD_CANNOT_REOPEN.: |
| 382 | return false; |
| 383 | case FD_CLOSEDcxx . . $ OGRLVBAGLayer#FD_CLOSED.: |
| 384 | break; |
| 385 | } |
| 386 | |
| 387 | fpcxx . . $ OGRLVBAGLayer#fp. = VSIFOpenExL(osFilenamecxx . . $ OGRLVBAGLayer#osFilename., "rb", true); |
| 388 | if (!fpcxx . . $ OGRLVBAGLayer#fp.) |
| 389 | { |
| 390 | CPLError(CE_Warning, CPLE_AppDefinedcxx . . $ `port/cpl_error.h:108:9`!, |
| 391 | "Opening LV BAG extract failed : %s", osFilenamecxx . . $ OGRLVBAGLayer#osFilename..c_str()); |
| 392 | eFileDescriptorsStatecxx . . $ OGRLVBAGLayer#eFileDescriptorsState. = FD_CANNOT_REOPENcxx . . $ OGRLVBAGLayer#FD_CANNOT_REOPEN.; |
| 393 | return false; |
| 394 | } |
| 395 | |
| 396 | eFileDescriptorsStatecxx . . $ OGRLVBAGLayer#eFileDescriptorsState. = FD_OPENEDcxx . . $ OGRLVBAGLayer#FD_OPENED.; |
| 397 | |
| 398 | return true; |
| 399 | } |
| 400 | |
| 401 | /************************************************************************/ |
| 402 | /* CloseUnderlyingLayer() */ |
| 403 | /************************************************************************/ |
| 404 | |
| 405 | void OGRLVBAGLayercxx . . $ OGRLVBAGLayer#::CloseUnderlyingLayercxx . . $ OGRLVBAGLayer#CloseUnderlyingLayer(49f6e7a06ebc5aa8).() |
| 406 | { |
| 407 | if (fpcxx . . $ OGRLVBAGLayer#fp.) |
| 408 | { |
| 409 | VSIFCloseL(fpcxx . . $ OGRLVBAGLayer#fp.); |
| 410 | } |
| 411 | fpcxx . . $ OGRLVBAGLayer#fp. = nullptr; |
| 412 | |
| 413 | eFileDescriptorsStatecxx . . $ OGRLVBAGLayer#eFileDescriptorsState. = FD_CLOSEDcxx . . $ OGRLVBAGLayer#FD_CLOSED.; |
| 414 | } |
| 415 | |
| 416 | /************************************************************************/ |
| 417 | /* startElementCbk() */ |
| 418 | /************************************************************************/ |
| 419 | |
| 420 | void OGRLVBAGLayercxx . . $ OGRLVBAGLayer#::StartElementCbkcxx . . $ OGRLVBAGLayer#StartElementCbk(f8b20542d3163581).(const char *pszName, const char **ppszAttr) |
| 421 | { |
| 422 | if (nFeatureElementDepthcxx . . $ OGRLVBAGLayer#nFeatureElementDepth. > 0 && nAttributeElementDepthcxx . . $ OGRLVBAGLayer#nAttributeElementDepth. > 0 && |
| 423 | nGeometryElementDepthcxx . . $ OGRLVBAGLayer#nGeometryElementDepth. == 0 && EQUALcxx . . $ `port/cpl_port.h:532:9`!("objecten:geometrie", pszName)) |
| 424 | { |
| 425 | nGeometryElementDepthcxx . . $ OGRLVBAGLayer#nGeometryElementDepth. = nCurrentDepthcxx . . $ OGRLVBAGLayer#nCurrentDepth.; |
| 426 | StartDataCollectcxx . . $ OGRLVBAGLayer#StartDataCollect(49f6e7a06ebc5aa8).(); |
| 427 | } |
| 428 | else if (nFeatureElementDepthcxx . . $ OGRLVBAGLayer#nFeatureElementDepth. > 0 && nAttributeElementDepthcxx . . $ OGRLVBAGLayer#nAttributeElementDepth. > 0 && |
| 429 | nGeometryElementDepthcxx . . $ OGRLVBAGLayer#nGeometryElementDepth. + 1 == nCurrentDepthcxx . . $ OGRLVBAGLayer#nCurrentDepth. && |
| 430 | !STARTS_WITH_CIcxx . . $ `port/cpl_port.h:543:9`!(pszName, "gml")) |
| 431 | { |
| 432 | nGeometryElementDepthcxx . . $ OGRLVBAGLayer#nGeometryElementDepth. = nCurrentDepthcxx . . $ OGRLVBAGLayer#nCurrentDepth.; |
| 433 | StartDataCollectcxx . . $ OGRLVBAGLayer#StartDataCollect(49f6e7a06ebc5aa8).(); |
| 434 | } |
| 435 | else if (nFeatureElementDepthcxx . . $ OGRLVBAGLayer#nFeatureElementDepth. > 0 && nAttributeElementDepthcxx . . $ OGRLVBAGLayer#nAttributeElementDepth. == 0 && |
| 436 | nGeometryElementDepthcxx . . $ OGRLVBAGLayer#nGeometryElementDepth. == 0 && STARTS_WITH_CIcxx . . $ `port/cpl_port.h:543:9`!(pszName, "objecten")) |
| 437 | nAttributeElementDepthcxx . . $ OGRLVBAGLayer#nAttributeElementDepth. = nCurrentDepthcxx . . $ OGRLVBAGLayer#nCurrentDepth.; |
| 438 | else if (nFeatureElementDepthcxx . . $ OGRLVBAGLayer#nFeatureElementDepth. > 0 && nAttributeElementDepthcxx . . $ OGRLVBAGLayer#nAttributeElementDepth. > 0 && |
| 439 | nGeometryElementDepthcxx . . $ OGRLVBAGLayer#nGeometryElementDepth. == 0 && |
| 440 | (EQUALcxx . . $ `port/cpl_port.h:532:9`!("objecten:identificatie", pszName) || |
| 441 | STARTS_WITH_CIcxx . . $ `port/cpl_port.h:543:9`!(pszName, "objecten-ref"))) |
| 442 | { |
| 443 | StartDataCollectcxx . . $ OGRLVBAGLayer#StartDataCollect(49f6e7a06ebc5aa8).(); |
| 444 | const char **papszIter = ppszAttr; |
| 445 | while (papszIter && *papszIter != nullptr) |
| 446 | { |
| 447 | if (EQUALcxx . . $ `port/cpl_port.h:532:9`!("domein", papszIter[0])) |
| 448 | { |
| 449 | osAttributeStringcxx . . $ OGRLVBAGLayer#osAttributeString. = papszIter[1]; |
| 450 | break; |
| 451 | } |
| 452 | papszIter += 2; |
| 453 | } |
| 454 | } |
| 455 | else if (nFeatureElementDepthcxx . . $ OGRLVBAGLayer#nFeatureElementDepth. > 0 && nAttributeElementDepthcxx . . $ OGRLVBAGLayer#nAttributeElementDepth. > 0 && |
| 456 | nGeometryElementDepthcxx . . $ OGRLVBAGLayer#nGeometryElementDepth. == 0 && |
| 457 | EQUALcxx . . $ `port/cpl_port.h:532:9`!("objecten:heeftalshoofdadres", pszName)) |
| 458 | eAddressRefStatecxx . . $ OGRLVBAGLayer#eAddressRefState. = AddressRefStatecxx . . $ OGRLVBAGLayer#AddressRefState#::ADDRESS_PRIMARYcxx . . $ OGRLVBAGLayer#ADDRESS_PRIMARY.; |
| 459 | else if (nFeatureElementDepthcxx . . $ OGRLVBAGLayer#nFeatureElementDepth. > 0 && nAttributeElementDepthcxx . . $ OGRLVBAGLayer#nAttributeElementDepth. > 0 && |
| 460 | nGeometryElementDepthcxx . . $ OGRLVBAGLayer#nGeometryElementDepth. == 0 && |
| 461 | EQUALcxx . . $ `port/cpl_port.h:532:9`!("objecten:heeftalsnevenadres", pszName)) |
| 462 | eAddressRefStatecxx . . $ OGRLVBAGLayer#eAddressRefState. = AddressRefStatecxx . . $ OGRLVBAGLayer#AddressRefState#::ADDRESS_SECONDARYcxx . . $ OGRLVBAGLayer#ADDRESS_SECONDARY.; |
| 463 | else if (nFeatureElementDepthcxx . . $ OGRLVBAGLayer#nFeatureElementDepth. > 0 && nAttributeElementDepthcxx . . $ OGRLVBAGLayer#nAttributeElementDepth. > 0 && |
| 464 | nGeometryElementDepthcxx . . $ OGRLVBAGLayer#nGeometryElementDepth. == 0) |
| 465 | StartDataCollectcxx . . $ OGRLVBAGLayer#StartDataCollect(49f6e7a06ebc5aa8).(); |
| 466 | else if (nGeometryElementDepthcxx . . $ OGRLVBAGLayer#nGeometryElementDepth. > 0 && STARTS_WITH_CIcxx . . $ `port/cpl_port.h:543:9`!(pszName, "gml")) |
| 467 | { |
| 468 | osElementStringcxx . . $ OGRLVBAGLayer#osElementString. += "<"; |
| 469 | osElementStringcxx . . $ OGRLVBAGLayer#osElementString. += pszName; |
| 470 | |
| 471 | const char **papszIter = ppszAttr; |
| 472 | while (papszIter && *papszIter != nullptr) |
| 473 | { |
| 474 | OGRGeomFieldDefncxx . . $ OGRGeomFieldDefn# *poGeomField = poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->GetGeomFieldDefncxx . . $ OGRFeatureDefn#GetGeomFieldDefn(39768c424f32bab2).(0); |
| 475 | if (EQUALcxx . . $ `port/cpl_port.h:532:9`!("srsname", papszIter[0]) && |
| 476 | poGeomField->GetSpatialRefcxx . . $ OGRGeomFieldDefn#GetSpatialRef(8a5496c2eeefaeaf).() == nullptr) |
| 477 | { |
| 478 | OGRSpatialReferencecxx . . $ OGRSpatialReference# *poSRS = new OGRSpatialReferencecxx . . $ OGRSpatialReference#OGRSpatialReference(85c52e162fed56f9).(); |
| 479 | poSRS->importFromURNcxx . . $ OGRSpatialReference#importFromURN(5c4306d8553b3696).(papszIter[1]); |
| 480 | poGeomField->SetSpatialRefcxx . . $ OGRGeomFieldDefn#SetSpatialRef(9ff39b79387a6086).(poSRS); |
| 481 | poSRS->Releasecxx . . $ OGRSpatialReference#Release(49f6e7a06ebc5aa8).(); |
| 482 | } |
| 483 | |
| 484 | osElementStringcxx . . $ OGRLVBAGLayer#osElementString. += " "; |
| 485 | osElementStringcxx . . $ OGRLVBAGLayer#osElementString. += papszIter[0]; |
| 486 | osElementStringcxx . . $ OGRLVBAGLayer#osElementString. += "=\""; |
| 487 | osElementStringcxx . . $ OGRLVBAGLayer#osElementString. += papszIter[1]; |
| 488 | osElementStringcxx . . $ OGRLVBAGLayer#osElementString. += "\""; |
| 489 | papszIter += 2; |
| 490 | } |
| 491 | |
| 492 | osElementStringcxx . . $ OGRLVBAGLayer#osElementString. += ">"; |
| 493 | } |
| 494 | else if (nFeatureCollectionDepthcxx . . $ OGRLVBAGLayer#nFeatureCollectionDepth. > 0 && nFeatureElementDepthcxx . . $ OGRLVBAGLayer#nFeatureElementDepth. == 0 && |
| 495 | EQUALcxx . . $ `port/cpl_port.h:532:9`!("sl-bag-extract:bagObject", pszName) && bHasReadSchemacxx . . $ OGRLVBAGLayer#bHasReadSchema.) |
| 496 | { |
| 497 | nFeatureElementDepthcxx . . $ OGRLVBAGLayer#nFeatureElementDepth. = nCurrentDepthcxx . . $ OGRLVBAGLayer#nCurrentDepth.; |
| 498 | m_poFeaturecxx . . $ OGRLVBAGLayer#m_poFeature. = new OGRFeaturecxx . . $ OGRFeature#OGRFeature(dc2636911e7adfe).(poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.); |
| 499 | m_poFeaturecxx . . $ OGRLVBAGLayer#m_poFeature.->SetFIDcxx . . $ OGRFeature#SetFID(a070d6d14e988596).(nNextFIDcxx . . $ OGRLVBAGLayer#nNextFID.++); |
| 500 | } |
| 501 | else if (nFeatureCollectionDepthcxx . . $ OGRLVBAGLayer#nFeatureCollectionDepth. == 0 && EQUALcxx . . $ `port/cpl_port.h:532:9`!("sl:standBestand", pszName)) |
| 502 | nFeatureCollectionDepthcxx . . $ OGRLVBAGLayer#nFeatureCollectionDepth. = nCurrentDepthcxx . . $ OGRLVBAGLayer#nCurrentDepth.; |
| 503 | else if (nFeatureCollectionDepthcxx . . $ OGRLVBAGLayer#nFeatureCollectionDepth. > 0 && EQUALcxx . . $ `port/cpl_port.h:532:9`!("sl:objectType", pszName)) |
| 504 | StartDataCollectcxx . . $ OGRLVBAGLayer#StartDataCollect(49f6e7a06ebc5aa8).(); |
| 505 | |
| 506 | nCurrentDepthcxx . . $ OGRLVBAGLayer#nCurrentDepth.++; |
| 507 | } |
| 508 | |
| 509 | /************************************************************************/ |
| 510 | /* endElementCbk() */ |
| 511 | /************************************************************************/ |
| 512 | |
| 513 | void OGRLVBAGLayercxx . . $ OGRLVBAGLayer#::EndElementCbkcxx . . $ OGRLVBAGLayer#EndElementCbk(85c52e162fed56f9).(const char *pszName) |
| 514 | { |
| 515 | nCurrentDepthcxx . . $ OGRLVBAGLayer#nCurrentDepth.--; |
| 516 | |
| 517 | if (nCurrentDepthcxx . . $ OGRLVBAGLayer#nCurrentDepth. > nAttributeElementDepthcxx . . $ OGRLVBAGLayer#nAttributeElementDepth. && nAttributeElementDepthcxx . . $ OGRLVBAGLayer#nAttributeElementDepth. > 0 && |
| 518 | nGeometryElementDepthcxx . . $ OGRLVBAGLayer#nGeometryElementDepth. == 0) |
| 519 | { |
| 520 | const char *pszTag = XMLTagSplitcxx . . $ XMLTagSplit(fb58d2e09a2a1ce6).(pszName); |
| 521 | |
| 522 | StopDataCollectcxx . . $ OGRLVBAGLayer#StopDataCollect(49f6e7a06ebc5aa8).(); |
| 523 | if (!osElementStringcxx . . $ OGRLVBAGLayer#osElementString..empty()) |
| 524 | { |
| 525 | int iFieldIndex = poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->GetFieldIndexcxx . . $ OGRFeatureDefn#GetFieldIndex(78f035161ffa9fe2).(pszTag); |
| 526 | |
| 527 | if (EQUALcxx . . $ `port/cpl_port.h:532:9`!("nummeraanduidingref", pszTag)) |
| 528 | { |
| 529 | switch (eAddressRefStatecxx . . $ OGRLVBAGLayer#eAddressRefState.) |
| 530 | { |
| 531 | case AddressRefStatecxx . . $ OGRLVBAGLayer#AddressRefState#::ADDRESS_SECONDARYcxx . . $ OGRLVBAGLayer#ADDRESS_SECONDARY.: |
| 532 | iFieldIndex = poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->GetFieldIndexcxx . . $ OGRFeatureDefn#GetFieldIndex(78f035161ffa9fe2).( |
| 533 | "nevenadresnummeraanduidingref"); |
| 534 | break; |
| 535 | |
| 536 | default: |
| 537 | iFieldIndex = poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->GetFieldIndexcxx . . $ OGRFeatureDefn#GetFieldIndex(78f035161ffa9fe2).( |
| 538 | "hoofdadresnummeraanduidingref"); |
| 539 | break; |
| 540 | } |
| 541 | } |
| 542 | |
| 543 | if (EQUALcxx . . $ `port/cpl_port.h:532:9`!("identificatie", pszTag) || |
| 544 | STARTS_WITH_CIcxx . . $ `port/cpl_port.h:543:9`!(pszName, "objecten-ref")) |
| 545 | { |
| 546 | bool bIsIdInvalid = false; |
| 547 | if (osElementStringcxx . . $ OGRLVBAGLayer#osElementString..size() == nDefaultIdentifierSizecxx . . $ nDefaultIdentifierSize. - 1) |
| 548 | { |
| 549 | osElementStringcxx . . $ OGRLVBAGLayer#osElementString. = '0' + osElementStringcxx . . $ OGRLVBAGLayer#osElementString.; |
| 550 | } |
| 551 | else if (osElementStringcxx . . $ OGRLVBAGLayer#osElementString..size() > nDefaultIdentifierSizecxx . . $ nDefaultIdentifierSize.) |
| 552 | { |
| 553 | bIsIdInvalid = true; |
| 554 | m_poFeaturecxx . . $ OGRLVBAGLayer#m_poFeature.->SetFieldNullcxx . . $ OGRFeature#SetFieldNull(d4f767463ce0a6b3).(iFieldIndex); |
| 555 | CPLError(CE_Warning, CPLE_AppDefinedcxx . . $ `port/cpl_error.h:108:9`!, |
| 556 | "Invalid identificatie : %s, value set to null", |
| 557 | osElementStringcxx . . $ OGRLVBAGLayer#osElementString..c_str()); |
| 558 | } |
| 559 | if (!bIsIdInvalid) |
| 560 | { |
| 561 | if (!bLegacyIdcxx . . $ OGRLVBAGLayer#bLegacyId. && !osAttributeStringcxx . . $ OGRLVBAGLayer#osAttributeString..empty()) |
| 562 | { |
| 563 | osElementStringcxx . . $ OGRLVBAGLayer#osElementString. = |
| 564 | osAttributeStringcxx . . $ OGRLVBAGLayer#osAttributeString. + '.' + osElementStringcxx . . $ OGRLVBAGLayer#osElementString.; |
| 565 | } |
| 566 | } |
| 567 | } |
| 568 | |
| 569 | if (iFieldIndex > -1) |
| 570 | { |
| 571 | const OGRFieldDefncxx . . $ OGRFieldDefn# *poFieldDefn = |
| 572 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->GetFieldDefncxx . . $ OGRFeatureDefn#GetFieldDefn(2ec36f91b6ceefc7).(iFieldIndex); |
| 573 | if (poFieldDefn->GetTypecxx . . $ OGRFieldDefn#GetType(b365ab774e05458e).() == OFTStringList) |
| 574 | { |
| 575 | if (m_poFeaturecxx . . $ OGRLVBAGLayer#m_poFeature.->IsFieldSetAndNotNullcxx . . $ OGRFeature#IsFieldSetAndNotNull(4a668f6de69bf818).(iFieldIndex)) |
| 576 | { |
| 577 | CPLStringList aoList; |
| 578 | char **papszIter = |
| 579 | m_poFeaturecxx . . $ OGRLVBAGLayer#m_poFeature.->GetFieldAsStringListcxx . . $ OGRFeature#GetFieldAsStringList(824a51168b013904).(iFieldIndex); |
| 580 | while (papszIter != nullptr && *papszIter != nullptr) |
| 581 | { |
| 582 | aoList.AddString(*papszIter); |
| 583 | papszIter++; |
| 584 | } |
| 585 | |
| 586 | aoList.AddString(osElementStringcxx . . $ OGRLVBAGLayer#osElementString..c_str()); |
| 587 | m_poFeaturecxx . . $ OGRLVBAGLayer#m_poFeature.->UnsetFieldcxx . . $ OGRFeature#UnsetField(d4f767463ce0a6b3).(iFieldIndex); |
| 588 | m_poFeaturecxx . . $ OGRLVBAGLayer#m_poFeature.->SetFieldcxx . . $ OGRFeature#SetField(5151383285df94d8).(iFieldIndex, aoList.List()); |
| 589 | } |
| 590 | else |
| 591 | m_poFeaturecxx . . $ OGRLVBAGLayer#m_poFeature.->SetFieldcxx . . $ OGRFeature#SetField(66835f578de1bcb3).(iFieldIndex, |
| 592 | osElementStringcxx . . $ OGRLVBAGLayer#osElementString..c_str()); |
| 593 | } |
| 594 | else if (poFieldDefn->GetSubTypecxx . . $ OGRFieldDefn#GetSubType(4db5e065ad90bc77).() == |
| 595 | OGRFieldSubType::OFSTBoolean) |
| 596 | { |
| 597 | if (EQUALcxx . . $ `port/cpl_port.h:532:9`!("n", osElementString.c_str())) |
| 598 | m_poFeaturecxx . . $ OGRLVBAGLayer#m_poFeature.->SetFieldcxx . . $ OGRFeature#SetField(3e454b8ccf442868).(iFieldIndex, 0); |
| 599 | else if (EQUALcxx . . $ `port/cpl_port.h:532:9`!("j", osElementString.c_str())) |
| 600 | m_poFeaturecxx . . $ OGRLVBAGLayer#m_poFeature.->SetFieldcxx . . $ OGRFeature#SetField(3e454b8ccf442868).(iFieldIndex, 1); |
| 601 | else |
| 602 | { |
| 603 | CPLError(CE_Failure, CPLE_AppDefinedcxx . . $ `port/cpl_error.h:108:9`!, |
| 604 | "Parsing boolean failed"); |
| 605 | XML_StopParser(oParsercxx . . $ OGRLVBAGLayer#oParser..get(), XML_FALSEcxx . . $ `ogr/ogr_expat.h:33:9`!); |
| 606 | } |
| 607 | } |
| 608 | else |
| 609 | m_poFeaturecxx . . $ OGRLVBAGLayer#m_poFeature.->SetFieldcxx . . $ OGRFeature#SetField(66835f578de1bcb3).(iFieldIndex, osElementStringcxx . . $ OGRLVBAGLayer#osElementString..c_str()); |
| 610 | |
| 611 | if (bFixInvalidDatacxx . . $ OGRLVBAGLayer#bFixInvalidData. && (poFieldDefn->GetTypecxx . . $ OGRFieldDefn#GetType(b365ab774e05458e).() == OFTDate || |
| 612 | poFieldDefn->GetTypecxx . . $ OGRFieldDefn#GetType(b365ab774e05458e).() == OFTDateTime)) |
| 613 | { |
| 614 | int nYear; |
| 615 | m_poFeaturecxx . . $ OGRLVBAGLayer#m_poFeature.->GetFieldAsDateTimecxx . . $ OGRFeature#GetFieldAsDateTime(1dab1b88f79bee8c).( |
| 616 | iFieldIndex, &nYear, nullptr, nullptr, nullptr, nullptr, |
| 617 | static_cast<float *>(nullptr), nullptr); |
| 618 | if (nYear > 2100) |
| 619 | { |
| 620 | m_poFeaturecxx . . $ OGRLVBAGLayer#m_poFeature.->SetFieldNullcxx . . $ OGRFeature#SetFieldNull(d4f767463ce0a6b3).(iFieldIndex); |
| 621 | CPLError(CE_Warning, CPLE_AppDefinedcxx . . $ `port/cpl_error.h:108:9`!, |
| 622 | "Invalid date : %s, value set to null", |
| 623 | osElementStringcxx . . $ OGRLVBAGLayer#osElementString..c_str()); |
| 624 | } |
| 625 | } |
| 626 | } |
| 627 | osElementStringcxx . . $ OGRLVBAGLayer#osElementString..Clear(); |
| 628 | } |
| 629 | } |
| 630 | else if (nAttributeElementDepthcxx . . $ OGRLVBAGLayer#nAttributeElementDepth. == nCurrentDepthcxx . . $ OGRLVBAGLayer#nCurrentDepth.) |
| 631 | nAttributeElementDepthcxx . . $ OGRLVBAGLayer#nAttributeElementDepth. = 0; |
| 632 | else if (nGeometryElementDepthcxx . . $ OGRLVBAGLayer#nGeometryElementDepth. > 0 && nCurrentDepthcxx . . $ OGRLVBAGLayer#nCurrentDepth. > nGeometryElementDepthcxx . . $ OGRLVBAGLayer#nGeometryElementDepth.) |
| 633 | { |
| 634 | osElementStringcxx . . $ OGRLVBAGLayer#osElementString. += "</"; |
| 635 | osElementStringcxx . . $ OGRLVBAGLayer#osElementString. += pszName; |
| 636 | osElementStringcxx . . $ OGRLVBAGLayer#osElementString. += ">"; |
| 637 | } |
| 638 | else if (nGeometryElementDepthcxx . . $ OGRLVBAGLayer#nGeometryElementDepth. == nCurrentDepthcxx . . $ OGRLVBAGLayer#nCurrentDepth.) |
| 639 | { |
| 640 | StopDataCollectcxx . . $ OGRLVBAGLayer#StopDataCollect(49f6e7a06ebc5aa8).(); |
| 641 | if (!osElementStringcxx . . $ OGRLVBAGLayer#osElementString..empty()) |
| 642 | { |
| 643 | stdcxx . . $ std/::unique_ptr<OGRGeometrycxx . . $ OGRGeometry#> poGeom = |
| 644 | stdcxx . . $ std/::unique_ptr<OGRGeometrycxx . . $ OGRGeometry#>(OGRGeometrycxx . . $ OGRGeometry#::FromHandlecxx . . $ OGRGeometry#FromHandle(6c331b48912c44c0).( |
| 645 | OGR_G_CreateFromGML(osElementStringcxx . . $ OGRLVBAGLayer#osElementString..c_str()))); |
| 646 | if (poGeom && !poGeom->IsEmptycxx . . $ OGRGeometry#IsEmpty(455f465bc33b4cdf).()) |
| 647 | { |
| 648 | // The specification only accounts for 2-dimensional datasets |
| 649 | if (poGeom->Is3Dcxx . . $ OGRGeometry#Is3D(455f465bc33b4cdf).()) |
| 650 | poGeom->flattenTo2Dcxx . . $ OGRGeometry#flattenTo2D(49f6e7a06ebc5aa8).(); |
| 651 | |
| 652 | #ifdef HAVE_GEOScxx . . $ `<built-in>:484:9`! |
| 653 | if (bFixInvalidDatacxx . . $ OGRLVBAGLayer#bFixInvalidData. && !poGeom->IsValidcxx . . $ OGRGeometry#IsValid(fe8fea402ba73f22).()) |
| 654 | { |
| 655 | stdcxx . . $ std/::unique_ptr<OGRGeometrycxx . . $ OGRGeometry#> poSubGeom = |
| 656 | stdcxx . . $ std/::unique_ptr<OGRGeometrycxx . . $ OGRGeometry#>{poGeom->MakeValidcxx . . $ OGRGeometry#MakeValid(fb9251b7cc868ac5).()}; |
| 657 | if (poSubGeom && poSubGeom->IsValidcxx . . $ OGRGeometry#IsValid(fe8fea402ba73f22).()) |
| 658 | poGeom.reset(poSubGeom.release()); |
| 659 | } |
| 660 | #endif |
| 661 | |
| 662 | OGRGeomFieldDefncxx . . $ OGRGeomFieldDefn# *poGeomField = |
| 663 | poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->GetGeomFieldDefncxx . . $ OGRFeatureDefn#GetGeomFieldDefn(39768c424f32bab2).(0); |
| 664 | if (!poGeomField->GetSpatialRefcxx . . $ OGRGeomFieldDefn#GetSpatialRef(8a5496c2eeefaeaf).()) |
| 665 | poGeomField->SetSpatialRefcxx . . $ OGRGeomFieldDefn#SetSpatialRef(9ff39b79387a6086).(poGeom->getSpatialReferencecxx . . $ OGRGeometry#getSpatialReference(8a5496c2eeefaeaf).()); |
| 666 | if (poGeomField->GetTypecxx . . $ OGRGeomFieldDefn#GetType(5a40c54c5ff210ce).() == wkbUnknown) |
| 667 | poGeomField->SetTypecxx . . $ OGRGeomFieldDefn#SetType(f47ce3f1fe923726).(poGeom->getGeometryTypecxx . . $ OGRGeometry#getGeometryType(5a40c54c5ff210ce).()); |
| 668 | |
| 669 | if (poGeomField->GetTypecxx . . $ OGRGeomFieldDefn#GetType(5a40c54c5ff210ce).() == wkbPoint) |
| 670 | { |
| 671 | switch (poGeom->getGeometryTypecxx . . $ OGRGeometry#getGeometryType(5a40c54c5ff210ce).()) |
| 672 | { |
| 673 | case wkbPolygon: |
| 674 | case wkbMultiPolygon: |
| 675 | { |
| 676 | auto poPoint = stdcxx . . $ std/::make_unique<OGRPointcxx . . $ OGRPoint#>(); |
| 677 | #ifdef HAVE_GEOScxx . . $ `<built-in>:484:9`! |
| 678 | if (poGeom->Centroidcxx . . $ OGRGeometry#Centroid(1b729af0d38720ec).(poPoint.get()) == OGRERR_NONEcxx . . $ `ogr/ogr_core.h:390:9`!) |
| 679 | poGeom.reset(poPoint.release()); |
| 680 | #else |
| 681 | CPLError(CE_Warning, CPLE_AppDefined, |
| 682 | "Cannot shape geometry, GEOS support not " |
| 683 | "enabled."); |
| 684 | poGeom.reset(poPoint.release()); |
| 685 | #endif |
| 686 | break; |
| 687 | } |
| 688 | |
| 689 | default: |
| 690 | break; |
| 691 | } |
| 692 | } |
| 693 | else if (poGeomField->GetTypecxx . . $ OGRGeomFieldDefn#GetType(5a40c54c5ff210ce).() == wkbMultiPolygon && |
| 694 | poGeom->getGeometryTypecxx . . $ OGRGeometry#getGeometryType(5a40c54c5ff210ce).() == wkbPolygon) |
| 695 | { |
| 696 | auto poMultiPolygon = stdcxx . . $ std/::make_unique<OGRMultiPolygoncxx . . $ OGRMultiPolygon#>(); |
| 697 | poMultiPolygon->addGeometrycxx . . $ OGRGeometryCollection#addGeometry(fed901b2566802ff).(poGeom.get()); |
| 698 | poGeom.reset(poMultiPolygon.release()); |
| 699 | } |
| 700 | else if (poGeomField->GetTypecxx . . $ OGRGeomFieldDefn#GetType(5a40c54c5ff210ce).() == wkbMultiPolygon && |
| 701 | poGeom->getGeometryTypecxx . . $ OGRGeometry#getGeometryType(5a40c54c5ff210ce).() == wkbGeometryCollection && |
| 702 | poGeom->toGeometryCollectioncxx . . $ OGRGeometry#toGeometryCollection(2dc35bba37476a41).()->getNumGeometriescxx . . $ OGRGeometryCollection#getNumGeometries(455f465bc33b4cdf).() > |
| 703 | 0 && |
| 704 | poGeom->toGeometryCollectioncxx . . $ OGRGeometry#toGeometryCollection(2dc35bba37476a41).() |
| 705 | ->getGeometryRefcxx . . $ OGRGeometryCollection#getGeometryRef(ea443ccec24c6360).(0) |
| 706 | ->getGeometryTypecxx . . $ OGRGeometry#getGeometryType(5a40c54c5ff210ce).() == wkbPolygon) |
| 707 | { |
| 708 | auto poMultiPolygon = stdcxx . . $ std/::make_unique<OGRMultiPolygoncxx . . $ OGRMultiPolygon#>(); |
| 709 | for (const auto &poChildGeom : |
| 710 | poGeom->toGeometryCollectioncxx . . $ OGRGeometry#toGeometryCollection(2dc35bba37476a41).()) |
| 711 | poMultiPolygon->addGeometrycxx . . $ OGRGeometryCollection#addGeometry(fed901b2566802ff).(poChildGeom); |
| 712 | poGeom.reset(poMultiPolygon.release()); |
| 713 | } |
| 714 | else if (poGeomField->GetTypecxx . . $ OGRGeomFieldDefn#GetType(5a40c54c5ff210ce).() == wkbPolygon && |
| 715 | (poGeom->getGeometryTypecxx . . $ OGRGeometry#getGeometryType(5a40c54c5ff210ce).() == wkbMultiPolygon || |
| 716 | poGeom->getGeometryTypecxx . . $ OGRGeometry#getGeometryType(5a40c54c5ff210ce).() == wkbGeometryCollection)) |
| 717 | { |
| 718 | const OGRPolygoncxx . . $ OGRPolygon# *poSubGeomLargest = nullptr; |
| 719 | for (const auto &poChildGeom : |
| 720 | poGeom->toGeometryCollectioncxx . . $ OGRGeometry#toGeometryCollection(2dc35bba37476a41).()) |
| 721 | { |
| 722 | if (poChildGeom->getGeometryTypecxx . . $ OGRGeometry#getGeometryType(5a40c54c5ff210ce).() == wkbPolygon) |
| 723 | { |
| 724 | if (!poSubGeomLargest) |
| 725 | poSubGeomLargest = poChildGeom->toPolygoncxx . . $ OGRGeometry#toPolygon(46ffe497ccba7cf7).(); |
| 726 | else if (poChildGeom->toPolygoncxx . . $ OGRGeometry#toPolygon(46ffe497ccba7cf7).()->get_Areacxx . . $ OGRCurvePolygon#get_Area(21b6c25e127938e2).() > |
| 727 | poSubGeomLargest->get_Areacxx . . $ OGRCurvePolygon#get_Area(21b6c25e127938e2).()) |
| 728 | poSubGeomLargest = poChildGeom->toPolygoncxx . . $ OGRGeometry#toPolygon(46ffe497ccba7cf7).(); |
| 729 | } |
| 730 | } |
| 731 | if (poSubGeomLargest) |
| 732 | poGeom.reset(poSubGeomLargest->clonecxx . . $ OGRPolygon#clone(3639c8651e3b94f9).()); |
| 733 | } |
| 734 | |
| 735 | if (poGeomField->GetSpatialRefcxx . . $ OGRGeomFieldDefn#GetSpatialRef(8a5496c2eeefaeaf).()) |
| 736 | poGeom->assignSpatialReferencecxx . . $ OGRGeometry#assignSpatialReference(9ff39b79387a6086).( |
| 737 | poGeomField->GetSpatialRefcxx . . $ OGRGeomFieldDefn#GetSpatialRef(8a5496c2eeefaeaf).()); |
| 738 | m_poFeaturecxx . . $ OGRLVBAGLayer#m_poFeature.->SetGeometryDirectlycxx . . $ OGRFeature#SetGeometryDirectly(cec3429dca426eb8).(poGeom.release()); |
| 739 | } |
| 740 | else |
| 741 | { |
| 742 | CPLError(CE_Failure, CPLE_AppDefinedcxx . . $ `port/cpl_error.h:108:9`!, |
| 743 | "Parsing geometry as GML failed"); |
| 744 | XML_StopParser(oParsercxx . . $ OGRLVBAGLayer#oParser..get(), XML_FALSEcxx . . $ `ogr/ogr_expat.h:33:9`!); |
| 745 | } |
| 746 | } |
| 747 | |
| 748 | osElementStringcxx . . $ OGRLVBAGLayer#osElementString..Clear(); |
| 749 | osAttributeStringcxx . . $ OGRLVBAGLayer#osAttributeString..Clear(); |
| 750 | nGeometryElementDepthcxx . . $ OGRLVBAGLayer#nGeometryElementDepth. = 0; |
| 751 | } |
| 752 | else if (nFeatureElementDepthcxx . . $ OGRLVBAGLayer#nFeatureElementDepth. == nCurrentDepthcxx . . $ OGRLVBAGLayer#nCurrentDepth.) |
| 753 | { |
| 754 | nFeatureElementDepthcxx . . $ OGRLVBAGLayer#nFeatureElementDepth. = 0; |
| 755 | XML_StopParser(oParsercxx . . $ OGRLVBAGLayer#oParser..get(), XML_TRUEcxx . . $ `ogr/ogr_expat.h:36:9`!); |
| 756 | } |
| 757 | else if (nFeatureCollectionDepthcxx . . $ OGRLVBAGLayer#nFeatureCollectionDepth. == nCurrentDepthcxx . . $ OGRLVBAGLayer#nCurrentDepth.) |
| 758 | nFeatureCollectionDepthcxx . . $ OGRLVBAGLayer#nFeatureCollectionDepth. = 0; |
| 759 | else if (EQUALcxx . . $ `port/cpl_port.h:532:9`!("sl:objecttype", pszName) && !poFeatureDefncxx . . $ OGRLVBAGLayer#poFeatureDefn.->GetFieldCountcxx . . $ OGRFeatureDefn#GetFieldCount(455f465bc33b4cdf).()) |
| 760 | { |
| 761 | StopDataCollectcxx . . $ OGRLVBAGLayer#StopDataCollect(49f6e7a06ebc5aa8).(); |
| 762 | if (osElementStringcxx . . $ OGRLVBAGLayer#osElementString..empty()) |
| 763 | { |
| 764 | CPLError(CE_Failure, CPLE_AppDefinedcxx . . $ `port/cpl_error.h:108:9`!, |
| 765 | "Parsing LV BAG extract failed"); |
| 766 | XML_StopParser(oParsercxx . . $ OGRLVBAGLayer#oParser..get(), XML_FALSEcxx . . $ `ogr/ogr_expat.h:33:9`!); |
| 767 | } |
| 768 | |
| 769 | if (!bHasReadSchemacxx . . $ OGRLVBAGLayer#bHasReadSchema.) |
| 770 | { |
| 771 | CreateFeatureDefncxx . . $ OGRLVBAGLayer#CreateFeatureDefn(85c52e162fed56f9).(osElementStringcxx . . $ OGRLVBAGLayer#osElementString..c_str()); |
| 772 | } |
| 773 | bHasReadSchemacxx . . $ OGRLVBAGLayer#bHasReadSchema. = true; |
| 774 | |
| 775 | // The parser is suspended but never resumed. Stop |
| 776 | // without resume indicated an error. |
| 777 | if (bSchemaOnlycxx . . $ OGRLVBAGLayer#bSchemaOnly.) |
| 778 | { |
| 779 | XML_StopParser(oParsercxx . . $ OGRLVBAGLayer#oParser..get(), XML_TRUEcxx . . $ `ogr/ogr_expat.h:36:9`!); |
| 780 | } |
| 781 | } |
| 782 | } |
| 783 | |
| 784 | /************************************************************************/ |
| 785 | /* ConfigureParser() */ |
| 786 | /************************************************************************/ |
| 787 | |
| 788 | void OGRLVBAGLayercxx . . $ OGRLVBAGLayer#::ConfigureParsercxx . . $ OGRLVBAGLayer#ConfigureParser(49f6e7a06ebc5aa8).() |
| 789 | { |
| 790 | ResetReadingcxx . . $ OGRLVBAGLayer#ResetReading(49f6e7a06ebc5aa8).(); |
| 791 | |
| 792 | const auto startElementWrapper = |
| 793 | [](void *pUserData, const char *pszName, const char **ppszAttr) |
| 794 | { |
| 795 | static_cast<OGRLVBAGLayercxx . . $ OGRLVBAGLayer# *>(pUserData)->StartElementCbkcxx . . $ OGRLVBAGLayer#StartElementCbk(f8b20542d3163581).(pszName, |
| 796 | ppszAttr); |
| 797 | }; |
| 798 | |
| 799 | const auto endElementWrapper = [](void *pUserData, const char *pszName) |
| 800 | { static_cast<OGRLVBAGLayercxx . . $ OGRLVBAGLayer# *>(pUserData)->EndElementCbkcxx . . $ OGRLVBAGLayer#EndElementCbk(85c52e162fed56f9).(pszName); }; |
| 801 | |
| 802 | const auto dataHandlerWrapper = |
| 803 | [](void *pUserData, const XML_Char *data, int nLen) |
| 804 | { static_cast<OGRLVBAGLayercxx . . $ OGRLVBAGLayer# *>(pUserData)->DataHandlerCbkcxx . . $ OGRLVBAGLayer#DataHandlerCbk(34d26762b42c433a).(data, nLen); }; |
| 805 | |
| 806 | oParsercxx . . $ OGRLVBAGLayer#oParser. = OGRExpatUniquePtrcxx . . $ OGRExpatUniquePtr#{OGRCreateExpatXMLParsercxx . . $ OGRCreateExpatXMLParser(eb9b792f23e6a43).()}; |
| 807 | XML_SetElementHandler(oParsercxx . . $ OGRLVBAGLayer#oParser..get(), startElementWrapper, |
| 808 | endElementWrapper); |
| 809 | XML_SetCharacterDataHandler(oParsercxx . . $ OGRLVBAGLayer#oParser..get(), dataHandlerWrapper); |
| 810 | XML_SetUserData(oParsercxx . . $ OGRLVBAGLayer#oParser..get(), this); |
| 811 | } |
| 812 | |
| 813 | /************************************************************************/ |
| 814 | /* IsParserFinished() */ |
| 815 | /************************************************************************/ |
| 816 | |
| 817 | bool OGRLVBAGLayercxx . . $ OGRLVBAGLayer#::IsParserFinishedcxx . . $ OGRLVBAGLayer#IsParserFinished(244311b9c9feb43a).(XML_Status status) |
| 818 | { |
| 819 | switch (status) |
| 820 | { |
| 821 | case XML_STATUS_OKcxx . . $ `<external>/6571220715046160175/expat.h:82:11`!: |
| 822 | return false; |
| 823 | |
| 824 | case XML_STATUS_ERRORcxx . . $ `<external>/6571220715046160175/expat.h:80:11`!: |
| 825 | CPLError( |
| 826 | CE_Failure, CPLE_AppDefinedcxx . . $ `port/cpl_error.h:108:9`!, |
| 827 | "Parsing of LV BAG file failed : %s at line %d, " |
| 828 | "column %d", |
| 829 | XML_ErrorString(XML_GetErrorCode(oParsercxx . . $ OGRLVBAGLayer#oParser..get())), |
| 830 | static_cast<int>(XML_GetCurrentLineNumber(oParsercxx . . $ OGRLVBAGLayer#oParser..get())), |
| 831 | static_cast<int>(XML_GetCurrentColumnNumber(oParsercxx . . $ OGRLVBAGLayer#oParser..get()))); |
| 832 | |
| 833 | delete m_poFeaturecxx . . $ OGRLVBAGLayer#m_poFeature.; |
| 834 | m_poFeaturecxx . . $ OGRLVBAGLayer#m_poFeature. = nullptr; |
| 835 | return true; |
| 836 | |
| 837 | case XML_STATUS_SUSPENDEDcxx . . $ `<external>/6571220715046160175/expat.h:84:11`!: |
| 838 | return true; |
| 839 | } |
| 840 | |
| 841 | return true; |
| 842 | } |
| 843 | |
| 844 | /************************************************************************/ |
| 845 | /* ParseDocument() */ |
| 846 | /************************************************************************/ |
| 847 | |
| 848 | void OGRLVBAGLayercxx . . $ OGRLVBAGLayer#::ParseDocumentcxx . . $ OGRLVBAGLayer#ParseDocument(49f6e7a06ebc5aa8).() |
| 849 | { |
| 850 | while (true) |
| 851 | { |
| 852 | XML_ParsingStatus status; |
| 853 | XML_GetParsingStatus(oParsercxx . . $ OGRLVBAGLayer#oParser..get(), &status); |
| 854 | switch (status.parsing) |
| 855 | { |
| 856 | case XML_INITIALIZED: |
| 857 | case XML_PARSING: |
| 858 | { |
| 859 | const unsigned int nLen = static_cast<unsigned int>( |
| 860 | VSIFReadL(aBufcxx . . $ OGRLVBAGLayer#aBuf..data(), 1, aBufcxx . . $ OGRLVBAGLayer#aBuf..size(), fpcxx . . $ OGRLVBAGLayer#fp.)); |
| 861 | |
| 862 | if (IsParserFinishedcxx . . $ OGRLVBAGLayer#IsParserFinished(244311b9c9feb43a).(XML_Parse(oParsercxx . . $ OGRLVBAGLayer#oParser..get(), aBufcxx . . $ OGRLVBAGLayer#aBuf..data(), nLen, |
| 863 | nLen < aBufcxx . . $ OGRLVBAGLayer#aBuf..size()))) |
| 864 | return; |
| 865 | |
| 866 | break; |
| 867 | } |
| 868 | |
| 869 | case XML_SUSPENDED: |
| 870 | { |
| 871 | if (IsParserFinishedcxx . . $ OGRLVBAGLayer#IsParserFinished(244311b9c9feb43a).(XML_ResumeParser(oParsercxx . . $ OGRLVBAGLayer#oParser..get()))) |
| 872 | return; |
| 873 | |
| 874 | break; |
| 875 | } |
| 876 | |
| 877 | case XML_FINISHED: |
| 878 | default: |
| 879 | return; |
| 880 | } |
| 881 | } |
| 882 | } |
| 883 | |
| 884 | /************************************************************************/ |
| 885 | /* GetNextFeature() */ |
| 886 | /************************************************************************/ |
| 887 | |
| 888 | OGRFeaturecxx . . $ OGRFeature# *OGRLVBAGLayercxx . . $ OGRLVBAGLayer#::GetNextFeaturecxx . . $ OGRLVBAGLayer#GetNextFeature(ec9eceddec1d9563).() |
| 889 | { |
| 890 | if (!TouchLayercxx . . $ OGRLVBAGLayer#TouchLayer(c9857a73d68e59ba).()) |
| 891 | { |
| 892 | return nullptr; |
| 893 | } |
| 894 | |
| 895 | GetLayerDefncxx . . $ OGRLVBAGLayer#GetLayerDefn(448b209f43d15bcc).(); |
| 896 | if (!bHasReadSchemacxx . . $ OGRLVBAGLayer#bHasReadSchema.) |
| 897 | { |
| 898 | CPLError(CE_Failure, CPLE_AppDefinedcxx . . $ `port/cpl_error.h:108:9`!, |
| 899 | "Parsing LV BAG extract failed : invalid layer definition"); |
| 900 | return nullptr; |
| 901 | } |
| 902 | |
| 903 | return OGRGetNextFeatureThroughRawcxx . . $ OGRGetNextFeatureThroughRaw#<OGRLVBAGLayer>::GetNextFeaturecxx . . $ OGRGetNextFeatureThroughRaw#GetNextFeature(ec9eceddec1d9563).(); |
| 904 | } |
| 905 | |
| 906 | /************************************************************************/ |
| 907 | /* GetNextRawFeature() */ |
| 908 | /************************************************************************/ |
| 909 | |
| 910 | OGRFeaturecxx . . $ OGRFeature# *OGRLVBAGLayercxx . . $ OGRLVBAGLayer#::GetNextRawFeaturecxx . . $ OGRLVBAGLayer#GetNextRawFeature(ec9eceddec1d9563).() |
| 911 | { |
| 912 | bSchemaOnlycxx . . $ OGRLVBAGLayer#bSchemaOnly. = false; |
| 913 | |
| 914 | if (nNextFIDcxx . . $ OGRLVBAGLayer#nNextFID. == 0) |
| 915 | { |
| 916 | ConfigureParsercxx . . $ OGRLVBAGLayer#ConfigureParser(49f6e7a06ebc5aa8).(); |
| 917 | } |
| 918 | |
| 919 | if (m_poFeaturecxx . . $ OGRLVBAGLayer#m_poFeature.) |
| 920 | { |
| 921 | delete m_poFeaturecxx . . $ OGRLVBAGLayer#m_poFeature.; |
| 922 | m_poFeaturecxx . . $ OGRLVBAGLayer#m_poFeature. = nullptr; |
| 923 | } |
| 924 | |
| 925 | ParseDocumentcxx . . $ OGRLVBAGLayer#ParseDocument(49f6e7a06ebc5aa8).(); |
| 926 | OGRFeaturecxx . . $ OGRFeature# *poFeatureRet = m_poFeaturecxx . . $ OGRLVBAGLayer#m_poFeature.; |
| 927 | m_poFeaturecxx . . $ OGRLVBAGLayer#m_poFeature. = nullptr; |
| 928 | return poFeatureRet; |
| 929 | } |
| 930 | |
| 931 | /************************************************************************/ |
| 932 | /* TestCapability() */ |
| 933 | /************************************************************************/ |
| 934 | |
| 935 | int OGRLVBAGLayercxx . . $ OGRLVBAGLayer#::TestCapabilitycxx . . $ OGRLVBAGLayer#TestCapability(78f035161ffa9fe2).(const char *pszCap) const |
| 936 | { |
| 937 | if (EQUALcxx . . $ `port/cpl_port.h:532:9`!(pszCap, OLCStringsAsUTF8cxx . . $ `ogr/ogr_core.h:1016:9`!)) |
| 938 | { |
| 939 | return TRUEcxx . . $ `port/cpl_port.h:1184:9`!; |
| 940 | } |
| 941 | |
| 942 | return FALSEcxx . . $ `port/cpl_port.h:1180:9`!; |
| 943 | } |