Coverage for gws-app/gws/plugin/alkis/data/types.py: 99%
398 statements
« prev ^ index » next coverage.py v7.17.0, created at 2026-10-23 20:06 +0200
« prev ^ index » next coverage.py v7.17.0, created at 2026-10-23 20:06 +0200
1"""Data model of the ALKIS index: entities, records, queries and the source reader interface."""
3from typing import Optional, Any
5import gws
8class EnumPair:
9 """A code list value with its code and display text."""
11 def __init__(self, code, text):
12 """Create a code list value.
14 Args:
15 code: Value code.
16 text: Display text.
17 """
19 self.code = code
20 self.text = text
23class Strasse(gws.Data):
24 """A street name in a Gemeinde and Gemarkung."""
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."""
34class Object:
35 """Base class for ALKIS data objects.
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 """
42 uid: str
43 """Unique id. For ALKIS objects, this is the ALKIS identifier."""
44 isHistoric: bool
45 """Whether the object is historic."""
47 def __init__(self, **kwargs):
48 """Create an object.
50 Args:
51 **kwargs: Attribute values.
52 """
54 self.isHistoric = False
55 self.__dict__.update(kwargs)
58def _getattr(self, item):
59 if item.startswith('_'):
60 raise AttributeError()
61 return None
64setattr(Object, '__getattr__', _getattr)
67class Record(Object):
68 """A version of an ALKIS object in its life span.
70 A record is historic when its life span has ended.
71 """
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."""
81class Entity(Object):
82 """An ALKIS object with a list of records, one per version.
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 """
88 recs: list['Record']
89 """Records, oldest first."""
92class Adresse(Object):
93 """An address (Lagebezeichnung) found by the address search."""
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)."""
106 strasse: str
107 """Street name."""
108 hausnummer: str
109 """House number."""
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."""
119class FlurstueckRecord(Record):
120 """A version of a Flurstueck (land parcel)."""
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)."""
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)."""
144 amtlicheFlaeche: float
145 """Official area in square meters."""
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."""
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."""
172class BuchungsstelleReference(Object):
173 """A reference from a Buchung to a Buchungsstelle.
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 """
180 buchungsstelle: 'Buchungsstelle'
181 """Referenced Buchungsstelle."""
184class Buchung(Entity):
185 """Buchungsstellen of a Flurstueck that belong to the same Buchungsblatt."""
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."""
195class Flurstueck(Entity):
196 """A Flurstueck (land parcel) with its related data."""
198 recs: list[FlurstueckRecord]
199 """Flurstueck records, oldest first."""
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``."""
206 buchungList: list['Buchung']
207 """Land register data, grouped by Buchungsblatt."""
208 lageList: list['Lage']
209 """Location designations."""
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."""
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."""
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."""
235class BuchungsblattRecord(Record):
236 """A version of a Buchungsblatt (land register sheet)."""
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."""
250class Buchungsblatt(Entity):
251 """A Buchungsblatt (land register sheet)."""
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."""
263class BuchungsstelleRecord(Record):
264 """A version of a Buchungsstelle (land register entry)."""
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."""
280class Buchungsstelle(Entity):
281 """A Buchungsstelle (land register entry).
283 Buchungsstellen can refer to parent Buchungsstellen through the ``an``
284 and ``zu`` relations in ALKIS.
285 """
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."""
307class NamensnummerRecord(Record):
308 """A version of a Namensnummer (owner entry in a land register sheet)."""
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."""
326class Namensnummer(Entity):
327 """A Namensnummer (owner entry in a land register sheet)."""
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."""
341class PersonRecord(Record):
342 """A version of a Person (owner)."""
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."""
358class Person(Entity):
359 """A Person (owner), either a natural person or a company."""
361 recs: list[PersonRecord]
362 """Person records, oldest first."""
363 anschriftList: list['Anschrift']
364 """Postal addresses."""
367class AnschriftRecord(Record):
368 """A version of an Anschrift (postal address of a person)."""
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."""
382class Anschrift(Entity):
383 """An Anschrift (postal address of a person)."""
385 recs: list[AnschriftRecord]
386 """Anschrift records, oldest first."""
389class LageRecord(Record):
390 """A version of a Lage (location designation of a Flurstueck)."""
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."""
404class Lage(Entity):
405 """A Lage (location designation) with or without a house number."""
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."""
417class GebaeudeRecord(Record):
418 """A version of a Gebaeude (building)."""
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."""
432class Gebaeude(Entity):
433 """A Gebaeude (building)."""
435 recs: list[GebaeudeRecord]
436 """Gebaeude records, oldest first."""
439PART_NUTZUNG = 1
440PART_BEWERTUNG = 2
441PART_FESTLEGUNG = 3
444class PartRecord(Record):
445 """A version of a Part, limited to one Flurstueck."""
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."""
457class Part(Entity):
458 """A part of a Flurstueck covered by a Nutzung, Festlegung or Bewertung object.
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 """
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."""
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."""
496class PlaceKind(gws.Enum):
497 """Kind of a place (administrative unit)."""
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)."""
515class Place(Record):
516 """A place (administrative unit) and the units it belongs to.
518 The attribute named by ``kind`` holds the place itself, the other
519 attributes hold the higher level units, if known.
520 """
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)."""
540##
543class GebaeudeProps(Object):
544 """Descriptive properties of a building, as defined in GeoInfoDok."""
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."""
596class PartProps(Object):
597 """Descriptive properties of a Part, as defined in GeoInfoDok."""
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 befahrbarkeit: EnumPair
618 """Befahrbarkeit."""
619 befestigung: EnumPair
620 """Befestigung."""
621 besondereFahrstreifen: EnumPair
622 """Besondere Fahrstreifen."""
623 besondereFunktion: EnumPair
624 """Besondere Funktion."""
625 besondereVerkehrsbedeutung: EnumPair
626 """Besondere Verkehrsbedeutung."""
627 bezeichnung: list[str]
628 """Bezeichnung."""
629 bodenart: EnumPair
630 """Bodenart."""
631 bodenstufe: EnumPair
632 """Bodenstufe."""
633 bodenzahlOderGruenlandgrundzahl: str
634 """Bodenzahl oder Gruenlandgrundzahl."""
635 bodenzahlOderGruenlandgrundzahlGrabloch: str
636 """Bodenzahl oder Gruenlandgrundzahl (Grabloch)."""
637 breiteDerFahrbahn: int
638 """Breite der Fahrbahn."""
639 breiteDesGewaessers: int
640 """Breite des Gewaessers."""
641 breiteDesVerkehrsweges: int
642 """Breite des Verkehrsweges."""
643 datumAbgabe: str
644 """Datum-Abgabe."""
645 datumAnordnung: str
646 """Datum-Anordnung."""
647 datumBesitzeinweisung: str
648 """Datum-Besitzeinweisung."""
649 datumDerLetztenUeberpruefung: str
650 """Datum der letzten Ueberpruefung."""
651 datumRechtskraeftig: str
652 """Datum-rechtskraeftig."""
653 datumrechtskraeftig: str
654 """Datum-rechtskraeftig."""
655 elektrifizierung: EnumPair
656 """Elektrifizierung."""
657 entstehungsart: list[EnumPair]
658 """Entstehungsart."""
659 entstehungsartOderKlimastufeWasserverhaeltnisse: list[EnumPair]
660 """Entstehungsart oder Klimastufe/Wasserverhaeltnisse."""
661 fahrbahntrennung: EnumPair
662 """Fahrbahntrennung."""
663 fahrtrichtung: bool
664 """Fahrtrichtung."""
665 fliessrichtung: bool
666 """Fliessrichtung."""
667 foerdergut: EnumPair
668 """Foerdergut."""
669 funktion: EnumPair
670 """Funktion."""
671 gewaesserkennzahl: str
672 """Gewaesserkennzahl."""
673 gewaesserkennziffer: str
674 """Gewaesserkennziffer."""
675 hydrologischesMerkmal: EnumPair
676 """Hydrologisches Merkmal."""
677 identnummer: str
678 """Identnummer."""
679 internationaleBedeutung: EnumPair
680 """Internationale Bedeutung."""
681 jahreszahl: int
682 """Jahreszahl."""
683 klassifizierung: EnumPair
684 """Klassifizierung."""
685 klimastufe: EnumPair
686 """Klimastufe."""
687 kulturart: EnumPair
688 """Kulturart."""
689 lagergut: EnumPair
690 """Lagergut."""
691 markierung: list[EnumPair]
692 """Markierung."""
693 merkmal: EnumPair
694 """Merkmal."""
695 nummer: str
696 """Nummer."""
697 nummerDerBahnstrecke: list[str]
698 """Nummer der Bahnstrecke."""
699 nummerDerLinie: list[str]
700 """Nummer der Linie."""
701 nummerDerSchutzzone: str
702 """Nummer der Schutzzone."""
703 nummerDesSchutzgebietes: str
704 """Nummer des Schutzgebietes."""
705 nutzung: list[EnumPair]
706 """Nutzung."""
707 nutzungsart: EnumPair
708 """Nutzungsart."""
709 oberflaechenmaterial: EnumPair
710 """Oberflaechenmaterial."""
711 primaerenergie: EnumPair
712 """Primaerenergie."""
713 rechtszustand: EnumPair
714 """Rechtszustand."""
715 schifffahrtskategorie: EnumPair
716 """Schifffahrtskategorie."""
717 seekennzahl: str
718 """Seekennzahl."""
719 sonstigeAngaben: list[EnumPair]
720 """Sonstige Angaben."""
721 spurweite: list[EnumPair]
722 """Spurweite."""
723 strassenschluessel: str
724 """Strassenschluessel."""
725 tagesabschnittsnummer: str
726 """Tagesabschnittsnummer."""
727 tidemerkmal: EnumPair
728 """Tidemerkmal."""
729 vegetationsmerkmal: EnumPair
730 """Vegetationsmerkmal."""
731 veraenderungOhneRuecksprache: bool
732 """Veraenderung ohne Ruecksprache."""
733 verkehrsbedeutungInneroertlich: EnumPair
734 """Verkehrsbedeutung inneroertlich."""
735 verkehrsbedeutungUeberoertlich: EnumPair
736 """Verkehrsbedeutung ueberoertlich."""
737 verkehrsdienst: EnumPair
738 """Verkehrsdienst."""
739 wasserspiegelhoeheInStehendemGewaesser: int
740 """Wasserspiegelhoehe in stehendem Gewaesser."""
741 wasserverhaeltnisse: EnumPair
742 """Wasserverhaeltnisse."""
743 widmung: EnumPair
744 """Widmung."""
745 zone: EnumPair
746 """Zone."""
747 zustand: EnumPair
748 """Zustand."""
749 zustandsstufe: EnumPair
750 """Zustandsstufe."""
751 zustandsstufeOderBodenstufe: EnumPair
752 """Zustandsstufe oder Bodenstufe."""
755PROPS = {
756 'abbaugut': 'Abbaugut',
757 'ackerzahlOderGruenlandzahl': 'Ackerzahl oder Grünlandzahl',
758 'anzahlDerFahrstreifen': 'Anzahl der Fahrstreifen',
759 'anzahlDerOberirdischenGeschosse': 'Anzahl der oberirdischen Geschosse',
760 'anzahlDerStreckengleise': 'Anzahl der Streckengleise',
761 'anzahlDerUnterirdischenGeschosse': 'Anzahl der unterirdischen Geschosse',
762 'art': 'Art',
763 'artDerBebauung': 'Art der Bebauung',
764 'artDerFestlegung': 'Art der Festlegung',
765 'bahnkategorie': 'Bahnkategorie',
766 'bauart': 'Bauart',
767 'baujahr': 'Baujahr',
768 'bauweise': 'Bauweise',
769 'bedeutung': 'Bedeutung',
770 'befahrbarkeit': 'Befahrbarkeit',
771 'befestigung': 'Befestigung',
772 'beschaffenheit': 'Beschaffenheit',
773 'besondereFahrstreifen': 'Besondere Fahrstreifen',
774 'besondereFunktion': 'Besondere Funktion',
775 'besondereVerkehrsbedeutung': 'Besondere Verkehrsbedeutung',
776 'bezeichnung': 'Bezeichnung',
777 'bodenart': 'Bodenart',
778 'bodenstufe': 'Bodenstufe',
779 'bodenzahlOderGruenlandgrundzahl': 'Bodenzahl oder Grünlandgrundzahl',
780 'bodenzahlOderGruenlandgrundzahlGrabloch': 'Bodenzahl oder Grünlandgrundzahl (Grabloch)',
781 'breiteDerFahrbahn': 'Breite der Fahrbahn',
782 'breiteDesGewaessers': 'Breite des Gewässers',
783 'breiteDesVerkehrsweges': 'Breite des Verkehrsweges',
784 'dachart': 'Dachart',
785 'dachform': 'Dachform',
786 'dachgeschossausbau': 'Dachgeschossausbau',
787 'datumAbgabe': 'Datum-Abgabe',
788 'datumAnordnung': 'Datum-Anordnung',
789 'datumBesitzeinweisung': 'Datum-Besitzeinweisung',
790 'datumDerLetztenUeberpruefung': 'Datum der letzten Überprüfung',
791 'datumRechtskraeftig': 'Datum-rechtskräftig',
792 'datumrechtskraeftig': 'Datum-rechtskräftig',
793 'durchfahrtshoehe': 'Durchfahrtshöhe',
794 'elektrifizierung': 'Elektrifizierung',
795 'entstehungsart': 'Entstehungsart',
796 'entstehungsartOderKlimastufeWasserverhaeltnisse': 'Entstehungsart oder Klimastufe/Wasserverhältnisse',
797 'fahrbahntrennung': 'Fahrbahntrennung',
798 'fahrtrichtung': 'Fahrtrichtung',
799 'fliessrichtung': 'Fließrichtung',
800 'foerdergut': 'Fördergut',
801 'funktion': 'Funktion',
802 'gebaeudefunktion': 'Gebäudefunktion',
803 'gebaeudekennzeichen': 'Gebäudekennzeichen',
804 'geschossflaeche': 'Geschossfläche',
805 'gewaesserkennzahl': 'Gewässerkennzahl',
806 'gewaesserkennziffer': 'Gewässerkennziffer',
807 'grundflaeche': 'Grundfläche',
808 'hochhaus': 'Hochhaus',
809 'hydrologischesMerkmal': 'Hydrologisches Merkmal',
810 'identnummer': 'Identnummer',
811 'internationaleBedeutung': 'Internationale Bedeutung',
812 'jahreszahl': 'Jahreszahl',
813 'klassifizierung': 'Klassifizierung',
814 'klimastufe': 'Klimastufe',
815 'kulturart': 'Kulturart',
816 'lageZurErdoberflaeche': 'Lage zur Erdoberfläche',
817 'lagergut': 'Lagergut',
818 'markierung': 'Markierung',
819 'merkmal': 'Merkmal',
820 'name': 'Name',
821 'nummer': 'Nummer',
822 'nummerDerBahnstrecke': 'Nummer der Bahnstrecke',
823 'nummerDerLinie': 'Nummer der Linie',
824 'nummerDerSchutzzone': 'Nummer der Schutzzone',
825 'nummerDesSchutzgebietes': 'Nummer des Schutzgebietes',
826 'nutzung': 'Nutzung',
827 'nutzungsart': 'Nutzungsart',
828 'oberflaechenmaterial': 'Oberflächenmaterial',
829 'objekthoehe': 'Objekthöhe',
830 'primaerenergie': 'Primärenergie',
831 'punktkennung': 'Punktkennung',
832 'rechtszustand': 'Rechtszustand',
833 'schifffahrtskategorie': 'Schifffahrtskategorie',
834 'seekennzahl': 'Seekennzahl',
835 'sonstigeAngaben': 'Sonstige Angaben',
836 'sonstigeEigenschaft': 'Sonstige Eigenschaft',
837 'spurweite': 'Spurweite',
838 'strassenschluessel': 'Straßenschlüssel',
839 'tagesabschnittsnummer': 'Tagesabschnittsnummer',
840 'tidemerkmal': 'Tidemerkmal',
841 'umbauterRaum': 'Umbauter Raum',
842 'vegetationsmerkmal': 'Vegetationsmerkmal',
843 'veraenderungOhneRuecksprache': 'Veränderung ohne Rücksprache',
844 'verkehrsbedeutungInneroertlich': 'Verkehrsbedeutung innerörtlich',
845 'verkehrsbedeutungUeberoertlich': 'Verkehrsbedeutung überörtlich',
846 'verkehrsdienst': 'Verkehrsdienst',
847 'wasserspiegelhoeheInStehendemGewaesser': 'Wasserspiegelhöhe in stehendem Gewässer',
848 'wasserverhaeltnisse': 'Wasserverhältnisse',
849 'weitereGebaeudefunktion': 'Weitere Gebäudefunktion',
850 'widmung': 'Widmung',
851 'zone': 'Zone',
852 'zustand': 'Zustand',
853 'zustandsstufe': 'Zustandsstufe',
854 'zustandsstufeOderBodenstufe': 'Zustandsstufe oder Bodenstufe',
855}
857##
860class DisplayTheme(gws.Enum):
861 """Groups of related data that can be loaded and displayed with a Flurstueck."""
863 lage = 'lage'
864 """Location designations (Lage)."""
865 gebaeude = 'gebaeude'
866 """Buildings (Gebaeude)."""
867 nutzung = 'nutzung'
868 """Land use (Nutzung)."""
869 festlegung = 'festlegung'
870 """Legal and other designations (Festlegung)."""
871 bewertung = 'bewertung'
872 """Soil valuation (Bewertung)."""
873 buchung = 'buchung'
874 """Land register data (Buchung)."""
875 eigentuemer = 'eigentuemer'
876 """Owners (Eigentuemer)."""
879EigentuemerAccessRequired = ['personName', 'personVorname']
881BuchungAccessRequired = ['buchungsblattkennzeichenList']
884class FlurstueckQueryOptions(gws.Data):
885 """Options for a Flurstueck search."""
887 strasseSearchOptions: gws.TextSearchOptions
888 """How street names are matched."""
889 nameSearchOptions: gws.TextSearchOptions
890 """How person names are matched."""
891 buchungsblattSearchOptions: gws.TextSearchOptions
892 """How sheet identifiers are matched."""
894 limit: int
895 """Maximum number of results. A search with more results fails."""
896 pageSize: int
897 """Number of results per page."""
898 offset: int
899 """Number of results to skip."""
900 sort: Optional[list[gws.SortOptions]]
901 """Sort order, by columns of the Flurstueck index table."""
903 displayThemes: list[DisplayTheme]
904 """Related data to load with each Flurstueck."""
906 withEigentuemer: bool
907 """Whether owner data is accessed."""
908 withBuchung: bool
909 """Whether land register data is accessed."""
910 withHistorySearch: bool
911 """Whether historic objects are searched too."""
912 withHistoryDisplay: bool
913 """Whether historic objects and records are kept in the results."""
916class FlurstueckQuery(gws.Data):
917 """Flurstueck search criteria.
919 Criteria that are set are combined with AND.
920 """
922 flurnummer: str
923 """Flur number."""
924 flurstuecksfolge: str
925 """Flurstueck sequence number."""
926 zaehler: str
927 """Numerator of the Flurstueck number."""
928 nenner: str
929 """Denominator of the Flurstueck number."""
930 flurstueckskennzeichen: str
931 """Flurstueck identifier or its beginning."""
933 flaecheBis: float
934 """Maximum official area."""
935 flaecheVon: float
936 """Minimum official area."""
938 gemarkung: str
939 """Gemarkung name."""
940 gemarkungCode: str
941 """Gemarkung code. A code of up to 4 characters is prefixed with the Land code."""
942 gemeinde: str
943 """Gemeinde name."""
944 gemeindeCode: str
945 """Gemeinde code."""
946 kreis: str
947 """Kreis name."""
948 kreisCode: str
949 """Kreis code."""
950 land: str
951 """Land name."""
952 landCode: str
953 """Land code."""
954 regierungsbezirk: str
955 """Regierungsbezirk name."""
956 regierungsbezirkCode: str
957 """Regierungsbezirk code."""
959 strasse: str
960 """Street name."""
961 hausnummer: str
962 """House number, or ``*`` for any non-empty house number. Requires ``strasse``."""
964 buchungsblattkennzeichenList: list[str]
965 """Sheet identifiers, any of which must match."""
967 personName: str
968 """Owner last name or company name."""
969 personVorname: str
970 """Owner first name. Requires ``personName``."""
972 shape: gws.Shape
973 """Shape the Flurstueck must intersect."""
975 uids: list[str]
976 """Flurstueck uids."""
978 options: Optional['FlurstueckQueryOptions']
979 """Search options."""
982class AdresseQueryOptions(gws.Data):
983 """Options for an address search."""
985 strasseSearchOptions: gws.TextSearchOptions
986 """How street names are matched."""
988 limit: int
989 """Maximum number of results. A search with more results fails."""
990 pageSize: int
991 """Number of results per page."""
992 offset: int
993 """Number of results to skip."""
994 sort: Optional[list[gws.SortOptions]]
995 """Sort order, by columns of the address index table."""
997 withHistorySearch: bool
998 """Whether historic addresses are searched too."""
1001class AdresseQuery(gws.Data):
1002 """Address search criteria.
1004 Criteria that are set are combined with AND.
1005 """
1007 gemarkung: str
1008 """Gemarkung name."""
1009 gemarkungCode: str
1010 """Gemarkung code. A code of up to 4 characters is prefixed with the Land code."""
1011 gemeinde: str
1012 """Gemeinde name."""
1013 gemeindeCode: str
1014 """Gemeinde code."""
1015 kreis: str
1016 """Kreis name."""
1017 kreisCode: str
1018 """Kreis code."""
1019 land: str
1020 """Land name."""
1021 landCode: str
1022 """Land code."""
1023 regierungsbezirk: str
1024 """Regierungsbezirk name."""
1025 regierungsbezirkCode: str
1026 """Regierungsbezirk code."""
1028 strasse: str
1029 """Street name."""
1030 hausnummer: str
1031 """House number, or ``*`` for any non-empty house number. With ``bisHausnummer``, the lower bound of a range. Requires ``strasse``."""
1032 bisHausnummer: str
1033 """Upper bound of a house number range, inclusive. House numbers are compared by number, then by suffix; a bound without a suffix includes all suffixes, e.g. ``5`` includes ``5z``. Requires ``strasse``."""
1034 hausnummerNotNull: bool
1035 """Whether only addresses with a house number are found. Requires ``strasse``."""
1037 options: Optional['AdresseQueryOptions']
1038 """Search options."""
1041class IndexStatus(gws.Data):
1042 """Status of the ALKIS index, based on which index tables have data."""
1044 complete: bool
1045 """Whether all index tables have data."""
1046 basic: bool
1047 """Whether the basic index tables have data."""
1048 eigentuemer: bool
1049 """Whether the owner index tables have data."""
1050 buchung: bool
1051 """Whether the land register index tables have data."""
1052 missing: bool
1053 """Whether all index tables are empty or missing."""
1056##
1059class Reader:
1060 """Interface for reading ALKIS source data."""
1062 def read_all(self, cls: type, table_name: Optional[str] = None, uids: Optional[list[str]] = None):
1063 """Read source objects of a GeoInfoDok class.
1065 Args:
1066 cls: GeoInfoDok class from the ``geo_info_dok`` schema module.
1067 table_name: Source table name. Defaults to a name derived from the class.
1068 uids: Object identifiers to read. If empty, all objects are read.
1070 Returns:
1071 An iterable of ``cls`` instances.
1072 """
1074 pass
1076 def count(self, cls: type, table_name: Optional[str] = None) -> int:
1077 """Count source objects of a GeoInfoDok class.
1079 Args:
1080 cls: GeoInfoDok class from the ``geo_info_dok`` schema module.
1081 table_name: Source table name. Defaults to a name derived from the class.
1083 Returns:
1084 The number of objects.
1085 """
1087 pass
1090##