fixup! base_network: Add underwater_fraction to links
This commit is contained in:
parent
4e078002af
commit
900defa07c
@ -262,7 +262,7 @@ def _set_countries_and_substations(n):
|
|||||||
|
|
||||||
def _set_links_underwater_fraction(n):
|
def _set_links_underwater_fraction(n):
|
||||||
offshore_shape = gpd.read_file(snakemake.input.offshore_shapes).set_index('id').unary_union
|
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
|
n.links['underwater_fraction'] = links.intersection(offshore_shape).length / links.length
|
||||||
|
|
||||||
def base_network():
|
def base_network():
|
||||||
|
Loading…
Reference in New Issue
Block a user