A project for the EMPOWER 2.0 initiative, empowering policy makers all over the North Sea Region to become green energy prosumers. Created by Jonah Meijers, Rosa Voogd and Fleur van Son.
This project uses Snowpack for bundling, and Netlify for deployment and dev server.
It also requires a valid MongoDB URI in a .env file when developing locally, without the database name attached to it. The MongoDB client will automatically look for a database called "empower" at the provided uri.
$ git clone https://github.com/theonejonahgold/empower
$ cd empower
$ yarn || yarn install || npm install
$ cp .env.example .env
$ echo "MONGO_URI={your_mongodb_uri_here}" > .env
$ yarn start # Starts snowpack dev server
$ yarn dev # Starts netlify dev server (with serverless functions support)
$ yarn build # Builds project to build folder
$ yarn process # Runs dataprocessing/index.js
- Svelte
- svelte-routing
- svelte-loadable
- D3
- Ramda
- Ramda-adjunct
- MongoDB
- PostCSS
- Snowpack
- Prettier
- Netlify Functions
- Radial stacked bar chart by AntonOrlov
- D3 Grouped Bar Chart example
- Map click to zoom example by Mike Bostock
- Kerncijfers wijken en buurten (Core numbers), 2018 (by CBS)
- Bodemgebruik (Land usage) per gemeente, 2018 (by CBS)
- Gemeentegrenzen (Municipality borders), 2019 from ArcGIS Hub (by Esri_NL_Content)
- Total renewable, solar, biogas and wind energy generated per municipality (from several sources, gathered by Klimaatmonitor)
Data processing is done in the dataprocessing
folder. Index.js spits out a JSON file that I upload to a dedicated MonoDB atlas database where I can quickly retrieve all the information I need using the serverless functions in the functions
folder.
- All CSV files get loaded in, core data is being composed
- Quotes get removed from strings where necessary
- All subcategories of energy generation (wind, biogas, solar) are combined to the municipalities
- Land area use is combined to the municipalities
- Total energy generation is combined to the municipalities
- Wind and solar projects are combined
- Unnecessary keys are removed
- Empty strings are changed to zeroes for the following keys:
- Wind energy generation (CSV files are a doozy sometimes)
- Lake area
- Sea area
- Agriculture area
- Living area
- Location gets added based on other key data points
- Lake area
- Sea area
- Population
- Data is written to a file, ready to be uploaded to MongoDB where it's savely stored for use inside the app.
{
"regio": "Delfzijl",
"population": 24716,
"code": 10,
"codeExtended": "GM0010",
"households": 11571,
"regionKind": "Gemeente",
"municipality": "Delfzijl",
"totalArea": 22750,
"livingArea": 598,
"agricultureArea": 10392,
"lakeArea": 0,
"seaArea": 9145,
"solarEnergyGeneration": 154,
"windEnergyGeneration": 1046,
"biogasEnergyGeneration": 0,
"totalEnergyGeneration": 2075,
"solarProjects": [
{
"nr": 48,
"gemeente": "Delfzijl",
"provincie": "Groningen",
"status": "voorbereiding",
"realisatiejaar": 2020,
"dak/grond": "grond",
"type": "lokale coöperatie",
"vermogen": 8500,
"regeling": "onbekend",
}
],
"windProjects": [
{
"nr": 1,
"gemeente": "Delfzijl",
"provincie": "Groningen",
"status": "gerealiseerd",
"realisatiejaar": 2012,
"type": "projectcoöperatie",
"vermogen": 2300,
"(aan)deelgroterwindpark": "",
},
{
"nr": 2,
"gemeente": "Delfzijl",
"provincie": "Groningen",
"status": "gerealiseerd",
"realisatiejaar": 2012,
"type": "projectcoöperatie",
"vermogen": 2300,
"(aan)deelgroterwindpark": "",
}
],
"location": "Coast"
}