Coverage for gws-app/gws/plugin/alkis/data/types.py: 0%

378 statements  

« prev     ^ index     » next       coverage.py v7.16.2, created at 2026-10-05 13:35 +0200

1"""Data model of the ALKIS index: entities, records, queries and the source reader interface.""" 

2 

3from typing import Optional, Any 

4 

5import gws 

6 

7 

8class EnumPair: 

9 """A code list value with its code and display text.""" 

10 

11 def __init__(self, code, text): 

12 """Create a code list value. 

13 

14 Args: 

15 code: Value code. 

16 text: Display text. 

17 """ 

18 

19 self.code = code 

20 self.text = text 

21 

22 

23class Strasse(gws.Data): 

24 """A street name in a Gemeinde and Gemarkung.""" 

25 

26 name: str 

27 """Street name.""" 

28 gemarkung: EnumPair 

29 """Gemarkung (cadastral district) of the street.""" 

30 gemeinde: EnumPair 

31 """Gemeinde (municipality) of the street.""" 

32 

33 

34class Object: 

35 """Base class for ALKIS data objects. 

36 

37 Keyword arguments passed to the constructor become attributes. 

38 Reading a missing attribute whose name does not start with ``_`` 

39 returns ``None`` instead of raising ``AttributeError``. 

40 """ 

41 

42 uid: str 

43 """Unique id. For ALKIS objects, this is the ALKIS identifier.""" 

44 isHistoric: bool 

45 """Whether the object is historic.""" 

46 

47 def __init__(self, **kwargs): 

48 """Create an object. 

49 

50 Args: 

51 **kwargs: Attribute values. 

52 """ 

53 

54 self.isHistoric = False 

55 self.__dict__.update(kwargs) 

56 

57 

58def _getattr(self, item): 

59 if item.startswith('_'): 

60 raise AttributeError() 

61 return None 

62 

63 

64setattr(Object, '__getattr__', _getattr) 

65 

66 

67class Record(Object): 

68 """A version of an ALKIS object in its life span. 

69 

70 A record is historic when its life span has ended. 

71 """ 

72 

73 anlass: str 

74 """Reason (Anlass) for the change that created this record.""" 

75 beginnt: str 

76 """Start of the record life span.""" 

77 endet: str 

78 """End of the record life span, ``None`` if the record is current.""" 

79 

80 

81class Entity(Object): 

82 """An ALKIS object with a list of records, one per version. 

83 

84 Records are sorted by start date, so the last record is the most recent one. 

85 An entity is historic when all of its records are historic. 

86 """ 

87 

88 recs: list['Record'] 

89 """Records, oldest first.""" 

90 

91 

92class Adresse(Object): 

93 """An address (Lagebezeichnung) found by the address search.""" 

94 

95 land: EnumPair 

96 """Land (federal state).""" 

97 regierungsbezirk: EnumPair 

98 """Regierungsbezirk (administrative region).""" 

99 kreis: EnumPair 

100 """Kreis (district).""" 

101 gemeinde: EnumPair 

102 """Gemeinde (municipality).""" 

103 gemarkung: EnumPair 

104 """Gemarkung (cadastral district).""" 

105 

106 strasse: str 

107 """Street name.""" 

108 hausnummer: str 

109 """House number.""" 

110 

111 x: float 

112 """X coordinate of the address location.""" 

113 y: float 

114 """Y coordinate of the address location.""" 

115 shape: gws.Shape 

116 """Point shape of the address location.""" 

117 

118 

119class FlurstueckRecord(Record): 

120 """A version of a Flurstueck (land parcel).""" 

121 

122 flurnummer: str 

123 """Flur number.""" 

124 zaehler: str 

125 """Numerator of the Flurstueck number.""" 

126 nenner: str 

127 """Denominator of the Flurstueck number.""" 

128 flurstuecksfolge: str 

129 """Flurstueck sequence number.""" 

130 flurstueckskennzeichen: str 

131 """Flurstueck identifier (Flurstueckskennzeichen).""" 

132 

133 land: EnumPair 

134 """Land (federal state).""" 

135 regierungsbezirk: EnumPair 

136 """Regierungsbezirk (administrative region).""" 

137 kreis: EnumPair 

138 """Kreis (district).""" 

139 gemeinde: EnumPair 

140 """Gemeinde (municipality).""" 

141 gemarkung: EnumPair 

142 """Gemarkung (cadastral district).""" 

143 

144 amtlicheFlaeche: float 

145 """Official area in square meters.""" 

146 

147 geom: str 

148 """Geometry as a hex encoded WKB string.""" 

149 geomFlaeche: float 

150 """Area computed from the geometry.""" 

151 x: float 

152 """X coordinate of the geometry centroid.""" 

153 y: float 

154 """Y coordinate of the geometry centroid.""" 

155 

156 abweichenderRechtszustand: bool 

157 """Whether a different legal state exists (abweichender Rechtszustand).""" 

158 rechtsbehelfsverfahren: bool 

159 """Whether a legal remedy procedure is pending (Rechtsbehelfsverfahren).""" 

