Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
210 commits
Select commit Hold shift + click to select a range
b8d548b
add lv grid building connections
Ludee Jul 14, 2017
28e6c9f
update NN function not working yet
Ludee Jul 14, 2017
3682863
Fix wrong base for transformer per unit values
mariusves Jul 17, 2017
f3b6b01
add renpassgis scripts to dev
Jul 17, 2017
d8325ec
fixed typo
mariusves Jul 17, 2017
87e1940
Merge pull request #155 from openego/fix/hv-transformer-pu-values
Jul 17, 2017
33eb73a
little corrections
KilianZimmerer Jul 25, 2017
ff71ade
add BBPlG EnlAG data
Jul 31, 2017
0aa561f
remove git comment
Aug 1, 2017
39a5ce8
add csv export part
Aug 1, 2017
02c0b2a
add coastdat gid to power plants
Aug 1, 2017
b4e8516
add coastdat_gid to metadata
Aug 1, 2017
0fdfad2
add coastdat_gid to metadata
Aug 1, 2017
29fe583
add update of coastdat_id
Aug 1, 2017
7f687d8
Merge branch 'dev' of github.com:openego/data_processing into dev
Aug 1, 2017
0082609
add solar fill of generation_subtype
Aug 1, 2017
53e3a39
add changes
Aug 1, 2017
0af657c
add new weather point db table script
Aug 1, 2017
c7b5228
Merge branch 'dev' of github.com:openego/data_processing into dev
Aug 1, 2017
f636e19
change _id to id_a as hot fix
Aug 7, 2017
cde9fd4
remove local credentials
Ludee Aug 10, 2017
9b665ef
update metadata to v1.3
KilianZimmerer Aug 10, 2017
388db21
fix metadata
Aug 10, 2017
55e647c
add Alter user and remove % comment
Aug 14, 2017
1017212
add scenario
Aug 15, 2017
3f4663a
add calculation by scenario
Aug 15, 2017
b68e267
Revert " add Alter user and remove % comment"
Aug 15, 2017
380de4a
add output file for feedin
Aug 15, 2017
dcbd4a5
update script WIP
Aug 15, 2017
7ff955b
add el cap factor
Aug 15, 2017
1896349
Merge branch 'dev' of github.com:openego/data_processing into dev
Aug 15, 2017
5b17401
delete id update due to several errors
Aug 16, 2017
ad01ca7
change NEP id function
Aug 16, 2017
bfbb20e
add new tables
Aug 21, 2017
7081039
add new tables
Aug 21, 2017
138a915
add scenario to table
Aug 21, 2017
da6cf18
add check comment
Aug 21, 2017
87bf314
fix feedin
Aug 21, 2017
cd70f6b
change scenario and for loop
Aug 21, 2017
eb8b0d2
chage dtypes of ego_simple_feedin_full
Aug 24, 2017
2b13c46
delete csv
Aug 24, 2017
81fee0a
add insert of clm grid
Aug 24, 2017
a913c08
Merge branch 'dev' of github.com:openego/data_processing into dev
Aug 24, 2017
6eb93d4
insert data update
Aug 24, 2017
6edc313
set comment
Aug 24, 2017
a6c4930
add coastdat id update by cosmoclmgrid
Aug 24, 2017
da34c19
change of input table to climate.cosmoclmgrid
Aug 24, 2017
3447f16
change input table to climate.cosmoclmgrid
Aug 24, 2017
5b15308
change of wrong column name
Aug 24, 2017
0e31b15
change of file path
Aug 28, 2017
6e7431f
change w_id to cosmoclgrid gid
Aug 28, 2017
ff2a296
change sq_view to sq_mview #109
Aug 28, 2017
3debcd2
add last changes etc
Aug 28, 2017
e818e5b
add file name
Aug 28, 2017
d97b232
bugfix missing comma
Aug 28, 2017
6e456c3
add eGo 100
Aug 30, 2017
4f4a5c1
move renpassgis eGo scripts to preprocessing.
Aug 30, 2017
d7ef9b3
add renpassGIS weighted feedin calculation
Sep 4, 2017
76c9203
Automate conection between electrical neighbours
ClaraBuettner Sep 7, 2017
56bb9c0
metadata update
KilianZimmerer Sep 12, 2017
82c7a20
add shutdown >= 2014 to mview
Sep 25, 2017
76a47bd
add shutdown query to mviews
Sep 25, 2017
466b26c
add shutdown statement for conv Mviews
Sep 25, 2017
1487e7b
Update ego_dp_powerflow_electrical_neighbour.sql
ClaraBuettner Sep 25, 2017
21801c1
Update ego_dp_powerflow_electrical_neighbour.sql
ClaraBuettner Sep 25, 2017
8de5f6d
add missing constrains
Sep 30, 2017
63e4b1c
add version to mviews
Sep 30, 2017
b544b62
delete comment
Sep 30, 2017
6be1de5
add owner and grant to mviews
Oct 4, 2017
d2282ec
update owner commend of mview
Oct 4, 2017
5d4d456
metadata v1.3 snippets
KilianZimmerer Oct 17, 2017
39be8d8
added script-header
KilianZimmerer Oct 24, 2017
e3fdc3f
update metadata and table name
Nov 6, 2017
294f3c4
fix metadata style bug
Nov 6, 2017
8bd3509
add metadata file of supply res/conv
Nov 6, 2017
3941c33
little corrections
KilianZimmerer Nov 8, 2017
07fecc5
added the standard for "location"
KilianZimmerer Nov 8, 2017
011449e
update of the comment
KilianZimmerer Nov 8, 2017
014894b
Add connection between electrical neighbours
Nov 27, 2017
7b30ca0
Add connections between electricsl neighbours
Nov 27, 2017
3dc1bad
Merge branch 'feature/electrical_neighbours' of https://github.com/op…
Nov 28, 2017
3b6b24e
pep8 metadata tool
Ludee Dec 13, 2017
06c28ca
merge
Ludee Dec 13, 2017
49f8e03
test to merge master into dev
IlkaCu Dec 18, 2017
da12c5d
Merge pull request #201 from openego/merge_dev_master
Dec 18, 2017
3dc6f04
Include voltage_level column
IlkaCu Dec 20, 2017
47dc238
update meta data
IlkaCu Dec 20, 2017
4c08c22
rename column metadata for ego_io
Ludee Jan 8, 2018
6e9b3ef
Add dataprocessing/sql_snippets/ego_dp_fix_ehv_subnetworks to fix
ClaraBuettner Jan 9, 2018
1cecab4
Add fixes for all scenarios.
ClaraBuettner Jan 10, 2018
da93257
first steps
MarlonSchlemminger Jan 23, 2018
57cc14d
first steps
MarlonSchlemminger Jan 23, 2018
a83cbe3
first steps
MarlonSchlemminger Jan 24, 2018
4e34b70
Include correct comparison operator
IlkaCu Jan 25, 2018
691e9e2
Include entso-e data in preprocessing
ClaraBuettner Jan 26, 2018
0a73b39
change structure of ego_weather_measurement_points
MarlonSchlemminger Jan 31, 2018
cf4d56a
add skript for ego_line_expansion_costs
Feb 1, 2018
94911e7
Fix #200
IlkaCu Feb 1, 2018
9adb209
Revert "Fix #200"
IlkaCu Feb 1, 2018
dfa990f
set p_min_pu_fixed default to -1
IlkaCu Feb 1, 2018
84b245d
Merge pull request #208 from openego/fix/#200
IlkaCu Feb 1, 2018
f832d7c
Update
ClaraBuettner Feb 3, 2018
bb9cf2b
Inlcude link table
IlkaCu Feb 5, 2018
54b0e17
owner to oeuser
IlkaCu Feb 5, 2018
e55f88f
Include metadata for link table
IlkaCu Feb 5, 2018
5a4d553
change generator_id type
IlkaCu Feb 5, 2018
09f2531
Update to implement in dp.
ClaraBuettner Feb 6, 2018
77472b4
change calculation for renewable generation
MarlonSchlemminger Feb 7, 2018
0470eef
Rename README.md to README.rst
Feb 8, 2018
2dd6276
Rename README.rst to README.md
Feb 8, 2018
5083cd1
added materialized view on a subset of generato single tabel. This is…
maltesc Feb 10, 2018
c10276c
next steps
MarlonSchlemminger Feb 12, 2018
f1aa365
adopted dev-branch
MarlonSchlemminger Feb 12, 2018
92ede99
Add scenario log
IlkaCu Feb 13, 2018
0831bea
Update metadata hv_source to v1.3
IlkaCu Feb 13, 2018
10aa05f
update metadata pf_hv_bus
IlkaCu Feb 13, 2018
10978d4
update metadata pf_hv_line
IlkaCu Feb 13, 2018
15c4253
update metadata pf_hv_load
IlkaCu Feb 13, 2018
10f80a8
update metadata to version 1.3
IlkaCu Feb 13, 2018
3da1664
update metadata hv_scenario_settings
IlkaCu Feb 13, 2018
51ff336
update metadata busmap
IlkaCu Feb 13, 2018
2293841
update metadata bus_v_mag_set
IlkaCu Feb 13, 2018
8ade3c1
fix minor bug in meta data
IlkaCu Feb 13, 2018
1a2cd0b
update metadata link table
IlkaCu Feb 13, 2018
debca0e
update copyright
IlkaCu Feb 13, 2018
6f575a4
insert link table into versioning script
IlkaCu Feb 13, 2018
7b82545
Delete .~lock.entsoe_links.csv#
IlkaCu Feb 14, 2018
4c02026
Delete ego_dp_loadarea_statistic.sql
IlkaCu Feb 14, 2018
bd7c312
Create ego_dp_loadarea_statistic.sql
IlkaCu Feb 14, 2018
b3cbe83
Add header
IlkaCu Feb 14, 2018
3d691c5
Merge branch 'dev' into feature/electrical_neighbours
IlkaCu Feb 14, 2018
5335750
new creation weather_measurement_points
MarlonSchlemminger Feb 19, 2018
34aa7bd
Merge pull request #218 from openego/features/specs
Feb 19, 2018
5b56d6f
small changes
MarlonSchlemminger Feb 19, 2018
1bf4db3
resolved conflicts
MarlonSchlemminger Feb 19, 2018
ffeb985
Merge pull request #224 from openego/features/simplefeedin-to-pset
Feb 20, 2018
672d7fb
Fix wind offshore capacity of NEP 2035
Feb 20, 2018
7c3a1a9
update scenario log #226
Ludee Feb 21, 2018
cc36408
move scenario log functions to preprocessing #226
Ludee Feb 21, 2018
41ad250
remove old ego_scenario_log function #226
Ludee Feb 21, 2018
ccc9c92
add entry to metadata
Ludee Feb 21, 2018
85bb1b8
update eGoPP
Ludee Feb 21, 2018
0445a56
adjust load area border to fix #183
Ludee Feb 21, 2018
e7264ee
remove salt from zensus #171
Ludee Feb 21, 2018
3ef2753
salt
Ludee Feb 21, 2018
7cb8f2f
add metadata and remove salt
Ludee Feb 21, 2018
f10d898
metadata on temp tables
Ludee Feb 21, 2018
2dabb42
remove testbuffer for bugfix
Ludee Feb 22, 2018
4a5417d
fix bug mixed wind on/offshore
MarlonSchlemminger Feb 22, 2018
36304a4
change local folder
MarlonSchlemminger Feb 22, 2018
5ecac32
no count
MarlonSchlemminger Feb 22, 2018
1af3548
Merge branch 'dev' into features/simplefeedin-to-pset
MarlonSchlemminger Feb 22, 2018
7faccf5
delete mistake from last merge
MarlonSchlemminger Feb 23, 2018
7426c69
seperate wind on- and offshore
MarlonSchlemminger Feb 26, 2018
35f1148
change table structure and add input
Feb 27, 2018
0b7ff52
seperate wind on- and offshore
MarlonSchlemminger Mar 10, 2018
235e287
foreign offshore feedin
MarlonSchlemminger Mar 10, 2018
20e5775
change calculation offshore for neighbours
MarlonSchlemminger Mar 11, 2018
43e9013
Merge branch 'dev' into features/seperate-wind-on-offshore
MarlonSchlemminger Mar 11, 2018
1c632a5
Merge pull request #233 from openego/features/seperate-wind-on-offshore
Mar 13, 2018
a08136d
Merge pull request #228 from openego/features/line-costs
Mar 13, 2018
a8c5e55
Rename preprocessing/python_scripts/ego_grid_line_expansion_costs_imp…
Mar 13, 2018
f8ff342
delete non used files
Mar 13, 2018
02eaefd
Update polygons for offshore wind turbines
ClaraBuettner Mar 13, 2018
3d8db77
add comment on table
MarlonSchlemminger Mar 13, 2018
c0c7519
change coastdat to climate schema
Mar 13, 2018
3a5e97c
Merge branch 'dev' of github.com:openego/data_processing into dev
Mar 13, 2018
638d7aa
drop table cascade
MarlonSchlemminger Mar 13, 2018
f66204e
delete comment
MarlonSchlemminger Mar 13, 2018
76cc172
new calculation
MarlonSchlemminger Mar 18, 2018
0899823
Merge pull request #234 from openego/feature/adjust_offshore_polygons
IlkaCu Mar 19, 2018
c6dfd06
Merge pull request #221 from openego/feature/electrical_neighbours
IlkaCu Mar 19, 2018
f6f709a
Merge pull request #219 from openego/feature/link_table
IlkaCu Mar 19, 2018
a7d6de8
Add line expansion costs to versioning
IlkaCu Mar 20, 2018
4667e95
add line expansion costs to dp versioning
IlkaCu Mar 20, 2018
74587d8
Merge pull request #238 from openego/feature/versioning_line_expansion
Mar 20, 2018
14377e8
add column version
IlkaCu Mar 20, 2018
3eef3c7
Fix topological errors in Marke and near Jessen.
ClaraBuettner Mar 22, 2018
1cf137e
Merge pull request #240 from openego/feature/adjust_generator_single
Mar 22, 2018
5553b95
update ego_supply_res_woff_2050_temp remove scn SQ
Mar 22, 2018
5ad9ffb
add column w_id
IlkaCu Mar 22, 2018
611a010
Update ego_dp_powerflow_assignment_otgid.sql
IlkaCu Mar 22, 2018
7b1ad03
remove geographical assignment of w_id
IlkaCu Mar 22, 2018
4414af7
Correct metadata
IlkaCu Mar 22, 2018
a3cfc14
correct srid
IlkaCu Mar 22, 2018
8a1898c
remove entries from w_id first
IlkaCu Mar 22, 2018
109cb62
Merge pull request #241 from openego/feature/weather_id
Mar 22, 2018
45e8d90
implementation of new calculation
MarlonSchlemminger Mar 23, 2018
e133c34
change in power_class
MarlonSchlemminger Mar 23, 2018
24e2e13
change SRID
IlkaCu Mar 26, 2018
1afeaef
new simplefeedi and minor changes
MarlonSchlemminger Mar 26, 2018
ff193aa
delete redundant file
MarlonSchlemminger Mar 26, 2018
65efaba
merged
MarlonSchlemminger Mar 26, 2018
1b3bfff
add comment for power class
MarlonSchlemminger Mar 26, 2018
0976f8f
delete comma
MarlonSchlemminger Mar 26, 2018
f391088
include ST_Transform
IlkaCu Mar 26, 2018
1268752
Merge pull request #244 from openego/bugfix/change_srid
Mar 26, 2018
1825ed2
change schema and table name
Mar 27, 2018
b2b7a9f
Update simple_feedin.py
Mar 27, 2018
1add6d1
Merge pull request #245 from openego/features/wind-onshore-calculation
Mar 27, 2018
373178d
add missing file
Mar 27, 2018
53e1ed6
change doc-string
Mar 28, 2018
dc096ef
Create ego_dp_demand_setup.sql
IlkaCu Mar 28, 2018
36a77d5
add missing functions file
Apr 3, 2018
8036106
Merge branch 'dev' of github.com:openego/data_processing into dev
Apr 3, 2018
220ff15
Update ego_dp_rea_results.sql
IlkaCu Apr 3, 2018
ac3f719
Integrate fix-eHV-errors script in dp.
ClaraBuettner Apr 3, 2018
9934edb
add st_transform 3035
Apr 4, 2018
00ff93a
Merge pull request #246 from openego/hotfix/#242
IlkaCu Apr 4, 2018
6d8c4cf
Merge pull request #247 from openego/feature/fix_eHV_subnetworks
IlkaCu Apr 4, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Code licensed under "GNU Affero General Public License Version 3 (AGPL-3.0)"
It is a collaborative work with several copyright owner:
Cite as "eGo dataprocessing Flensburg University of Applied Sciences, Centre for Sustainable Energy Systems Europa-Universit�t Flensburg, Centre for Sustainable Energy Systems Reiner Lemoine Institut DLR Institute for Networked Energy Systems"
Cite as "eGo dataprocessing © Flensburg University of Applied Sciences, Centre for Sustainable Energy Systems © Europa-Universität Flensburg, Centre for Sustainable Energy Systems © Reiner Lemoine Institut © DLR Institute for Networked Energy Systems"

