Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revised geometry filtering of lines #989

Merged
merged 3 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion doc/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ E.g. if a new rule becomes available describe how to use it `snakemake -j1 run_t

**Minor Changes and bug-fixing**

* Minor bug-fixing for GADM_ID format naming. `PR #980 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/980>`__ and `PR #986 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/986>`__
* Minor bug-fixing for GADM_ID format naming. `PR #980 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/980>`__, `PR #986 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/986>`__ and `PR #989 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/989>`__

* Keep data on the original voltage value when rebasing voltages to the standard values and adjust the transmission capacity accordingly. `PR #898 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/978>`__

* Fix download_osm_data compatibility for earth-osm v2.1. `PR #954 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/954>`__ and `PR #988 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/988>`__

* Improve geometry filtering in clean_osm_data. `PR #989 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/989>`__

PyPSA-Earth 0.3.0
=================

Expand Down
2 changes: 1 addition & 1 deletion scripts/build_shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1299,7 +1299,7 @@ def gadm(
# In the case of a contested territory in the form 'Z00.00_0', save 'AA.00_0'
# Include bugfix for the case of 'XXX00_0' where the "." is missing, such as for Ghana
df_gadm["GADM_ID"] = df_gadm["country"] + df_gadm["GADM_ID"].str[3:].apply(
lambda x: x if x[0] == "." else "." + x
lambda x: x if x.find(".") == 0 else "." + x
)
df_gadm.set_index("GADM_ID", inplace=True)
df_gadm["geometry"] = df_gadm["geometry"].map(_simplify_polys)
Expand Down
6 changes: 2 additions & 4 deletions scripts/clean_osm_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,10 +731,8 @@ def filter_lines_by_geometry(df_all_lines):
# drop None geometries
df_all_lines.dropna(subset=["geometry"], axis=0, inplace=True)

# remove lines without endings (Temporary fix for a Tanzanian line TODO: reformulation?)
df_all_lines = df_all_lines[
df_all_lines["geometry"].map(lambda g: len(g.boundary.geoms) >= 2)
]
# remove lines represented as Polygons
df_all_lines = df_all_lines[df_all_lines.geometry.geom_type == "LineString"]

return df_all_lines

Expand Down
Loading