160 zeitpunktDerEntstehung: str 

161 """Time of creation of the Flurstueck.""" 

162 zustaendigeStelle: list[EnumPair] 

163 """Responsible authorities (Dienststellen).""" 

164 zweifelhafterFlurstuecksnachweis: bool 

165 """Whether the Flurstueck record is doubtful (zweifelhafter Flurstuecksnachweis).""" 

166 nachfolgerFlurstueckskennzeichen: list[str] 

167 """Identifiers of successor Flurstuecke.""" 

168 vorgaengerFlurstueckskennzeichen: list[str] 

169 """Identifiers of predecessor Flurstuecke, computed by the indexer from the successor lists.""" 

170 

171 

172class BuchungsstelleReference(Object): 

173 """A reference from a Buchung to a Buchungsstelle. 

174 

175 A Buchungsstelle referred to by a historic Flurstueck record is not 

176 necessarily historic itself, so the reference has its own historic state, 

177 which follows the Flurstueck record. 

178 """ 

179 

180 buchungsstelle: 'Buchungsstelle' 

181 """Referenced Buchungsstelle.""" 

182 

183 

184class Buchung(Entity): 

185 """Buchungsstellen of a Flurstueck that belong to the same Buchungsblatt.""" 

186 

187 recs: list['BuchungsstelleReference'] 

188 """References to the Buchungsstellen.""" 

189 buchungsblattUid: str 

190 """Uid of the Buchungsblatt.""" 

191 buchungsblatt: 'Buchungsblatt' 

192 """The Buchungsblatt, attached when a Flurstueck is loaded with land register data.""" 

193 

194 

195class Flurstueck(Entity): 

196 """A Flurstueck (land parcel) with its related data.""" 

197 

198 recs: list[FlurstueckRecord] 

199 """Flurstueck records, oldest first.""" 

200 

201 flurstueckskennzeichen: str 

202 """Flurstueck identifier from the most recent record.""" 

203 fsnummer: str 

204 """Display number from the most recent record, see ``index.make_fsnummer``.""" 

205 

206 buchungList: list['Buchung'] 

207 """Land register data, grouped by Buchungsblatt.""" 

208 lageList: list['Lage'] 

209 """Location designations.""" 

210 

211 gebaeudeList: list['Gebaeude'] 

212 """Buildings, found through the location designations.""" 

213 gebaeudeAmtlicheFlaeche: float 

214 """Total official area of the current buildings.""" 

215 gebaeudeGeomFlaeche: float 

216 """Total geometric area of the current buildings.""" 

217 

218 nutzungList: list['Part'] 

219 """Land use (Nutzung) parts.""" 

220 festlegungList: list['Part'] 

221 """Legal designation (Festlegung) parts.""" 

222 bewertungList: list['Part'] 

223 """Soil valuation (Bewertung) parts.""" 

224 

225 geom: Any 

226 """Geometry as read from the index table.""" 

227 x: float 

228 """X coordinate of the centroid of the most recent geometry.""" 

229 y: float 

230 """Y coordinate of the centroid of the most recent geometry.""" 

231 shape: gws.Shape 

232 """Shape of the Flurstueck, created when it is loaded from the index.""" 

233 

234 

235class BuchungsblattRecord(Record): 

236 """A version of a Buchungsblatt (land register sheet).""" 

237 

238 blattart: EnumPair 

239 """Kind of the sheet (Blattart).""" 

240 buchungsart: str 

241 """Kind of the entry (Buchungsart).""" 

242 buchungsblattbezirk: EnumPair 

243 """Buchungsblattbezirk (land register district).""" 

244 buchungsblattkennzeichen: str 

245 """Sheet identifier (Buchungsblattkennzeichen).""" 

246 buchungsblattnummerMitBuchstabenerweiterung: str 

247 """Sheet number with an optional letter suffix.""" 

248 

249 

250class Buchungsblatt(Entity): 

251 """A Buchungsblatt (land register sheet).""" 

252 

253 recs: list[BuchungsblattRecord] 

254 """Buchungsblatt records, oldest first.""" 

255 buchungsstelleList: list['Buchungsstelle'] 

256 """Buchungsstellen in this sheet.""" 

257 namensnummerList: list['Namensnummer'] 

258 """Owner entries in this sheet.""" 

259 buchungsblattkennzeichen: str 

260 """Sheet identifier from the most recent record.""" 

261 

262 

263class BuchungsstelleRecord(Record): 

264 """A version of a Buchungsstelle (land register entry).""" 

265 

266 anteil: str 

267 """Share as a fraction string, e.g. ``1/2``.""" 

268 beschreibungDesSondereigentums: str 

269 """Description of the separate ownership (Sondereigentum).""" 

270 beschreibungDesUmfangsDerBuchung: str 

271 """Description of the extent of the entry.""" 

272 buchungsart: EnumPair 

273 """Kind of the entry (Buchungsart).""" 

274 buchungstext: str 

275 """Entry text.""" 

276 laufendeNummer: str 