## Installation

Expand Down
1 change: 1 addition & 0 deletions dataprocessing/eGo_data_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def data_processing():
'ego_dp_powerflow_hv_setup.sql', # Set schema/tables for EHV/HV powerflow calculations up
'ego_dp_powerflow_osmtgmod_to_pypsa.sql', # Include data from osmTGmod into EHV/HV powerflow schema
'ego_dp_powerflow_electrical_neighbour.sql', # Create border crossing lines and buses in neighbouring countries
'ego_dp_powerflow_fix_ehv_subnetworks.sql', # Fix topological errors in eHV grid
'ego_dp_powerflow_grid_future_scenarios.sql', # Copy grid to future scenarios
'ego_dp_powerflow_assignment_generator.sql', # Assign generators to corresponding substation (SQ, NEP2035, eGo100)
'ego_dp_powerflow_assignment_load.sql', # Assign loads to their corresponding substation (SQ, NEP2035, eGo100)
Expand Down
87 changes: 27 additions & 60 deletions dataprocessing/sql_snippets/ego_dp_loadarea_census.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ __author__ = "Ludee"


-- ego scenario log (version,io,schema_name,table_name,script_name,comment)
SELECT ego_scenario_log('v0.3.0','input','society','destatis_zensus_population_per_ha_mview','ego_dp_loadarea_census.sql',' ');
SELECT ego_scenario_log('v0.3.0','input','model_draft','destatis_zensus_population_per_ha_invg_mview','ego_dp_loadarea_census.sql',' ');

