gws.plugin.alkis.data.norbit6¶
Read data from Norbit plugin tables (GeoInfoDok 6).
Source code: gws.plugin.alkis.data.norbit6
Module Contents¶
- class gws.plugin.alkis.data.norbit6.Object(provider: gws.plugin.postgres.provider.Object, schema='public')¶
Bases:
gws.plugin.alkis.data.types.ReaderReader for ALKIS source tables written by the norBIT ALKIS import (GeoInfoDok 6).
There is one table per object type, named after the class in lower case, with one column per attribute. Struct attributes are stored in columns prefixed with the attribute name, lists are stored as arrays. The reader converts each row into an instance of the
gid6class, using a reader method per attribute, chosen by the attribute type.- db¶
- readers¶
- schema = 'public'¶
- STD_READERS¶
Reader method names for basic and special attribute types.
- as_ax_buchung_historischesflurstueck_list(cls, prop, r)¶
Read a list of
AX_Buchung_HistorischesFlurstueckstructs.- Parameters:
cls – GeoInfoDok class of the attribute.
prop – Column name.
r – Table row as a dict.
- Returns:
A list of
AX_Buchung_HistorischesFlurstueckinstances with theirbuchungsblattbezirkset.
- as_ax_lagebezeichnung(cls, prop, r)¶
Read an
AX_Lagebezeichnungattribute.- Parameters:
cls – GeoInfoDok class of the attribute.
prop – Column name.
r – Table row as a dict.
- Returns:
The unencoded location string if present, otherwise an
AX_VerschluesselteLagebezeichnung.
- as_bool(cls, prop, r)¶
Read a boolean.
- Parameters:
cls – GeoInfoDok class of the attribute.
prop – Column name.
r – Table row as a dict.
- Returns:
A boolean, or
Noneif the value is missing.
- as_bool_list(cls, prop, r)¶
Read a list of booleans.
- Parameters:
cls – GeoInfoDok class of the attribute.
prop – Column name.
r – Table row as a dict.
- Returns:
A list of booleans.
- as_date(cls, prop, r)¶
Read a date or a date and time.
ISO strings are parsed, other values are returned as is.
- Parameters:
cls – GeoInfoDok class of the attribute.
prop – Column name.
r – Table row as a dict.
- Returns:
A date or datetime, or
Noneif the value is empty.
- as_date_list(cls, prop, r)¶
Read a list of dates.
- Parameters:
cls – GeoInfoDok class of the attribute.
prop – Column name.
r – Table row as a dict.
- Returns:
A list of dates or datetimes.
- as_enum(cls, prop, r)¶
Read a code list value.
- Parameters:
cls – GeoInfoDok class of the attribute.
prop – Column name.
r – Table row as a dict.
- Returns:
An
EnumPair, orNoneif the value is not in the code list.
- as_enum_list(cls, prop, r)¶
Read a list of code list values.
- Parameters:
cls – GeoInfoDok class of the attribute.
prop – Column name.
r – Table row as a dict.
- Returns:
A list of
EnumPairobjects. Values not in the code list are skipped.
- as_float(cls, prop, r)¶
Read a float.
- Parameters:
cls – GeoInfoDok class of the attribute.
prop – Column name.
r – Table row as a dict.
- Returns:
A float, or
Noneif the value is missing.
- as_float_list(cls, prop, r)¶
Read a list of floats.
- Parameters:
cls – GeoInfoDok class of the attribute.
prop – Column name.
r – Table row as a dict.
- Returns:
A list of floats.
- as_int(cls, prop, r)¶
Read an integer.
- Parameters:
cls – GeoInfoDok class of the attribute.
prop – Column name.
r – Table row as a dict.
- Returns:
An integer, or
Noneif the value is missing.
- as_int_list(cls, prop, r)¶
Read a list of integers.
- Parameters:
cls – GeoInfoDok class of the attribute.
prop – Column name.
r – Table row as a dict.
- Returns:
A list of integers.
- as_ref(cls, prop, r)¶
Read a reference to another object.
- Parameters:
cls – GeoInfoDok class of the attribute.
prop – Column name.
r – Table row as a dict.
- Returns:
The identifier of the referenced object.
- as_ref_list(cls, prop, r)¶
Read a list of references to other objects.
- Parameters:
cls – GeoInfoDok class of the attribute.
prop – Column name.
r – Table row as a dict.
- Returns:
A list of object identifiers.
- as_str(cls, prop, r)¶
Read a string.
- Parameters:
cls – GeoInfoDok class of the attribute.
prop – Column name.
r – Table row as a dict.
- Returns:
A stripped string, or
Noneif the value is empty.
- as_str_list(cls, prop, r)¶
Read a list of strings.
- Parameters:
cls – GeoInfoDok class of the attribute.
prop – Column name.
r – Table row as a dict.
- Returns:
A list of stripped strings, empty values become
None.
- as_struct(cls, prop, r)¶
Read a struct attribute.
A column
<prop>_<attribute>is used if present, otherwise the plain attribute column.- Parameters:
cls – GeoInfoDok class of the attribute.
prop – Column name prefix of the struct attributes.
r – Table row as a dict.
- Returns:
An instance of
cls.
- as_struct_list(cls, prop, r)¶
Read a list of structs from parallel array columns.
- Parameters:
cls – GeoInfoDok class of the attribute.
prop – Column name prefix of the struct attributes.
r – Table row as a dict.
- Returns:
A list of
clsinstances.
- count(cls, table_name=None)¶
Count source objects of a GeoInfoDok class.
- Parameters:
cls – GeoInfoDok class from the
geo_info_dokschema module.table_name – Source table name. Defaults to a name derived from the class.
- Returns:
The number of objects.
- get_reader(attr)¶
Return the reader method for an attribute.
- Parameters:
attr – Attribute metadata from the
gid6schema.- Returns:
A bound reader method. Unknown types are read as strings.
- read_all(cls, table_name=None, uids=None)¶
Read source objects of a GeoInfoDok class.
- Parameters:
cls – GeoInfoDok class from the
geo_info_dokschema module.table_name – Source table name. Defaults to a name derived from the class.
uids – Object identifiers to read. If empty, all objects are read.
- Returns:
An iterable of
clsinstances.