Coverage for gws-app/gws/plugin/alkis/data/geo_info_dok/__init__.py: 100%

0 statements  

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

1"""GeoInfoDok schema modules and their generator. 

2 

3GeoInfoDok is the documentation of the AFIS-ALKIS-ATKIS data model, 

4published by the AdV (https://www.adv-online.de/GeoInfoDok/). This package 

5holds Python versions of the schema, generated from the official model 

6files, which the ALKIS reader and indexer use to type and interpret the 

7source data. 

8 

9Submodules: 

10 

11- ``gid6``: generated schema for GeoInfoDok 6. Each object type, struct, 

12 union, code list and category of the model is a Python class or type 

13 alias, with the model documentation as docstrings. Code lists have a 

14 ``VALUES`` dict of codes and texts. ``METADATA`` describes every type 

15 (kind, name, GeoInfoDok code, category key, title, attributes and super 

16 classes) and is used by the reader to choose attribute readers and by the 

17 indexer to find object types by category. Reading a missing attribute of 

18 a schema object returns ``None``. 

19- ``gid7``: the same for GeoInfoDok 7. It is not used by the plugin yet. 

20- ``generator``: a standalone script that creates ``gid6.py`` and 

21 ``gid7.py``. For version 6 it parses the Rational Rose ``.cat`` files 

22 ``Basisschema.cat`` and ``Fachschema.cat``, for version 7 the Enterprise 

23 Architect (sqlite) file ``AAA-7.1.2.qea``. Only the AAA Basisschema, the 

24 AFIS-ALKIS-ATKIS Fachschema and the AAA Objektartenkatalog are kept. 

25- ``extract_props``: a standalone helper script that prints the 

26 ``GebaeudeProps`` and ``PartProps`` classes and the ``PROPS`` dict for 

27 ``types``, from the ``gid6`` attributes of the building and Part categories. 

28 

29The generated modules must not be edited by hand. 

30 

31Example:: 

32 

33 python3 generator.py 6 /path/to/Basisschema.cat /path/to/Fachschema.cat 

34 python3 generator.py 7 /path/to/AAA-7.1.2.qea 

35 

36Example:: 

37 

38 from gws.plugin.alkis.data.geo_info_dok import gid6 

39 

40 meta = gid6.METADATA['AX_Flurstueck'] 

41 print(meta['kind'], [a['name'] for a in meta['attributes']]) 

42 print(gid6.AX_Bauweise_Gebaeude.VALUES) 

43"""