openego / eGon-data

GNU Affero General Public License v3.0
10 stars 4 forks source link

Transfer zensus_vg250 scripts #7

Closed IlkaCu closed 3 years ago

IlkaCu commented 4 years ago

Scripts related to preprocessing section zensus_vg250 need to be reviewed, adjusted and transfered to the new egon-data repo.

Tasks

gplssm commented 3 years ago

While I transferred vg250 import scripts, I've realized the is as well code that depends on the existence of census data. Since that is not the case right now, I move the remaining parts to here. So, in addition to the actual "zensus_vg250 scripts", integrate the following code as well:

https://github.com/openego/data_processing/blob/5edca414212ccb4b1df6b046bf916bc2ebb7b4c6/preprocessing/vg250/ego_dp_structure_boundaries_vg250.sql#L450-L687

Don't forget to update the table about required materialized views of vg250: https://github.com/openego/eGon-data/issues/68#issue-757060493

gplssm commented 3 years ago

While working on this, I've realized that VG250 has partially invalid geometry

SELECT bez, gen, ST_IsValid(geometry) FROM boundaries.vg250_sta;

"Bundesrepublik" "Deutschland" false "Bundesrepublik" "Deutschland" true "Bundesrepublik" "Deutschland" true "Bundesrepublik" "Deutschland" true "Bundesrepublik" "Deutschland" true "Bundesrepublik" "Deutschland" true "Bundesrepublik" "Deutschland" true "Bundesrepublik" "Deutschland" true "--" "Österreich (Bodensee)" true "--" "Schweiz (Bodensee)" true "Bundesrepublik" "Deutschland (Bodensee)" true

I don't know if it's relevant, but at least the documentation of ST_Contains (which I'm using on this data) says that invalid geometry might return unexpected results.