fixup! base_network: Add underwater_fraction to links

This commit is contained in:
Jonas Hörsch 2018-08-16 22:12:30 +02:00
parent 4e078002af
commit 900defa07c

View File

@ -262,7 +262,7 @@ def _set_countries_and_substations(n):
def _set_links_underwater_fraction(n):
offshore_shape = gpd.read_file(snakemake.input.offshore_shapes).set_index('id').unary_union
links = gpd.GeoSeries(n.links.geometry.map(loads))
links = gpd.GeoSeries(n.links.geometry.map(shapely.wkt.loads))
n.links['underwater_fraction'] = links.intersection(offshore_shape).length / links.length
def base_network():