277 """Sequence number in the sheet.""" 

278 

279 

280class Buchungsstelle(Entity): 

281 """A Buchungsstelle (land register entry). 

282 

283 Buchungsstellen can refer to parent Buchungsstellen through the ``an`` 

284 and ``zu`` relations in ALKIS. 

285 """ 

286 

287 recs: list[BuchungsstelleRecord] 

288 """Buchungsstelle records, oldest first.""" 

289 buchungsblattUids: list[str] 

290 """Uids of the sheets this entry belongs to.""" 

291 buchungsblattkennzeichenList: list[str] 

292 """Identifiers of the sheets this entry belongs to.""" 

293 parentUids: list[str] 

294 """Uids of the parent Buchungsstellen.""" 

295 childUids: list[str] 

296 """Uids of the child Buchungsstellen.""" 

297 fsUids: list[str] 

298 """Uids of the Flurstuecke booked on this entry.""" 

299 parentkennzeichenList: list[str] 

300 """Identifiers of the parent entries, as ``<buchungsblattkennzeichen>.<laufendeNummer>``.""" 

301 flurstueckskennzeichenList: list[str] 

302 """Identifiers of the Flurstuecke booked on this entry.""" 

303 laufendeNummer: str 

304 """Sequence number from the most recent record.""" 

305 

306 

307class NamensnummerRecord(Record): 

308 """A version of a Namensnummer (owner entry in a land register sheet).""" 

309 

310 anteil: str 

311 """Share as a fraction string, e.g. ``1/2``.""" 

312 artDerRechtsgemeinschaft: EnumPair 

313 """Kind of the joint ownership (Rechtsgemeinschaft).""" 

314 beschriebDerRechtsgemeinschaft: str 

315 """Description of the joint ownership.""" 

316 eigentuemerart: EnumPair 

317 """Kind of the owner.""" 

318 laufendeNummerNachDIN1421: str 

319 """Sequence number according to DIN 1421.""" 

320 nummer: str 

321 """Number.""" 

322 strichblattnummer: int 

323 """Strichblatt number.""" 

324 

325 

326class Namensnummer(Entity): 

327 """A Namensnummer (owner entry in a land register sheet).""" 

328 

329 recs: list[NamensnummerRecord] 

330 """Namensnummer records, oldest first.""" 

331 buchungsblattUids: list[str] 

332 """Uids of the sheets this entry belongs to.""" 

333 buchungsblattkennzeichenList: list[str] 

334 """Identifiers of the sheets this entry belongs to.""" 

335 personList: list['Person'] 

336 """Persons named by this entry.""" 

337 laufendeNummer: str 

338 """Sequence number according to DIN 1421 from the most recent record.""" 

339 

340 

341class PersonRecord(Record): 

342 """A version of a Person (owner).""" 

343 

344 akademischerGrad: str 

345 """Academic title.""" 

346 anrede: str 

347 """Form of address.""" 

348 geburtsdatum: str 

349 """Date of birth.""" 

350 geburtsname: str 

351 """Birth name.""" 

352 nachnameOderFirma: str 

353 """Last name or company name.""" 

354 vorname: str 

355 """First name.""" 

356 

357 

358class Person(Entity): 

359 """A Person (owner), either a natural person or a company.""" 

360 

361 recs: list[PersonRecord] 

362 """Person records, oldest first.""" 

363 anschriftList: list['Anschrift'] 

364 """Postal addresses.""" 

365 

366 

367class AnschriftRecord(Record): 

368 """A version of an Anschrift (postal address of a person).""" 

369 

370 hausnummer: str 

371 """House number.""" 

372 ort: str 

373 """City.""" 

374 plz: str 

375 """Postal code.""" 

376 strasse: str 

377 """Street name.""" 

378 telefon: str 

379 """Phone number, the first one if there are several.""" 

380 

381 

382class Anschrift(Entity): 

383 """An Anschrift (postal address of a person).""" 

384 

385 recs: list[AnschriftRecord] 

386 """Anschrift records, oldest first.""" 

387 

388 

389class LageRecord(Record): 

390 """A version of a Lage (location designation of a Flurstueck).""" 

391 

392 hausnummer: str 

393 """Normalized house number, see ``index.normalize_hausnummer``.""" 

394 laufendeNummer: str 

395 """Sequence number.""" 

396 ortsteil: str 

397 """Locality.""" 

398 pseudonummer: str 

399 """Pseudo number.""" 

400 strasse: str 

401 """Street name.""" 

402 

403 

404class Lage(Entity): 

405 """A Lage (location designation) with or without a house number.""" 

406 

407 recs: list['LageRecord'] 

408 """Lage records, oldest first.""" 

409 gebaeudeList: list['Gebaeude'] 

410 """Buildings that refer to this location.""" 

411 x: float 

412 """X coordinate of the house number label, if any.""" 

413 y: float 

414 """Y coordinate of the house number label, if any.""" 

415 

416 

417class GebaeudeRecord(Record): 

418 """A version of a Gebaeude (building).""" 

419 

