Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
0603d63
Create make.bat
IlkaCu Feb 1, 2018
259956a
Create Makefile
IlkaCu Feb 1, 2018
f12c93d
docu test wip
Feb 7, 2018
128805d
add file for scenario wip
Feb 7, 2018
92a31e0
add files for rtd testing
Feb 7, 2018
b18d62e
update scenario text
Feb 7, 2018
21024ba
add file
Feb 7, 2018
59401ec
move bpmn to documentation folder
Ludee Feb 7, 2018
b16e43c
renamed bpmn palette
Ludee Feb 7, 2018
d256269
rename bpmn key
Ludee Feb 7, 2018
7a8666e
move old bpmn to archiv
Ludee Feb 7, 2018
b2c48a5
rename dp bpmn
Ludee Feb 7, 2018
66fcd45
update documentation #92
Ludee Feb 7, 2018
7e19cc5
improve documentation #92
Ludee Feb 7, 2018
debadfe
create bpmn section substation #92
Ludee Feb 7, 2018
f8a5bb1
start dp docu for section powerflow #92
IlkaCu Feb 7, 2018
6aa79b2
Merge branch 'feature/readthedocs' of https://github.com/openego/data…
IlkaCu Feb 7, 2018
86f0816
add requirements for rtd
Feb 8, 2018
0f79f92
delete worng folder
Feb 8, 2018
5cd2954
add requirements for rtd
Feb 8, 2018
6699e41
add RTD button
Feb 8, 2018
46bce17
add files for testing
Feb 8, 2018
d6432a8
add test files
Feb 8, 2018
268c736
add pre and dataprocessing link
Feb 8, 2018
270f6c6
add rtd button for branch
Feb 8, 2018
de926cf
add bpmn section gd
Ludee Feb 8, 2018
2ed6b3a
merge
Ludee Feb 8, 2018
be1a836
update documentation
Ludee Feb 8, 2018
fb03fd3
Update docu hv_setup #92
IlkaCu Feb 8, 2018
4de27a9
update docu loadarea
Ludee Feb 8, 2018
63b30f1
merge
Ludee Feb 8, 2018
68ec5b7
add new files
Feb 8, 2018
d100755
add new files
Feb 8, 2018
c706d82
update docu
Ludee Feb 8, 2018
98c0517
Merge pull request #217 from openego/feature/docu-wolf
Feb 8, 2018
33964af
Update docu osmTgmod_to_pypsa #92
IlkaCu Feb 8, 2018
7d12923
Update and rename README.md to README.rst
Feb 8, 2018
30e7e43
Update docu electrical_neighbours #92
IlkaCu Feb 8, 2018
8b4b04b
remove index from toc
Feb 8, 2018
9195bf0
Update docu grid_future_scenarios #92
IlkaCu Feb 8, 2018
876b011
update docu
Ludee Feb 8, 2018
7884b39
add new script structure
Feb 8, 2018
d3a1ebb
Merge branch 'feature/readthedocs' of github.com:openego/data_process…
Feb 8, 2018
8f592a7
add new structure
Feb 8, 2018
3c37406
update docu
Ludee Feb 8, 2018
13fa8a1
fix toctree
Feb 8, 2018
1e22198
add new toc
Feb 8, 2018
32b8958
test toctree
Feb 8, 2018
ef7fe1a
update doku
Ludee Feb 8, 2018
7ad19a0
merge
Ludee Feb 8, 2018
410c640
update doku
Ludee Feb 8, 2018
292082f
update docu assignment_generator #92
IlkaCu Feb 8, 2018
e8e5579
update doku
Ludee Feb 8, 2018
9414f93
merge
Ludee Feb 8, 2018
a6aa4e5
update doku
Ludee Feb 8, 2018
fdfe91e
change auto-file structure
Feb 8, 2018
0c8a377
Merge branch 'feature/readthedocs' of github.com:openego/data_process…
Feb 8, 2018
464405c
update preprocessing modules
Feb 8, 2018
39f10cc
update assignment_load #92
IlkaCu Feb 8, 2018
83cc0e2
update docu assignment_storage #92
IlkaCu Feb 8, 2018
7611b56
add files and structure
Feb 8, 2018
b451e48
Merge branch 'feature/readthedocs' of github.com:openego/data_process…
Feb 8, 2018
80286e8
update docu generator_timeseries #92
IlkaCu Feb 8, 2018
ecc8002
update doku
Ludee Feb 8, 2018
18a425b
merge
Ludee Feb 8, 2018
c36b21e
add more files
Feb 8, 2018
d5b5f89
Merge branch 'feature/readthedocs' of github.com:openego/data_process…
Feb 8, 2018
42115d4
wip
Feb 8, 2018
ac77475
wip
Feb 8, 2018
5fdf09a
update docu timeseries_demand #92
IlkaCu Feb 8, 2018
3378d2f
add build_script_doc.py script
Feb 8, 2018
af873cf
add build_script_doc.py script
Feb 8, 2018
16013c1
wip index
Feb 8, 2018
932e2b8
update doku
Ludee Feb 8, 2018
ba46056
merge
Ludee Feb 8, 2018
fea8666
rename scripts to fix old messup
Ludee Feb 8, 2018
351665f
update docu create_mviews #92
IlkaCu Feb 8, 2018
a92e99a
add pd files
Feb 8, 2018
eb96a55
add modules
Feb 8, 2018
b9b3b6b
Merge branch 'feature/readthedocs' of github.com:openego/data_process…
Feb 8, 2018
d889bde
update docu LV
Ludee Feb 8, 2018
cfaaf77
merge
Ludee Feb 8, 2018
ee0060f
add modules
Feb 8, 2018
03855a0
Merge branch 'feature/readthedocs' of github.com:openego/data_process…
Feb 8, 2018
9657a0b
Update README.rst
Feb 8, 2018
ce0ae65
update docu LOPF_data #92
IlkaCu Feb 8, 2018
9f5d176
add modules
Feb 8, 2018
bacb207
Merge branch 'feature/readthedocs' of github.com:openego/data_process…
Feb 8, 2018
9860970
update file
Feb 8, 2018
f36a8b5
update files
Feb 8, 2018
1c0441e
update doku REA
Ludee Feb 8, 2018
b2435b3
merge
Ludee Feb 8, 2018
1db70b3
Update modules.rst
Feb 8, 2018
8bd29b1
merge
Ludee Feb 12, 2018
de4ff08
change doc-spring for rtd
Mar 26, 2018
3f918c9
change RTD docu
Mar 26, 2018
7f9569f
change RTD docu
Mar 26, 2018
48a0502
change RTD docu
Mar 26, 2018
189083d
change RTD docu
Mar 26, 2018
1aa937c
add new dp version
Mar 26, 2018
3d4ac5e
add new pages
Mar 26, 2018
0cc779c
update file
Mar 26, 2018
bbb1655
incluede new version
Mar 26, 2018
be0aaf4
test script import
Mar 26, 2018
1f141bd
change order and import of docs
Mar 26, 2018
cd5807c
change page import
Mar 26, 2018
9c06d11
test maxdepth
Mar 26, 2018
a70329a
change title
Mar 26, 2018
dc44f41
change title
Mar 26, 2018
f0c780e
remove files
Mar 27, 2018
cdc0fbb
change structure
Mar 27, 2018
4350414
add new files
Mar 27, 2018
a71a555
change (C)
Mar 27, 2018
c4346ba
add change message
Mar 27, 2018
f62f43f
add open_ego project page
Apr 3, 2018
b740cc1
add open_ego project page
Apr 3, 2018
f402873
add http functions
Apr 3, 2018
e753900
test html inclusion
Apr 3, 2018
0227c18
update and add RTD requires
Apr 3, 2018
3f0cc9d
add installation part from readme.rst
Apr 3, 2018
7e7d86f
test raw import
Apr 3, 2018
8495c5c
merge dev and feature/readthedocs
Apr 5, 2018
806cab0
add changes befor merge
Apr 5, 2018
54ad549
Merge branch 'dev' into feature/readthedocs
Apr 5, 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
29 changes: 22 additions & 7 deletions README.md → README.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
# eGo dataprocessing
(geo)data processing, database setup, data validation
.. image:: https://readthedocs.org/projects/data-processing/badge/?version=feature-readthedocs
:target: http://data-processing.readthedocs.io/en/latest/?badge=feature-readthedocs
:alt: Documentation Status