-- zensus load
DROP TABLE IF EXISTS model_draft.ego_demand_la_zensus CASCADE;
Expand All @@ -25,12 +25,13 @@ CREATE TABLE model_draft.ego_demand_la_zensus (

-- insert zensus loads
INSERT INTO model_draft.ego_demand_la_zensus (gid,population,inside_la,geom_point,geom)
SELECT zensus.gid ::integer,
zensus.population ::integer,
SELECT gid ::integer,
population ::integer,
'FALSE' ::boolean AS inside_la,
zensus.geom_point ::geometry(Point,3035),
zensus.geom ::geometry(Polygon,3035)
FROM society.destatis_zensus_population_per_ha_mview AS zensus;
geom_point ::geometry(Point,3035),
geom ::geometry(Polygon,3035)
FROM model_draft.destatis_zensus_population_per_ha_invg_mview
ORDER BY gid;

-- index gist (geom_point)
CREATE INDEX ego_demand_la_zensus_geom_point_idx
Expand Down Expand Up @@ -65,32 +66,9 @@ ALTER TABLE model_draft.ego_demand_la_zensus OWNER TO oeuser;

-- metadata
COMMENT ON TABLE model_draft.ego_demand_la_zensus IS '{
"Name": "ego zensus loads",
"Source": [{
"Name": "open_eGo",
"URL": "https://github.com/openego/data_processing"}],
"Reference date": "2016",
"Date of collection": "02.09.2016",
"Original file": ["ego_grid_hvmv_substation"],
"Spatial": [{
"Resolution": "",
"Extend": "Germany" }],
"Description": ["osm laods"],
"Column":[
{"Name": "id", "Description": "Unique identifier", "Unit": " " },
{"Name": "area_ha", "Description": "Area", "Unit": "ha" },
{"Name": "geom", "Description": "Geometry", "Unit": " " } ],
"Changes": [
{"Name": "Ludee", "Mail": "",
"Date": "02.09.2015", "Comment": "Created mview" },
{"Name": "Ludee", "Mail": "",
"Date": "17.12.2016", "Comment": "Added metadata" } ],
"Notes": [""],
"Licence": [{
"Name": "",
"URL": "" }],
"Instructions for proper use": [" "]
}' ;
"comment": "eGoDP - Temporary table",
"version": "v0.3.0",
"published": "none" }';