420 amtlicheFlaeche: float 

421 """Official area, taken from the building ground area.""" 

422 gebaeudekennzeichen: int 

423 """Building identifier.""" 

424 geom: str 

425 """Geometry as a hex encoded WKB string. Not stored in the index.""" 

426 geomFlaeche: float 

427 """Area computed from the geometry.""" 

428 props: 'GebaeudeProps' 

429 """Descriptive properties.""" 

430 

431 

432class Gebaeude(Entity): 

433 """A Gebaeude (building).""" 

434 

435 recs: list[GebaeudeRecord] 

436 """Gebaeude records, oldest first.""" 

437 

438 

439PART_NUTZUNG = 1 

440PART_BEWERTUNG = 2 

441PART_FESTLEGUNG = 3 

442 

443 

444class PartRecord(Record): 

445 """A version of a Part, limited to one Flurstueck.""" 

446 

447 amtlicheFlaeche: float # corrected 

448 """Area of the part, scaled by the ratio of official to geometric area of the Flurstueck.""" 

449 geom: str 

450 """Geometry as a hex encoded WKB string.""" 

451 geomFlaeche: float 

452 """Area of the intersection geometry.""" 

453 props: 'PartProps' 

454 """Descriptive properties.""" 

455 

456 

457class Part(Entity): 

458 """A part of a Flurstueck covered by a Nutzung, Festlegung or Bewertung object. 

459 

460 Parts are computed by intersecting the geometry of the source object with 

461 the Flurstueck geometry. There is one part per source object and Flurstueck. 

462 """ 

463 

464 KIND = { 

465 PART_NUTZUNG: [ 

466 'Tatsächliche Nutzung', 

467 'tatsaechliche_nutzung', 

468 ], 

469 PART_BEWERTUNG: [ 

470 'Bodenschätzung, Bewertung', 

471 'gesetzliche_festlegungen_gebietseinheiten_kataloge/bodenschaetzung_bewertung', 

472 ], 

473 PART_FESTLEGUNG: [ 

474 'Öffentlich-rechtliche und sonstige Festlegungen', 

475 'gesetzliche_festlegungen_gebietseinheiten_kataloge/oeffentlich_rechtliche_und_sonstige_festlegungen', 

476 ], 

477 } 

478 """Part kinds, mapped to their title and the GeoInfoDok category key of the source objects.""" 

479 

480 recs: list['PartRecord'] 

481 """Part records, oldest first.""" 

482 fs: str 

483 """Uid of the Flurstueck.""" 

484 kind: int 

485 """Kind of the part, one of ``PART_NUTZUNG``, ``PART_BEWERTUNG`` or ``PART_FESTLEGUNG``.""" 

486 name: EnumPair 

487 """Object type of the source object, as GeoInfoDok code and title.""" 

488 amtlicheFlaeche: float 

489 """Corrected area of the last computed intersection.""" 

490 geomFlaeche: float 

491 """Geometric area of the last computed intersection.""" 

492 geom: str 

493 """Last computed intersection geometry as a hex encoded WKB string.""" 

494 

495 

496class PlaceKind(gws.Enum): 

497 """Kind of a place (administrative unit).""" 

498 

499 land = 'land' 

500 """Land (federal state).""" 

501 regierungsbezirk = 'regierungsbezirk' 

502 """Regierungsbezirk (administrative region).""" 

503 kreis = 'kreis' 

504 """Kreis (district).""" 

505 gemeinde = 'gemeinde' 

506 """Gemeinde (municipality).""" 

507 gemarkung = 'gemarkung' 

508 """Gemarkung (cadastral district).""" 

509 buchungsblattbezirk = 'buchungsblattbezirk' 

510 """Buchungsblattbezirk (land register district).""" 

511 dienststelle = 'dienststelle' 

512 """Dienststelle (authority).""" 

513 

514 

515class Place(Record): 

516 """A place (administrative unit) and the units it belongs to. 

517 

518 The attribute named by ``kind`` holds the place itself, the other 

519 attributes hold the higher level units, if known. 

520 """ 

521 

522 kind: str 

523 """Kind of the place, a ``PlaceKind`` value.""" 

524 land: EnumPair 

525 """Land (federal state).""" 

526 regierungsbezirk: EnumPair 

527 """Regierungsbezirk (administrative region).""" 

528 kreis: EnumPair 

529 """Kreis (district).""" 

530 gemeinde: EnumPair 

531 """Gemeinde (municipality).""" 

532 gemarkung: EnumPair 

533 """Gemarkung (cadastral district).""" 

534 buchungsblattbezirk: EnumPair 

535 """Buchungsblattbezirk (land register district).""" 

536 dienststelle: EnumPair 

537 """Dienststelle (authority).""" 

538 

539 

540## 

541 

542 

543class GebaeudeProps(Object): 

544 """Descriptive properties of a building, as defined in GeoInfoDok.""" 

545 

546 anzahlDerOberirdischenGeschosse: int 

547 """Anzahl der oberirdischen Geschosse.""" 

548 anzahlDerUnterirdischenGeschosse: int 

549 """Anzahl der unterirdischen Geschosse.""" 

550 art: EnumPair 

551 """Art.""" 

552 bauart: EnumPair 

553 """Bauart.""" 

554 baujahr: list[int] 

555 """Baujahr.""" 

556 bauweise: EnumPair 

557 """Bauweise.""" 

558 beschaffenheit: list[EnumPair] 

559 """Beschaffenheit.""" 

560 dachart: str 

561 """Dachart.""" 

562 dachform: EnumPair 

563 """Dachform.""" 

564 dachgeschossausbau: EnumPair 

565 """Dachgeschossausbau.""" 

566 durchfahrtshoehe: int 

567 """Durchfahrtshoehe.""" 

568 gebaeudefunktion: EnumPair 

569 """Gebaeudefunktion.""" 

570 gebaeudekennzeichen: str 

571 """Gebaeudekennzeichen.""" 

572 geschossflaeche: float 

573 """Geschossflaeche.""" 

574 grundflaeche: float 

575 """Grundflaeche.""" 

576 hochhaus: bool 

577 """Hochhaus.""" 

578 lageZurErdoberflaeche: EnumPair 

579 """Lage zur Erdoberflaeche.""" 

580 name: list[str] 

581 """Name.""" 

582 objekthoehe: int 

583 """Objekthoehe.""" 

584 punktkennung: str 

585 """Punktkennung.""" 

586 sonstigeEigenschaft: list[str] 

587 """Sonstige Eigenschaft.""" 

588 umbauterRaum: float 

589 """Umbauter Raum.""" 

590 weitereGebaeudefunktion: list[EnumPair] 

591 """Weitere Gebaeudefunktion.""" 

592 zustand: EnumPair 

593 """Zustand.""" 

594 

595 

596class PartProps(Object): 

597 """Descriptive properties of a Part, as defined in GeoInfoDok.""" 

598 

599 abbaugut: EnumPair 

600 """Abbaugut.""" 

601 ackerzahlOderGruenlandzahl: str 

602 """Ackerzahl oder Gruenlandzahl.""" 

603 anzahlDerFahrstreifen: int 

604 """Anzahl der Fahrstreifen.""" 

605 anzahlDerStreckengleise: EnumPair 

606 """Anzahl der Streckengleise.""" 

607 art: EnumPair 

608 """Art.""" 

609 artDerBebauung: EnumPair 

610 """Art der Bebauung.""" 

611 artDerFestlegung: EnumPair 

612 """Art der Festlegung.""" 

613 bahnkategorie: list[EnumPair] 

614 """Bahnkategorie.""" 

615 bedeutung: list[EnumPair] 

616 """Bedeutung.""" 

617 befestigung: EnumPair 

618 """Befestigung.""" 

619 besondereFahrstreifen: EnumPair 

620 """Besondere Fahrstreifen.""" 

621 besondereFunktion: EnumPair 

622 """Besondere Funktion.""" 

623 bodenart: EnumPair 

624 """Bodenart.""" 

625 bodenzahlOderGruenlandgrundzahl: str 

626 """Bodenzahl oder Gruenlandgrundzahl.""" 

627 breiteDerFahrbahn: int 

628 """Breite der Fahrbahn.""" 

629 breiteDesGewaessers: int 

630 """Breite des Gewaessers.""" 

631 breiteDesVerkehrsweges: int 

632 """Breite des Verkehrsweges.""" 

633 datumAbgabe: str 

634 """Datum-Abgabe.""" 

635 datumAnordnung: str 

636 """Datum-Anordnung.""" 

637 datumBesitzeinweisung: str 

638 """Datum-Besitzeinweisung.""" 

639 datumrechtskraeftig: str 

640 """Datum-rechtskraeftig.""" 

641 elektrifizierung: EnumPair 

642 """Elektrifizierung.""" 

643 entstehungsartOderKlimastufeWasserverhaeltnisse: list[EnumPair] 

644 """Entstehungsart oder Klimastufe/Wasserverhaeltnisse.""" 

645 fahrbahntrennung: EnumPair 

646 """Fahrbahntrennung.""" 

647 fliessrichtung: bool 

648 """Fliessrichtung.""" 

649 foerdergut: EnumPair 

650 """Foerdergut.""" 

651 funktion: EnumPair 

652 """Funktion.""" 

653 gewaesserkennzahl: str 

654 """Gewaesserkennzahl.""" 

655 gewaesserkennziffer: str 

656 """Gewaesserkennziffer.""" 

657 hydrologischesMerkmal: EnumPair 

658 """Hydrologisches Merkmal.""" 

659 identnummer: str 

660 """Identnummer.""" 

661 internationaleBedeutung: EnumPair 

662 """Internationale Bedeutung.""" 

663 jahreszahl: int 

664 """Jahreszahl.""" 

665 klassifizierung: EnumPair 

666 """Klassifizierung.""" 

667 kulturart: EnumPair 

668 """Kulturart.""" 

669 lagergut: EnumPair 

