Skip to content

Commit

Permalink
Merge branch 'dev' into fixes/#340-missing-ehv-hvmv-voronoi
Browse files Browse the repository at this point in the history
  • Loading branch information
nailend authored Jul 23, 2021
2 parents 3bde322 + 1967d3f commit 55cae4e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 12 deletions.
2 changes: 1 addition & 1 deletion AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Authors
=======

* Guido Pleßmann, Ilka Cußman, Stephan Günther - https://github.com/openego/eGon-data
* Guido Pleßmann, Ilka Cußman, Stephan Günther, Jonathan Amme - https://github.com/openego/eGon-data
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -194,3 +194,5 @@ Bug fixes
`#289 <https://github.com/openego/eGon-data/issues/289>`_
* Fix versioning conflict with mv_grid_districts
`#340 <https://github.com/openego/eGon-data/issues/340>`_
* Set current working directory as java's temp dir when executing osmosis
`#344 <https://github.com/openego/eGon-data/issues/344>`_
11 changes: 9 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,12 @@ packages are required too. Right now these are:
* To download ERA5 weather data you need to register at the CDS
registration page and install the CDS API key as described
`here <https://cds.climate.copernicus.eu/api-how-to>`_
You also have to agree on the `terms of use
You also have to agree on the `terms of use
<https://cds.climate.copernicus.eu/cdsapp/#!/terms/licence-to-use-copernicus-products>`_

* Make sure you have enough free disk space (~350 GB) in your working
directory.

Installation
============

Expand Down Expand Up @@ -188,6 +191,10 @@ solution.
can't be run on laptop. Use the :ref:`test mode <Test mode>` for
experimenting.

.. warning::

A complete run of the workflow needs loads of free disk space (~350 GB) to
store (temporary) files.

Test mode
---------
Expand All @@ -206,4 +213,4 @@ Data is reduced during execution of the workflow to represent only this area.
Further Reading
===============

You can find more in depth documentation at https://eGon-data.readthedocs.io.
You can find more in-depth documentation at https://eGon-data.readthedocs.io.
22 changes: 13 additions & 9 deletions src/egon/data/processing/osmtgmod/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import datetime
import logging
import codecs
from pathlib import Path
import egon.data.config
from egon.data.config import settings
import egon.data.subprocess as subproc
Expand All @@ -25,8 +26,7 @@ def run_osmtgmod():
target_path = osm_config["target"]["path_testmode"]

filtered_osm_pbf_path_to_file = os.path.join(
egon.data.__path__[0] + "/datasets" + "/osm/"
+ target_path
egon.data.__path__[0], "datasets", "osm", target_path
)
docker_db_config = db.credentials()

Expand All @@ -53,7 +53,7 @@ def import_osm_data():
)

else:
subproc.run(
subproc.run(
[
"git",
"clone",
Expand All @@ -74,8 +74,7 @@ def import_osm_data():
target_path = osm_config["target"]["path_testmode"]

filtered_osm_pbf_path_to_file = os.path.join(
egon.data.__path__[0] + "/datasets" + "/osm/"
+ target_path
egon.data.__path__[0], "datasets", "osm", target_path
)

docker_db_config=db.credentials()
Expand Down Expand Up @@ -141,13 +140,19 @@ def import_osm_data():
{config['osm_data']['osmosis_path_to_binary']}"""
)

# create directory to store osmosis' temp files
osmosis_temp_dir = Path('.') / "osmosis_temp/"
if not os.path.exists(osmosis_temp_dir):
os.mkdir(osmosis_temp_dir)

subproc.run(
"%s --read-pbf %s --write-pgsql \
"JAVACMD_OPTIONS='%s' %s --read-pbf %s --write-pgsql \
database=%s host=%s user=%s password=%s"
% (
f"-Djava.io.tmpdir={osmosis_temp_dir}",
os.path.join(egon.data.__path__[0],
"processing/osmtgmod/osmTGmod/",
config["osm_data"]["osmosis_path_to_binary"]),
"processing/osmtgmod/osmTGmod/",
config["osm_data"]["osmosis_path_to_binary"]),
filtered_osm_pbf_path_to_file,
config_database,
config["postgres_server"]["host"]
Expand All @@ -160,7 +165,6 @@ def import_osm_data():
)
logging.info("Importing OSM-Data...")


# After updating OSM-Data, power_tables (for editing)
# have to be updated as well
logging.info("Creating power-tables...")
Expand Down

0 comments on commit 55cae4e

Please sign in to comment.