.. image:: https://openegoproject.files.wordpress.com/2017/02/open_ego_logo_breit.png?w=400


# Copyleft
===================
eGo dataprocessing
===================

(geo)data processing, database setup, data validation

=========
Copyleft
=========
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"

## Installation
Installation
============

Installation of latest release

Expand All @@ -21,14 +33,17 @@ Installation (of developer version) via pip on linux systems as follows
sudo pip3 install -e <path-to-data_processing-repo>
```

### Troubleshooting
Troubleshooting

On Windows
***********

#### On Windows
1. __Problem__: Installation of required package shapely fails. __Solution__: Install pre-build
wheel from [here](http://www.lfd.uci.edu/~gohlke/pythonlibs/#shapely)


## Run
Run
====

You can run data processing by calling command-line script

Expand Down
2,106 changes: 0 additions & 2,106 deletions bpmn/eGo_bpmn_palette.graphml

This file was deleted.

103 changes: 50 additions & 53 deletions dataprocessing/eGo_data_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Also see corresponding BPML diagram.
"""

__copyright__ = "Reiner Lemoine Institut gGmbH"
__copyright__ = "Reiner Lemoine Institut"
__license__ = "GNU Affero General Public License Version 3 (AGPL-3.0)"
__url__ = "https://github.com/openego/data_processing/blob/master/LICENSE"
__author__ = "gplssm, Ludee"
Expand Down Expand Up @@ -40,58 +40,54 @@ def data_processing():
'python_scripts'))

snippets = [
## VACUUM FULL
# 'ego_dp_vacuum_full.sql',

## INPUT DATA CHECK eGoPP
'ego_dp_structure_input_verification.sql', # Check input tables and versions from eGoPP

## SUBSTATION
'ego_dp_substation_hvmv.sql', # Abstract HVMV Substations of the high voltage level from OSM
'ego_dp_substation_ehv.sql', # Abstract EHV Substations of the extra high voltage level from OSM
'ego_dp_substation_otg.sql', # Assign osmTGmod-id to HVMV and EHV substations
'ego_dp_substation_hvmv_voronoi.sql', # HVMV Voronoi cells based on HVMV substations
'ego_dp_substation_ehv_voronoi.sql', # EHV Voronoi cells based on EHV substations

## GRIDDISTRICT
'ego_dp_mv_griddistrict.sql', # MV Griddistricts from municipalities and Voronoi cells
'ego_dp_substation_id_to_generator.sql', # Assign subst_id to pp lists

## LOADAREA
'ego_dp_loadarea_landuse.sql', # OSM landuse sector
'ego_dp_loadarea_industry_consumer.sql', # Industry consumer
'ego_dp_loadarea_loads.sql', # Loads from OSM landuse
'ego_dp_loadarea_census.sql', # Loads from Census
'ego_dp_loadarea_loadmelt.sql', # Melt OSM landuse and Zensus loads
'ego_dp_loadarea_loadcut_griddistrict.sql', # Cut Loadarea with MV Griddistrict
'ego_dp_loadarea_loadcut_voronoi.sql', # Cut Loadarea with MV Voronoi cells
'ego_dp_loadarea_consumption.sql', # Allocate consumption to Loadareas
'ego_dp_loadarea_peakload.sql', # Peak loads per Loadarea
'ego_dp_loadarea_griddistrict_results.sql', # Results for MV Griddistrict
'ego_dp_loadarea_statistic.sql', # Results and statistics for eGoDP

## LOWVOLTAGE
'ego_dp_lv_substation.sql', # MVLV Substation inside Loadarea
'ego_dp_lv_substation_voronoi.sql', # MVLV Substation Voronoi
'ego_dp_lv_griddistrict.sql', # LV Griddistrict
'ego_dp_lv_peakload.sql', # LV OSM areas
'ego_dp_lv_consumption_peakload.sql', # LV Consumption and Peakload

## REA
'rea/ego_dp_lattice_500m.sql', # lattice (point grid) 500m
'rea/ego_dp_lattice_50m.sql', # lattice (point grid) 50m
'rea/ego_dp_rea_wpa_per_mvgd.sql', # wind potential area

'rea/ego_dp_rea_lattice_per_area_500m.sql', # prepare 500m lattice
'rea/ego_dp_rea_lattice_per_area_50m.sql', # prepare 50m lattice
'rea/ego_dp_rea_setup.sql', # setup table for allocation
'rea/ego_dp_rea_m1.sql', # M1 biomass and solar to farmyard
'rea/ego_dp_rea_m2.sql', # M2 windfarms
'rea/ego_dp_rea_m3.sql', # M3 wind turbines to wpa
'rea/ego_dp_rea_m4.sql', # M4 other and rest
'rea/ego_dp_rea_m5.sql', # M5 LV to LA
'rea/ego_dp_rea_results.sql', # results and statistics

## INPUT DATA CHECK (eGoPP)
'ego_dp_structure_input_verification.sql', # Input verification (eGoPP)

## SUBSTATION
'ego_dp_substation_hvmv.sql', # Abstract HVMV Substations of the high voltage level from OSM
'ego_dp_substation_ehv.sql', # Abstract EHV Substations of the extra high voltage level from OSM
'ego_dp_substation_otg.sql', # Assign osmTGmod-id to HVMV and EHV substations
'ego_dp_substation_hvmv_voronoi.sql', # HVMV Voronoi cells based on HVMV substations
'ego_dp_substation_ehv_voronoi.sql', # EHV Voronoi cells based on EHV substations

## GRIDDISTRICT
'ego_dp_mv_griddistrict.sql', # MV GridDistricts from municipalities and Voronoi cells
'ego_dp_substation_id_to_generator.sql', # Assign Substation ID (subst_id) to Generator (Conventional and Renewable)

## LOADAREA
'ego_dp_loadarea_landuse.sql', # OSM landuse sectors
'ego_dp_loadarea_industry_consumer.sql', # OSM Industry consumer
'ego_dp_loadarea_loads.sql', # OSM Loads from landuse
'ego_dp_loadarea_census.sql', # Loads from Census 2011
'ego_dp_loadarea_loadmelt.sql', # Melt loads from OSM landuse and Census 2011
'ego_dp_loadarea_loadcut_griddistrict.sql', # Cut Loadarea with MV Griddistrict
'ego_dp_loadarea_loadcut_voronoi.sql', # Cut Loadarea with MV Voronoi cells
'ego_dp_loadarea_consumption.sql', # Allocate consumption to Loadareas
'ego_dp_loadarea_peakload.sql', # Peak loads per Loadarea
'ego_dp_loadarea_griddistrict_results.sql', # Results for MV Griddistrict
'ego_dp_loadarea_statistic.sql', # Results and statistics for eGoDP data

## LOWVOLTAGE
'ego_dp_lv_substation.sql', # MVLV Substation (ONT)
'ego_dp_lv_substation_voronoi.sql', # MVLV Substation Voronoi
'ego_dp_lv_loadcut.sql' # LV Loadcut
'ego_dp_lv_griddistrict.sql', # LV Griddistrict
'ego_dp_lv_consumption_peakload.sql', # LV Consumption and Peakload

## REA
'rea/ego_dp_lattice_500m.sql', # Lattice (point grid) 500m
'rea/ego_dp_lattice_50m.sql', # Lattice (point grid) 50m
'rea/ego_dp_rea_wpa_per_mvgd.sql', # Wind potential area (WPA)
'rea/ego_dp_rea_lattice_per_area_500m.sql', # Prepare 500m lattice
'rea/ego_dp_rea_lattice_per_area_50m.sql', # Prepare 50m lattice
'rea/ego_dp_rea_setup.sql', # Setup tables for REA
'rea/ego_dp_rea_m1.sql', # M1 biomass and solar to OSM agricultural
'rea/ego_dp_rea_m2.sql', # M2 wind farms
'rea/ego_dp_rea_m3.sql', # M3 wind turbines to WPA
'rea/ego_dp_rea_m4.sql', # M4 other and rest
'rea/ego_dp_rea_m5.sql', # M5 LV to Loadarea
'rea/ego_dp_rea_results.sql', # Results and statistics

## POWERFLOW
'ego_dp_powerflow_assignment_otgid.sql', # assign otg_id to pp lists
'ego_dp_powerflow_assignment_unid.sql', # create a unified_id over all pp (res and conv)
Expand All @@ -100,6 +96,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
85 changes: 44 additions & 41 deletions dataprocessing/sql_snippets/ego_dp_loadarea_census.sql
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/*
census 2011 population per ha
Identify population in osm loads

__copyright__ = "Reiner Lemoine Institut"
__license__ = "GNU Affero General Public License Version 3 (AGPL-3.0)"
__url__ = "https://github.com/openego/data_processing/blob/master/LICENSE"
__author__ = "Ludee"
Loads from Census 2011
Include Census 2011 population per ha.
Identify population in OSM loads.

__copyright__ = "Reiner Lemoine Institut"
__license__ = "GNU Affero General Public License Version 3 (AGPL-3.0)"
__url__ = "https://github.com/openego/data_processing/blob/master/LICENSE"
__author__ = "Ludee"
*/


Expand Down Expand Up @@ -62,7 +63,7 @@ DELETE FROM model_draft.ego_demand_la_zensus AS lp
WHERE lp.inside_la IS TRUE;

-- grant (oeuser)
ALTER TABLE model_draft.ego_demand_la_zensus OWNER TO oeuser;
ALTER TABLE model_draft.ego_demand_la_zensus OWNER TO oeuser;

-- metadata
COMMENT ON TABLE model_draft.ego_demand_la_zensus IS '{
Expand Down Expand Up @@ -96,51 +97,53 @@ INSERT INTO model_draft.ego_demand_la_zensus_cluster(geom)
ORDER BY gid;

-- index gist (geom)
CREATE INDEX ego_demand_la_zensus_cluster_geom_idx
ON model_draft.ego_demand_la_zensus_cluster USING GIST (geom);

-- cluster data
UPDATE model_draft.ego_demand_la_zensus_cluster AS t1
SET zensus_sum = t2.zensus_sum,
area_ha = t2.area_ha,
geom_buffer = t2.geom_buffer,
geom_centroid = t2.geom_centroid,
geom_surfacepoint = t2.geom_surfacepoint
FROM (
SELECT cl.cid AS cid,
SUM(lp.population) AS zensus_sum,
COUNT(lp.geom) AS area_ha,
ST_BUFFER(cl.geom, 100) AS geom_buffer,
ST_Centroid(cl.geom) AS geom_centroid,
ST_PointOnSurface(cl.geom) AS geom_surfacepoint
FROM model_draft.ego_demand_la_zensus AS lp,
model_draft.ego_demand_la_zensus_cluster AS cl
WHERE cl.geom && lp.geom AND
ST_CONTAINS(cl.geom,lp.geom)
GROUP BY cl.cid
ORDER BY cl.cid
) AS t2
WHERE t1.cid = t2.cid;
CREATE INDEX ego_demand_la_zensus_cluster_geom_idx
ON model_draft.ego_demand_la_zensus_cluster USING GIST (geom);

-- index gist (geom_centroid)
CREATE INDEX ego_demand_la_zensus_cluster_geom_centroid_idx
ON model_draft.ego_demand_la_zensus_cluster USING GIST (geom_centroid);
CREATE INDEX ego_demand_la_zensus_cluster_geom_centroid_idx
ON model_draft.ego_demand_la_zensus_cluster USING GIST (geom_centroid);

-- index gist (geom_surfacepoint)
CREATE INDEX ego_demand_la_zensus_cluster_geom_surfacepoint_idx
ON model_draft.ego_demand_la_zensus_cluster USING GIST (geom_surfacepoint);
CREATE INDEX ego_demand_la_zensus_cluster_geom_surfacepoint_idx
ON model_draft.ego_demand_la_zensus_cluster USING GIST (geom_surfacepoint);

-- grant (oeuser)
ALTER TABLE model_draft.ego_demand_la_zensus_cluster OWNER TO oeuser;
ALTER TABLE model_draft.ego_demand_la_zensus_cluster OWNER TO oeuser;

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

-- select description
SELECT obj_description('model_draft.ego_demand_la_zensus_cluster' ::regclass) ::json;
-- 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;

-- cluster data
UPDATE model_draft.ego_demand_la_zensus_cluster AS t1
SET zensus_sum = t2.zensus_sum,
area_ha = t2.area_ha,
geom_buffer = t2.geom_buffer,
geom_centroid = t2.geom_centroid,
geom_surfacepoint = t2.geom_surfacepoint
FROM (
SELECT cl.cid AS cid,
SUM(lp.population) AS zensus_sum,
COUNT(lp.geom) AS area_ha,
ST_BUFFER(cl.geom, 100) AS geom_buffer,
ST_Centroid(cl.geom) AS geom_centroid,
ST_PointOnSurface(cl.geom) AS geom_surfacepoint
FROM model_draft.ego_demand_la_zensus AS lp,
model_draft.ego_demand_la_zensus_cluster AS cl
WHERE cl.geom && lp.geom AND
ST_CONTAINS(cl.geom,lp.geom)
GROUP BY cl.cid
ORDER BY cl.cid
) AS t2
WHERE t1.cid = t2.cid;

-- ego scenario log (version,io,schema_name,table_name,script_name,comment)
SELECT ego_scenario_log('v0.3.0','output','model_draft','ego_demand_la_zensus_cluster','ego_dp_loadarea_census.sql',' ');
Expand Down Expand Up @@ -170,7 +173,7 @@ CREATE MATERIALIZED VIEW model_draft.ego_society_zensus_per_la_mview AS
FROM model_draft.ego_demand_la_zensus_cluster;

-- grant (oeuser)
ALTER TABLE model_draft.ego_society_zensus_per_la_mview OWNER TO 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 '{
Expand Down
Loading