-- select description
SELECT obj_description('model_draft.ego_demand_la_zensus' ::regclass) ::json;
Expand All @@ -113,8 +91,9 @@ CREATE TABLE model_draft.ego_demand_la_zensus_cluster (

-- insert cluster
INSERT INTO model_draft.ego_demand_la_zensus_cluster(geom)
SELECT (ST_DUMP(ST_MULTI(ST_UNION(grid.geom)))).geom ::geometry(Polygon,3035) AS geom
FROM model_draft.ego_demand_la_zensus AS grid;
SELECT (ST_DUMP(ST_MULTI(ST_UNION(geom)))).geom ::geometry(Polygon,3035)
FROM model_draft.ego_demand_la_zensus
ORDER BY gid;

-- index gist (geom)
CREATE INDEX ego_demand_la_zensus_cluster_geom_idx
Expand Down Expand Up @@ -156,32 +135,9 @@ ALTER TABLE model_draft.ego_demand_la_zensus_cluster OWNER TO oeuser;

-- metadata
COMMENT ON TABLE model_draft.ego_demand_la_zensus_cluster IS '{
"Name": "ego zensus loads cluster",
"Source": [{
"Name": "open_eGo",
"URL": "https://github.com/openego/data_processing"}],
"Reference date": "2016",
"Date of collection": "02.09.2016",
"Original file": ["ego_grid_hvmv_substation"],
"Spatial": [{
"Resolution": "",
"Extend": "Germany" }],
"Description": ["osm laods"],
"Column":[
{"Name": "id", "Description": "Unique identifier", "Unit": " " },
{"Name": "area_ha", "Description": "Area", "Unit": "ha" },
{"Name": "geom", "Description": "Geometry", "Unit": " " } ],
"Changes": [
{"Name": "Ludee", "Mail": "",
"Date": "02.09.2015", "Comment": "Created mview" },
{"Name": "Ludee", "Mail": "",
"Date": "17.12.2016", "Comment": "Added metadata" } ],
"Notes": [""],
"Licence": [{
"Name": "",
"URL": "" }],
"Instructions for proper use": [" "]
}' ;
"comment": "eGoDP - Temporary table",
"version": "v0.3.0",
"published": "none" }';

