-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'features/#587-update-osm-residential-buildings' into co…
…ntinuous-integration/run-everything-over-the-weekend-v2
- Loading branch information
Showing
3 changed files
with
28 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/egon/data/datasets/osm_buildings_streets/osm_buildings_filtered_zensus_mapping.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Original Autor: IsGut (johnrobert@t-online.de) | ||
* Adapted by: nesnoj (jonathan.amme@rl-institut.de) | ||
*/ | ||
|
||
---------------------------------------------------------------- | ||
-- Create mapping table of filtered buildings to zensus cells -- | ||
---------------------------------------------------------------- | ||
-- Only selecting buildings wihtin the purged census cells | ||
-- purged of cells with unpopulated areas | ||
-- https://github.com/openego/eGon-data/blob/59195926e41c8bd6d1ca8426957b97f33ef27bcc/src/egon/data/importing/zensus/__init__.py#L418-L449 | ||
drop table if exists boundaries.egon_map_zensus_buildings_filtered; | ||
CREATE TABLE boundaries.egon_map_zensus_buildings_filtered as | ||
select * from ( | ||
select | ||
bld.id, | ||
zensus.grid_id, | ||
zensus.zensus_population_id as cell_id | ||
from openstreetmap.osm_buildings_filtered bld | ||
left join society.egon_destatis_zensus_apartment_building_population_per_ha zensus | ||
on ST_Within(bld.geom_point, zensus.geom) | ||
) bld2 | ||
where bld2.id is not null and bld2.grid_id is not null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters