build_bus_regions: add shapes to network

This commit is contained in:
Fabian 2024-04-10 17:47:29 +02:00
parent 0ae016a7d0
commit c19b8d760e

View File

@ -173,12 +173,31 @@ if __name__ == "__main__":
offshore_regions_c = offshore_regions_c.loc[offshore_regions_c.area > 1e-2] offshore_regions_c = offshore_regions_c.loc[offshore_regions_c.area > 1e-2]
offshore_regions.append(offshore_regions_c) offshore_regions.append(offshore_regions_c)
pd.concat(onshore_regions, ignore_index=True).to_file( gdf = pd.concat(onshore_regions, ignore_index=True)
snakemake.output.regions_onshore gdf.to_file(snakemake.output.regions_onshore)
index = gdf.index.astype(int) + n.shapes.index.astype(int).max() + 1
n.madd(
"Shape",
index,
geometry=gdf.geometry,
idx=index,
component="Bus",
type="onshore",
) )
if offshore_regions: if offshore_regions:
pd.concat(offshore_regions, ignore_index=True).to_file( gdf = pd.concat(offshore_regions, ignore_index=True)
snakemake.output.regions_offshore gdf.to_file(snakemake.output.regions_offshore)
index = gdf.index.astype(int) + n.shapes.index.astype(int).max() + 1
n.madd(
"Shape",
index,
geometry=gdf.geometry,
idx=index,
component="Bus",
type="offshore",
) )
else: else:
offshore_shapes.to_frame().to_file(snakemake.output.regions_offshore) offshore_shapes.to_frame().to_file(snakemake.output.regions_offshore)