-- select description
SELECT obj_description('model_draft.ego_demand_la_zensus_cluster' ::regclass) ::json;
Expand All @@ -198,6 +154,11 @@ CREATE MATERIALIZED VIEW model_draft.ego_society_zensus_per_la_mview AS
count(geom) AS census_count
FROM society.destatis_zensus_population_per_ha_mview
UNION ALL
SELECT 'destatis_zensus_population_per_ha_invg_mview' AS name,
sum(population),
count(geom) AS census_count
FROM model_draft.destatis_zensus_population_per_ha_invg_mview
UNION ALL
SELECT 'ego_demand_la_zensus' AS name,
sum(population),
count(geom) AS census_count
Expand All @@ -211,5 +172,11 @@ CREATE MATERIALIZED VIEW model_draft.ego_society_zensus_per_la_mview AS
-- grant (oeuser)
ALTER TABLE model_draft.ego_society_zensus_per_la_mview OWNER TO oeuser;

-- metadata
COMMENT ON TABLE model_draft.ego_society_zensus_per_la_mview IS '{
"comment": "eGoDP - Temporary table",
"version": "v0.3.0",
"published": "none" }';

-- ego scenario log (version,io,schema_name,table_name,script_name,comment)
SELECT ego_scenario_log('v0.3.0','output','model_draft','ego_society_zensus_per_la_mview','ego_dp_loadarea_census.sql',' ');
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,15 @@ UPDATE model_draft.ego_demand_loadarea AS t1
) AS t2
WHERE t1.id = t2.id;