670 """Lagergut.""" 

671 markierung: EnumPair 

672 """Markierung.""" 

673 merkmal: EnumPair 

674 """Merkmal.""" 

675 nummer: str 

676 """Nummer.""" 

677 nummerDerSchutzzone: str 

678 """Nummer der Schutzzone.""" 

679 nummerDesSchutzgebietes: str 

680 """Nummer des Schutzgebietes.""" 

681 oberflaechenmaterial: EnumPair 

682 """Oberflaechenmaterial.""" 

683 primaerenergie: EnumPair 

684 """Primaerenergie.""" 

685 rechtszustand: EnumPair 

686 """Rechtszustand.""" 

687 schifffahrtskategorie: EnumPair 

688 """Schifffahrtskategorie.""" 

689 sonstigeAngaben: list[EnumPair] 

690 """Sonstige Angaben.""" 

691 spurweite: EnumPair 

692 """Spurweite.""" 

693 tagesabschnittsnummer: str 

694 """Tagesabschnittsnummer.""" 

695 tidemerkmal: EnumPair 

696 """Tidemerkmal.""" 

697 vegetationsmerkmal: EnumPair 

698 """Vegetationsmerkmal.""" 

699 veraenderungOhneRuecksprache: bool 

700 """Veraenderung ohne Ruecksprache.""" 

701 verkehrsbedeutungInneroertlich: EnumPair 

702 """Verkehrsbedeutung inneroertlich.""" 

703 verkehrsbedeutungUeberoertlich: EnumPair 

704 """Verkehrsbedeutung ueberoertlich.""" 

705 widmung: EnumPair 

706 """Widmung.""" 

707 zone: EnumPair 

708 """Zone.""" 

709 zustand: EnumPair 

710 """Zustand.""" 

711 zustandsstufeOderBodenstufe: EnumPair 

712 """Zustandsstufe oder Bodenstufe.""" 

713 

714 

715PROPS = { 

716 'abbaugut': 'Abbaugut', 

717 'ackerzahlOderGruenlandzahl': 'Ackerzahl oder Grünlandzahl', 

718 'anzahlDerFahrstreifen': 'Anzahl der Fahrstreifen', 

719 'anzahlDerOberirdischenGeschosse': 'Anzahl der oberirdischen Geschosse', 

720 'anzahlDerStreckengleise': 'Anzahl der Streckengleise', 

721 'anzahlDerUnterirdischenGeschosse': 'Anzahl der unterirdischen Geschosse', 

722 'art': 'Art', 

723 'artDerBebauung': 'Art der Bebauung', 

724 'artDerFestlegung': 'Art der Festlegung', 

725 'bahnkategorie': 'Bahnkategorie', 

726 'bauart': 'Bauart', 

727 'baujahr': 'Baujahr', 

728 'bauweise': 'Bauweise', 

729 'bedeutung': 'Bedeutung', 

730 'befestigung': 'Befestigung', 

731 'beschaffenheit': 'Beschaffenheit', 

732 'besondereFahrstreifen': 'Besondere Fahrstreifen', 

733 'besondereFunktion': 'Besondere Funktion', 

734 'bodenart': 'Bodenart', 

735 'bodenzahlOderGruenlandgrundzahl': 'Bodenzahl oder Grünlandgrundzahl', 

736 'breiteDerFahrbahn': 'Breite der Fahrbahn', 

737 'breiteDesGewaessers': 'Breite des Gewässers', 

738 'breiteDesVerkehrsweges': 'Breite des Verkehrsweges', 

739 'dachart': 'Dachart', 

740 'dachform': 'Dachform', 

741 'dachgeschossausbau': 'Dachgeschossausbau', 

742 'datumAbgabe': 'Datum-Abgabe', 

743 'datumAnordnung': 'Datum-Anordnung', 

744 'datumBesitzeinweisung': 'Datum-Besitzeinweisung', 

745 'datumrechtskraeftig': 'Datum-rechtskräftig', 

746 'durchfahrtshoehe': 'Durchfahrtshöhe', 

747 'elektrifizierung': 'Elektrifizierung', 

748 'entstehungsartOderKlimastufeWasserverhaeltnisse': 'Entstehungsart oder Klimastufe/Wasserverhältnisse', 

749 'fahrbahntrennung': 'Fahrbahntrennung', 

750 'fliessrichtung': 'Fließrichtung', 

751 'foerdergut': 'Fördergut', 

752 'funktion': 'Funktion', 

753 'gebaeudefunktion': 'Gebäudefunktion', 

754 'gebaeudekennzeichen': 'Gebäudekennzeichen', 

755 'geschossflaeche': 'Geschossfläche', 

756 'gewaesserkennzahl': 'Gewässerkennzahl', 

757 'gewaesserkennziffer': 'Gewässerkennziffer', 

758 'grundflaeche': 'Grundfläche', 

759 'hochhaus': 'Hochhaus', 

760 'hydrologischesMerkmal': 'Hydrologisches Merkmal', 

761 'identnummer': 'Identnummer', 

762 'internationaleBedeutung': 'Internationale Bedeutung', 

763 'jahreszahl': 'Jahreszahl', 

764 'klassifizierung': 'Klassifizierung', 

765 'kulturart': 'Kulturart', 

766 'lageZurErdoberflaeche': 'Lage zur Erdoberfläche', 

767 'lagergut': 'Lagergut', 

768 'markierung': 'Markierung', 

769 'merkmal': 'Merkmal', 

770 'name': 'Name', 

771 'nummer': 'Nummer', 

772 'nummerDerSchutzzone': 'Nummer der Schutzzone', 

773 'nummerDesSchutzgebietes': 'Nummer des Schutzgebietes', 

774 'oberflaechenmaterial': 'Oberflächenmaterial', 

775 'objekthoehe': 'Objekthöhe', 

776 'primaerenergie': 'Primärenergie', 

777 'punktkennung': 'Punktkennung', 

778 'rechtszustand': 'Rechtszustand', 

779 'schifffahrtskategorie': 'Schifffahrtskategorie', 

780 'sonstigeAngaben': 'Sonstige Angaben', 

781 'sonstigeEigenschaft': 'Sonstige Eigenschaft', 

782 'spurweite': 'Spurweite', 

783 'tagesabschnittsnummer': 'Tagesabschnittsnummer', 

784 'tidemerkmal': 'Tidemerkmal', 

785 'umbauterRaum': 'Umbauter Raum', 

786 'vegetationsmerkmal': 'Vegetationsmerkmal', 

787 'veraenderungOhneRuecksprache': 'Veränderung ohne Rücksprache', 

788 'verkehrsbedeutungInneroertlich': 'Verkehrsbedeutung innerörtlich', 

789 'verkehrsbedeutungUeberoertlich': 'Verkehrsbedeutung überörtlich', 

790 'weitereGebaeudefunktion': 'Weitere Gebäudefunktion', 

791 'widmung': 'Widmung', 

792 'zone': 'Zone', 

793 'zustand': 'Zustand', 

794 'zustandsstufeOderBodenstufe': 'Zustandsstufe oder Bodenstufe', 

795} 

