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

0 statements  

« prev     ^ index     » next       coverage.py v7.17.0, created at 2026-10-23 20:06 +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. The plugin uses one of them, see 

20 ``data.gid``. 

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

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

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

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

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

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

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

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

29 

30The generated modules must not be edited by hand. 

31 

32Example:: 

33 

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

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

36 

37Example:: 

38 

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

40 

41 meta = gid6.METADATA['AX_Flurstueck'] 

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

43 print(gid6.AX_Bauweise_Gebaeude.VALUES) 

44"""