-- metadata
COMMENT ON TABLE model_draft.ego_demand_loadarea IS '{
"comment": "eGoDP - Versioning table",
"version": "v0.3.0",
"published": "demand.ego_dp_loadarea" }';

-- ego scenario log (version,io,schema_name,table_name,script_name,comment)
SELECT ego_scenario_log('v0.3.0','output','model_draft','ego_demand_loadarea','ego_dp_loadarea_loadcut_griddistrict.sql',' ');


-- validate area (area_ha) -> exclude smaller 100m²
DROP MATERIALIZED VIEW IF EXISTS model_draft.ego_demand_loadarea_smaller100m2_mview CASCADE;
Expand All @@ -121,6 +130,12 @@ CREATE INDEX ego_demand_loadarea_smaller100m2_mview_geom_idx
-- grant (oeuser)
ALTER TABLE model_draft.ego_demand_loadarea_smaller100m2_mview OWNER TO oeuser;

-- metadata
COMMENT ON MATERIALIZED VIEW model_draft.ego_demand_loadarea_smaller100m2_mview IS '{
"comment": "eGoDP - Temporary table",
"version": "v0.3.0",
"published": "none" }';

-- ego scenario log (version,io,schema_name,table_name,script_name,comment)
SELECT ego_scenario_log('v0.3.0','temp','model_draft','ego_demand_loadarea_smaller100m2_mview','ego_dp_loadarea_loadcut_griddistrict.sql',' ');