796 

797## 

798 

799 

800class DisplayTheme(gws.Enum): 

801 """Groups of related data that can be loaded and displayed with a Flurstueck.""" 

802 

803 lage = 'lage' 

804 """Location designations (Lage).""" 

805 gebaeude = 'gebaeude' 

806 """Buildings (Gebaeude).""" 

807 nutzung = 'nutzung' 

808 """Land use (Nutzung).""" 

809 festlegung = 'festlegung' 

810 """Legal and other designations (Festlegung).""" 

811 bewertung = 'bewertung' 

812 """Soil valuation (Bewertung).""" 

813 buchung = 'buchung' 

814 """Land register data (Buchung).""" 

815 eigentuemer = 'eigentuemer' 

816 """Owners (Eigentuemer).""" 

817 

818 

819EigentuemerAccessRequired = ['personName', 'personVorname'] 

820 

821BuchungAccessRequired = ['buchungsblattkennzeichenList'] 

822 

823 

824class FlurstueckQueryOptions(gws.Data): 

825 """Options for a Flurstueck search.""" 

826 

827 strasseSearchOptions: gws.TextSearchOptions 

828 """How street names are matched.""" 

829 nameSearchOptions: gws.TextSearchOptions 

830 """How person names are matched.""" 

831 buchungsblattSearchOptions: gws.TextSearchOptions 

832 """How sheet identifiers are matched.""" 

833 

834 limit: int 

835 """Maximum number of results. A search with more results fails.""" 

836 pageSize: int 

837 """Number of results per page.""" 

838 offset: int 

839 """Number of results to skip.""" 

840 sort: Optional[list[gws.SortOptions]] 

841 """Sort order, by columns of the Flurstueck index table.""" 

842 

843 displayThemes: list[DisplayTheme] 

844 """Related data to load with each Flurstueck.""" 

845 

846 withEigentuemer: bool 

847 """Whether owner data is accessed.""" 

848 withBuchung: bool 

849 """Whether land register data is accessed.""" 

850 withHistorySearch: bool 

851 """Whether historic objects are searched too.""" 

852 withHistoryDisplay: bool 

853 """Whether historic objects and records are kept in the results.""" 

854 

855 

856class FlurstueckQuery(gws.Data): 

857 """Flurstueck search criteria. 

858 

859 Criteria that are set are combined with AND. 

860 """ 

861 

862 flurnummer: str 

863 """Flur number.""" 

864 flurstuecksfolge: str 

865 """Flurstueck sequence number.""" 

866 zaehler: str 

867 """Numerator of the Flurstueck number.""" 

868 nenner: str 

869 """Denominator of the Flurstueck number.""" 

870 flurstueckskennzeichen: str 

871 """Flurstueck identifier or its beginning.""" 

872 

873 flaecheBis: float 

874 """Maximum official area.""" 

875 flaecheVon: float 

876 """Minimum official area.""" 

877 

