{ "cells": [ { "cell_type": "markdown", "id": "29235f2f-2cb2-42f5-b62f-675e3630b627", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "# Solar Energy Systems in Denmark\n", "\n", "```{post} 2024-01-18\n", ":tags: open science\n", ":author: Adam R. Jensen\n", ":image: 1\n", "```" ] }, { "cell_type": "markdown", "id": "37851f7d-c631-4654-9d9c-194e8b7f18ff", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "The Danish Agency for Data Supply and Infrastructure (Styrelsen for Dataforsyning og Infrastruktur - SDFI) recently released a dataset of all the solar energy plants in Denmark. The dataset consists of polygons of all the PV plants and solar thermal district heating plants. The initiative is described in more detail [here](https://dataforsyningen.dk/labs/4905)\n", "\n", "This blog post is a simple demonstration of how to interactively visualize this dataset, which can be used to explore the locations of solar energy plants in Denmark. \n", "\n", "The necessary token can be obtained by creating a user at [https://dataforsyningen.dk](https://dataforsyningen.dk)." ] }, { "cell_type": "markdown", "id": "90829e60-b355-49b2-b4b1-cd957d45b469", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "For the demonstration of the WMS tile service, I will take the Vandel PV plant as an example which is shown in the photo below. Notice how the plant is located at a decommissioned air strip.\n", "\n", "````{image} /images/vandel_pv_plant.png\n", ":class: bg-dark\n", ":target: https://www.sphinx-doc.org/en/master/\n", ":height: 350px\n", "````\n", "\n", "
\n", "\n", "\n", "The interactive map below was made using [Folium](https://python-visualization.github.io/folium/latest/) and has the WMS tile overlays of the solar energy plants." ] }, { "cell_type": "code", "execution_count": 1, "id": "2c8c8a04-b13d-4946-8d56-052d90529f96", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [ "remove-cell" ] }, "outputs": [], "source": [ "token = '1d0dde96bdf27962f612b4df087bbdcc'" ] }, { "cell_type": "code", "execution_count": 7, "id": "d44bfab5-12ce-447c-a7be-f0f879024485", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [ "hide-input" ] }, "outputs": [ { "data": { "text/html": [ "
Make this Notebook Trusted to load map: File -> Trust Notebook
" ], "text/plain": [ "" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import folium\n", "from folium import plugins\n", "\n", "map = folium.Map(\n", " location=[55.70, 9.20],\n", " zoom_start=14,\n", " tiles='openstreetmap',\n", ")\n", "\n", "names_dict = {'solceller': 'PV plants', 'solfanger': 'Solar district heating plants'}\n", "\n", "for type in names_dict.keys():\n", " folium.raster_layers.WmsTileLayer(\n", " url=f'https://api.dataforsyningen.dk/wms/solenergianlaeg?token={token}',\n", " layers=type,\n", " styles=None,\n", " fmt=\"image/png\",\n", " transparent=True, \n", " attr='Styrelsen for Dataforsyning og Infrastruktur',\n", " name=names_dict[type],\n", " overlay=True,\n", " control=True,\n", " show=True,\n", " ).add_to(map)\n", "\n", "EsriImagery = \"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}\"\n", "EsriAttribution = \"Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community\"\n", "folium.raster_layers.TileLayer(EsriImagery, name='World imagery', attr=EsriAttribution).add_to(map)\n", "\n", "folium.LayerControl().add_to(map)\n", "folium.plugins.Fullscreen().add_to(map) # Add full screen button to map\n", "folium.LatLngPopup().add_to(map) # Show latitude/longitude when clicking on the map\n", "\n", "map" ] }, { "cell_type": "markdown", "id": "29c03389-e23d-47e8-9ac8-0ad9ebc7595f", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [ "hide-input" ] }, "source": [] }, { "cell_type": "code", "execution_count": null, "id": "1ae99598-5983-4151-908b-5172871338e9", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "37decc66-7455-4da8-9454-55063ba0cfc2", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "15109478-2031-41a8-a129-c2408fc67b3b", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.6" } }, "nbformat": 4, "nbformat_minor": 5 }