Expand Down Expand Up @@ -185,22 +200,22 @@ UPDATE model_draft.ego_demand_loadarea AS t1
-- ego scenario log (version,io,schema_name,table_name,script_name,comment)
SELECT ego_scenario_log('v0.3.0','input','society','destatis_zensus_population_per_ha_mview','ego_dp_loadarea_loadcut_griddistrict.sql',' ');

-- zensus 2011 population
UPDATE model_draft.ego_demand_loadarea AS t1
SET zensus_sum = t2.zensus_sum,
zensus_count = t2.zensus_count,
zensus_density = t2.zensus_density
FROM (SELECT a.id AS id,
SUM(b.population)::integer AS zensus_sum,
COUNT(b.geom_point)::integer AS zensus_count,
(SUM(b.population)/COUNT(b.geom_point))::numeric AS zensus_density
FROM model_draft.ego_demand_loadarea AS a,
society.destatis_zensus_population_per_ha_mview AS b
WHERE a.geom && b.geom_point AND
ST_CONTAINS(a.geom,b.geom_point)
GROUP BY a.id
)AS t2
WHERE t1.id = t2.id;
-- zensus 2011 population in LA
UPDATE model_draft.ego_demand_loadarea AS t1
SET zensus_sum = t2.zensus_sum,
zensus_count = t2.zensus_count,
zensus_density = t2.zensus_density
FROM ( SELECT a.id AS id,
SUM(b.population) ::integer AS zensus_sum,
COUNT(b.geom_point) ::integer AS zensus_count,
(SUM(b.population)/COUNT(b.geom_point)) ::numeric AS zensus_density
FROM model_draft.ego_demand_loadarea AS a,
society.destatis_zensus_population_per_ha_mview AS b
WHERE a.geom && b.geom_point AND
ST_CONTAINS(a.geom,b.geom_point)
GROUP BY a.id
)AS t2
WHERE t1.id = t2.id;

