OpenEnergyPlatform / open-MaStR

A collaborative software to download the energy database Marktstammdatenregister (MaStR)
https://open-mastr.readthedocs.io/en/latest/
GNU Affero General Public License v3.0
84 stars 17 forks source link

Add MVE such that MaStR data can be plotted on a map #465

Closed El-Don-Quijote closed 1 month ago

El-Don-Quijote commented 1 year ago

Description of the issue

After downloading (bulk) the open-MaStR data I am looking for a minium viable example to plot some of its data on a map. I am unsure if the example jupyter notebooks shall be used, as the documentation states the post-processing features are outdated and additional packages are necessary.

Ideas of solution

To make the most of this package for new users, an additional jupyter notebook explaining basic plotting and aggregation methods would be very useful.

Workflow checklist

chrwm commented 1 year ago

Hi El-Don-Quijote, thanks for your input. We agree with you but due to limited resources we're currently unable to realise new features. Are you interested in contributing on that matter?

El-Don-Quijote commented 1 year ago

Dear chrwm, I can imagine myself doing that! I probably would need some minor guidance however, as I do not have a track record in contributing to projects. Are there some code snippets / notebooks that could serve me as a starting point?

chrwm commented 1 year ago

For the guidelines of how to contribute to the repo, see here.

We have collected post-processing relevant code here.

See this issue for a collection of post-processing features that open-mastr users and maintainer would like to implement in the future

nesnoj commented 1 year ago

Hey @El-Don-Quijote, An MVE-snippet für importing a previously from open-mastr exported unit dataset and displaying via folium, e.g. in a jupy nb:

import pandas as pd
import geopandas as gpd
import folium

wind_turbines = pd.read_csv("bnetza_mastr_wind_raw.csv")

wind_turbines = gpd.GeoDataFrame(
    wind_turbines,
    geometry=gpd.points_from_xy(wind_turbines["Laengengrad"], wind_turbines["Breitengrad"], crs=4326),
    crs=4326,
).to_crs(3035)

wind_turbines = wind_turbines.loc[wind_turbines.EinheitBetriebsstatus == "In Betrieb"]

m = folium.Map(
    location=[52.51, 13.41],
    tiles="cartodbpositron",
    zoom_start=8,
    control_scale=True,
    prefer_canvas=True
)
folium.features.GeoJson(
    wind_turbines.geometry,
    name="Wind turbines",
    marker = folium.CircleMarker(
        radius = 3,
        weight = 1,
        fill_color = "#5555ff",
        color = "#3333ff",
        fill_opacity = 0.5),
).add_to(m)
folium.LayerControl(collapsed=False, position="bottomright").add_to(m)
m

m.save("wind_turbines_map.html")
nesnoj commented 1 month ago

I hope this snippet was of help @El-Don-Quijote , I will close this issue now...