Skip to content
Snippets Groups Projects
example14.py 641 B
Newer Older
  • Learn to ignore specific revisions
  • root's avatar
    root committed
    import matplotlib.pyplot as plt
    import pandas as pd
    import geopandas as gpd
    
    # Load the csv
    wind_turbines = pd.read_csv("opendata_wka_ib_gv_vb_sh_20250110.csv", encoding="cp1250", sep=";")
    
    # Get the coordinates of the wind turbines
    x_coords = wind_turbines["OSTWERT"].copy()
    y_coords = wind_turbines["NORDWERT"].copy()
    
    # Load the Schleswig-Holstein map
    
    sh_df = gpd.read_file("./kreise.min.geojson")
    
    root's avatar
    root committed
    
    # plot the map
    axes = sh_df.plot()
    
    # plot the coordinates of the wind turbines onto the SH map
    axes.scatter(x_coords, y_coords, c='orange', s=0.5)
    
    # Turn x and y axis off and save figure
    plt.axis('off')
    plt.savefig('output.png', dpi=200)