/*
-- ego scenario log (version,io,schema_name,table_name,script_name,comment)
Expand Down Expand Up @@ -269,6 +284,12 @@ UPDATE model_draft.ego_demand_loadarea AS t1
) AS t2
WHERE t1.id = t2.id;

-- metadata
COMMENT ON TABLE model_draft.ego_osm_sector_per_griddistrict_1_residential IS '{
"comment": "eGoDP - Temporary table",
"version": "v0.3.0",
"published": "none" }';

-- ego scenario log (version,io,schema_name,table_name,script_name,comment)
SELECT ego_scenario_log('v0.3.0','output','model_draft','ego_osm_sector_per_griddistrict_1_residential','ego_dp_loadarea_loadcut_griddistrict.sql',' ');

Expand Down Expand Up @@ -318,6 +339,12 @@ UPDATE model_draft.ego_demand_loadarea AS t1
) AS t2
WHERE t1.id = t2.id;

-- metadata
COMMENT ON TABLE model_draft.ego_osm_sector_per_griddistrict_2_retail IS '{
"comment": "eGoDP - Temporary table",
"version": "v0.3.0",
"published": "none" }';

-- ego scenario log (version,io,schema_name,table_name,script_name,comment)
SELECT ego_scenario_log('v0.3.0','output','model_draft','ego_osm_sector_per_griddistrict_2_retail','ego_dp_loadarea_loadcut_griddistrict.sql',' ');

Expand Down Expand Up @@ -345,6 +372,12 @@ CREATE INDEX osm_deu_polygon_urban_sector_3_industrial_nolargescale_mview_geom
-- grant (oeuser)
ALTER TABLE openstreetmap.osm_deu_polygon_urban_sector_3_industrial_nolargescale_mview OWNER TO oeuser;

-- metadata
COMMENT ON MATERIALIZED VIEW model_draft.osm_deu_polygon_urban_sector_3_industrial_nolargescale_mview IS '{
"comment": "eGoDP - Temporary table",
"version": "v0.3.0",
"published": "none" }';

-- ego scenario log (version,io,schema_name,table_name,script_name,comment)
SELECT ego_scenario_log('v0.3.0','output','openstreetmap','osm_deu_polygon_urban_sector_3_industrial_nolargescale_mview','setup_osm_landuse.sql',' ');

Expand Down Expand Up @@ -404,6 +437,12 @@ UPDATE model_draft.ego_demand_loadarea AS t1
) AS t2
WHERE t1.id = t2.id;

-- metadata
COMMENT ON TABLE model_draft.ego_osm_sector_per_griddistrict_3_industrial IS '{
"comment": "eGoDP - Temporary table",
"version": "v0.3.0",
"published": "none" }';

-- ego scenario log (version,io,schema_name,table_name,script_name,comment)
SELECT ego_scenario_log('v0.3.0','output','model_draft','ego_osm_sector_per_griddistrict_3_industrial','ego_dp_loadarea_loadcut_griddistrict.sql',' ');

Expand Down Expand Up @@ -453,6 +492,12 @@ UPDATE model_draft.ego_demand_loadarea AS t1
) AS t2
WHERE t1.id = t2.id;

-- metadata
COMMENT ON TABLE model_draft.ego_osm_sector_per_griddistrict_4_agricultural IS '{
"comment": "eGoDP - Temporary table",
"version": "v0.3.0",
"published": "none" }';

-- ego scenario log (version,io,schema_name,table_name,script_name,comment)
SELECT ego_scenario_log('v0.3.0','output','model_draft','ego_osm_sector_per_griddistrict_4_agricultural','ego_dp_loadarea_loadcut_griddistrict.sql',' ');

Expand Down Expand Up @@ -560,6 +605,12 @@ CREATE INDEX ego_demand_loadarea_error_noags_mview_geom_idx
-- grant (oeuser)
ALTER TABLE model_draft.ego_demand_loadarea_error_noags_mview OWNER TO oeuser;

-- metadata
COMMENT ON MATERIALIZED VIEW model_draft.ego_demand_loadarea_error_noags_mview IS '{
"comment": "eGoDP - Temporary table",
"version": "v0.3.0",
"published": "none" }';

-- ego scenario log (version,io,schema_name,table_name,script_name,comment)
SELECT ego_scenario_log('v0.3.0','temp','model_draft','ego_demand_loadarea_error_noags_mview','ego_dp_loadarea_loadcut_griddistrict.sql',' ');

Expand Down
Loading