vg250
The central module containing all code dealing with VG250 data.
This module either directly contains the code dealing with importing VG250 data, or it re-exports everything needed to handle it. Please refrain from importing code from any modules below this one, because it might lead to unwanted behaviour.
If you have to import code from a module below this one because the code isn’t exported from this module, please file a bug, so we can fix this.
- class Vg250(dependencies)[source]
Bases:
Dataset- file_table_map = {'VG250_GEM.shp': 'vg250_gem', 'VG250_KRS.shp': 'vg250_krs', 'VG250_LAN.shp': 'vg250_lan', 'VG250_RBZ.shp': 'vg250_rbz', 'VG250_STA.shp': 'vg250_sta', 'VG250_VWG.shp': 'vg250_vwg'}
Obtains and processes VG250 data and writes it to database.
Original data is downloaded using
download_files()function and written to database usingto_postgres()function.- Dependencies
No dependencies
- Resulting tables
boundaries.vg250_gemis created and filledboundaries.vg250_krsis created and filledboundaries.vg250_lanis created and filledboundaries.vg250_rbzis created and filledboundaries.vg250_stais created and filledboundaries.vg250_vwgis created and filledboundaries.vg250_lan_nuts_idis created and filledboundaries.vg250_gem_holeis created and filledboundaries.vg250_gem_validis created and filledboundaries.vg250_krs_areais created and filledboundaries.vg250_lan_unionis created and filledboundaries.vg250_sta_bboxis created and filledboundaries.vg250_sta_invalid_geometryis created and filledboundaries.vg250_sta_tiny_bufferis created and filledboundaries.vg250_sta_unionis created and filled
- filename = 'https://daten.gdz.bkg.bund.de/produkte/vg/vg250_ebenen_0101/2020/vg250_01-01.geo84.shape.ebenen.zip'
- name: str = 'VG250'
- sources: DatasetSources = DatasetSources(tables={}, files={'vg250_zip': 'vg250/vg250_01-01.geo84.shape.ebenen.zip'}, urls={'vg250_zip': 'https://daten.gdz.bkg.bund.de/produkte/vg/vg250_ebenen_0101/2020/vg250_01-01.geo84.shape.ebenen.zip'})
The sources used by the datasets. Could be tables, files and urls
- targets: DatasetTargets = DatasetTargets(tables={'vg250_sta': 'boundaries.vg250_sta', 'vg250_lan': 'boundaries.vg250_lan', 'vg250_rbz': 'boundaries.vg250_rbz', 'vg250_krs': 'boundaries.vg250_krs', 'vg250_vwg': 'boundaries.vg250_vwg', 'vg250_gem': 'boundaries.vg250_gem'}, files={'vg250_zip': 'vg250/vg250_01-01.geo84.shape.ebenen.zip'})
The targets created by the datasets. Could be tables and files
- version: str = 'https://daten.gdz.bkg.bund.de/produkte/vg/vg250_ebenen_0101/2020/vg250_01-01.geo84.shape.ebenen.zip-0.0.9'
The
Dataset’s version. Can be anything from a simple semantic versioning string like “2.1.3”, to a more complex string, like for example “2021-01-01.schleswig-holstein.0” for OpenStreetMap data. Note that the latter encodes theDataset’s date, region and a sequential number in case the data changes without the date or region changing, for example due to implementation changes.
- cleaning_and_preperation()[source]
Creates tables and MViews with cleaned and corrected geometry data.
- The following table is created:
boundaries.vg250_gem_clean where municipalities (Gemeinden) that are fragmented are cleaned from ringholes
- The following MViews are created:
boundaries.vg250_gem_hole
boundaries.vg250_gem_valid
boundaries.vg250_krs_area
boundaries.vg250_lan_union
boundaries.vg250_sta_bbox
boundaries.vg250_sta_invalid_geometry
boundaries.vg250_sta_tiny_buffer
boundaries.vg250_sta_union
- download_files()[source]
Download VG250 (Verwaltungsgebiete) shape files.
Data is downloaded from source specified in datasets.yml in section vg250/original_data/source/url and saved to file specified in vg250/original_data/target/file.