Skip to content

jonahgoldwastaken/empower

Repository files navigation

Empower logo

EMPOWER 2.0

Prototype

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.

Getting started

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

Available commands

$ 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

Tech used

Graph examples used

Datasets used

Data Processing

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.

Steps

  1. All CSV files get loaded in, core data is being composed
  2. Quotes get removed from strings where necessary
  3. All subcategories of energy generation (wind, biogas, solar) are combined to the municipalities
  4. Land area use is combined to the municipalities
  5. Total energy generation is combined to the municipalities
  6. Wind and solar projects are combined
  7. Unnecessary keys are removed
  8. 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
  9. Location gets added based on other key data points
    • Lake area
    • Sea area
    • Population
  10. Data is written to a file, ready to be uploaded to MongoDB where it's savely stored for use inside the app.

Example municipality

{
  "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"
}