878 gemarkung: str 

879 """Gemarkung name.""" 

880 gemarkungCode: str 

881 """Gemarkung code. A code of up to 4 characters is prefixed with the Land code.""" 

882 gemeinde: str 

883 """Gemeinde name.""" 

884 gemeindeCode: str 

885 """Gemeinde code.""" 

886 kreis: str 

887 """Kreis name.""" 

888 kreisCode: str 

889 """Kreis code.""" 

890 land: str 

891 """Land name.""" 

892 landCode: str 

893 """Land code.""" 

894 regierungsbezirk: str 

895 """Regierungsbezirk name.""" 

896 regierungsbezirkCode: str 

897 """Regierungsbezirk code.""" 

898 

899 strasse: str 

900 """Street name.""" 

901 hausnummer: str 

902 """House number, or ``*`` for any non-empty house number. Requires ``strasse``.""" 

903 

904 buchungsblattkennzeichenList: list[str] 

905 """Sheet identifiers, any of which must match.""" 

906 

907 personName: str 

908 """Owner last name or company name.""" 

909 personVorname: str 

910 """Owner first name. Requires ``personName``.""" 

911 

912 shape: gws.Shape 

913 """Shape the Flurstueck must intersect.""" 

914 

915 uids: list[str] 

916 """Flurstueck uids.""" 

917 

918 options: Optional['FlurstueckQueryOptions'] 

919 """Search options.""" 

920 

921 

922class AdresseQueryOptions(gws.Data): 

923 """Options for an address search.""" 

924 

925 strasseSearchOptions: gws.TextSearchOptions 

926 """How street names are matched.""" 

927 

928 limit: int 

929 """Maximum number of results. A search with more results fails.""" 

930 pageSize: int 

931 """Number of results per page.""" 

932 offset: int 

933 """Number of results to skip.""" 

934 sort: Optional[list[gws.SortOptions]] 

935 """Sort order, by columns of the address index table.""" 

936 

937 withHistorySearch: bool 

938 """Whether historic addresses are searched too.""" 

939 

940 

941class AdresseQuery(gws.Data): 

942 """Address search criteria. 

943 

944 Criteria that are set are combined with AND. 

945 """ 

946 

947 gemarkung: str 

948 """Gemarkung name.""" 

949 gemarkungCode: str 

950 """Gemarkung code. A code of up to 4 characters is prefixed with the Land code.""" 

951 gemeinde: str 

952 """Gemeinde name.""" 

953 gemeindeCode: str 

954 """Gemeinde code.""" 

955 kreis: str 

956 """Kreis name.""" 

957 kreisCode: str 

958 """Kreis code.""" 

959 land: str 

960 """Land name.""" 

961 landCode: str 

962 """Land code.""" 

963 regierungsbezirk: str 

964 """Regierungsbezirk name.""" 

965 regierungsbezirkCode: str 

966 """Regierungsbezirk code.""" 

967 

968 strasse: str 

969 """Street name.""" 

970 hausnummer: str 

971 """House number, or ``*`` for any non-empty house number. Requires ``strasse``.""" 

972 bisHausnummer: str 

973 """Upper bound for the house number, compared as a string. Requires ``strasse``.""" 

974 hausnummerNotNull: bool 

975 """Whether only addresses with a house number are found. Requires ``strasse``.""" 

976 

977 options: Optional['AdresseQueryOptions'] 

978 """Search options.""" 

979 

980 

981class IndexStatus(gws.Data): 

982 """Status of the ALKIS index, based on which index tables have data.""" 

983 

984 complete: bool 

985 """Whether all index tables have data.""" 

986 basic: bool 

987 """Whether the basic index tables have data.""" 

988 eigentuemer: bool 

989 """Whether the owner index tables have data.""" 

990 buchung: bool 

991 """Whether the land register index tables have data.""" 

992 missing: bool 

993 """Whether all index tables are empty or missing.""" 

994 

995 

996## 

997 

998 

999class Reader: 

1000 """Interface for reading ALKIS source data.""" 

1001 

1002 def read_all(self, cls: type, table_name: Optional[str] = None, uids: Optional[list[str]] = None): 

1003 """Read source objects of a GeoInfoDok class. 

1004 

1005 Args: 

1006 cls: GeoInfoDok class from the ``geo_info_dok`` schema module. 

1007 table_name: Source table name. Defaults to a name derived from the class. 

1008 uids: Object identifiers to read. If empty, all objects are read. 

1009 

1010 Returns: 

1011 An iterable of ``cls`` instances. 

1012 """ 

1013 

1014 pass 

1015 

1016 def count(self, cls: type, table_name: Optional[str] = None) -> int: 

1017 """Count source objects of a GeoInfoDok class. 

1018 

1019 Args: 

1020 cls: GeoInfoDok class from the ``geo_info_dok`` schema module. 

1021 table_name: Source table name. Defaults to a name derived from the class. 

1022 

1023 Returns: 

1024 The number of objects. 

1025 """ 

1026 

1027 pass 

1028 

1029 

1030##