Skip to content

Commit

Permalink
Merge pull request #63 from chihacknight/planned-timeseries
Browse files Browse the repository at this point in the history
Add planned projects to timeseries
  • Loading branch information
derekeder authored Jul 12, 2024
2 parents d9cf790 + 1b89530 commit 8a3accf
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 116 deletions.
91 changes: 2 additions & 89 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,102 +23,15 @@ cd data/scripts
bash run_all.sh
```

You can also run each script individually from the `data/scripts` folder:

```bash
# combine 3 source files into one
python combine_projects.py

# assign il house and senate districts based on tract centroids
python get_tract_districts.py

# aggregate data by county, tract and legilsative districts
python aggregate_data.py
```

## Publishing data with kepler.gl

The interactive map is powered with [kepler.gl](https://kepler.gl/), an open source geospatial analysis tool.

The project is managed in kepler.gl and exported as an HTML page. This page is then renamed to `index.html` and [this patch is applied](https://github.com/keplergl/kepler.gl/pull/2292/files#r1268629776) to load the appropriate version of kepler.gl (2.5.5).

We replace part of the html header meta tags for the site for custom title, description and image:

```html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>Illinois Solar Map - Chi Hack Night / ICJC</title>

<!--Uber Font-->
<link rel="stylesheet" href="https://d1a3f4spazzrp4.cloudfront.net/kepler.gl/uber-fonts/4.0.0/superfine.css">

<!--MapBox css-->
<link href="https://api.tiles.mapbox.com/mapbox-gl-js/v1.1.1/mapbox-gl.css" rel="stylesheet">

<!-— facebook open graph tags -->
<meta property="og:url" content="http://ilsolarmap.com/" />
<meta property="og:title" content="Illinois Solar Map - Chi Hack Night / ICJC" />
<meta property="og:description" content="See how and where over 2,170,000 kilowatts of solar have been installed by zip code in the State of Illinois" />
<meta property="og:site_name" content="Illinois Solar Map" />
<meta property="og:image" content="https://ilsolarmap.com/images/il-solar-map-x4.jpg" />
<meta property="og:image:type" content="image/png" />
<meta property="og:image:width" content="800" />
<meta property="og:image:height" content="800" />

<!-— twitter card tags -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="Illinois Solar Map">
<meta name="twitter:creator" content="Chi Hack Night / ICJC">
<meta name="twitter:title" content="Illinois Solar Map - Chi Hack Night / ICJC">
<meta name="twitter:description" content="See how and where over 2,170,000 kilowatts of solar have been installed in the State of Illinois">
<meta name="twitter:image" content="https://ilsolarmap.com/images/il-solar-map-x4.jpg" />

<!-- Load React/Redux -->
<script src="https://unpkg.com/[email protected]/umd/react.production.min.js" crossorigin></script>
<script src="https://unpkg.com/[email protected]/umd/react-dom.production.min.js" crossorigin></script>
<script src="https://unpkg.com/[email protected]/dist/redux.js" crossorigin></script>
<script src="https://unpkg.com/[email protected]/dist/react-redux.min.js" crossorigin></script>
<script src="https://unpkg.com/[email protected]/dist/styled-components.min.js" crossorigin></script>

<!-- Load Kepler.gl -->
<script src="https://unpkg.com/[email protected]/umd/keplergl.min.js" crossorigin></script>

<style type="text/css">
body {margin: 0; padding: 0; overflow: hidden;}
</style>

<!--MapBox token-->
<script>
/**
* Provide your MapBox Token
**/
const MAPBOX_TOKEN = 'pk.eyJ1IjoiZGF0YW1hZGUiLCJhIjoiaXhhVGNrayJ9.0yaccougI3vSAnrKaB00vA';
const WARNING_MESSAGE = 'Please Provide a Mapbox Token in order to use Kepler.gl. Edit this file and fill out MAPBOX_TOKEN with your access key';
</script>


<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-F7WESE4Z2K"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-F7WESE4Z2K');
</script>

</head>
```

## Setting up and running the website

This site uses Jekyll to serve several static pages and images. The site is published to GitHub Pages.
### Dependencies

* [Jekyll](http://jekyllrb.com/) - Static site generator built in Ruby
* [Bootstrap 5](http://getbootstrap.com) - HTML and CSS layouts
* [mapbox-gl-js 2.15](https://docs.mapbox.com/mapbox-gl-js/guides)
* [jQuery 3.7](https://jquery.com/)
* [DataTables](http://datatables.net) - for searching and sorting tables
* [CSV to HTML Table](https://github.com/derekeder/csv-to-html-table) - for sortable rollup tables

Expand Down
40 changes: 22 additions & 18 deletions about.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h1>About Illinois Solar Map</h1>
<li><a href="#categories-of-solar-projects">Categories of solar projects</a></li>
<li><a href="#projects-by-category">Projects by category</a></li>
<li><a href="#solar-installations-over-time">Solar installations over time</a></li>
<li><a href="#energized-vs-planned">Energized vs planned projects</a></li>
<li><a href="#planned">Planned projects</a></li>
<li><a href="#data-sources">Data sources</a></li>
<li><a href="#missing-data">Missing data</a></li>
<li><a href="#team-and-collaborators">Team and collaborators</a></li>
Expand All @@ -49,7 +49,7 @@ <h2 id="categories-of-solar-projects" class="mt-4">Categories of solar projects<
<li><strong>Small Distributed Generation (Small DG)</strong>: Small Distributed Generation (DG) for systems 25 kW and below</li>
</ul>

<h2 id="projects-by-category" class="mt-4">Energized projects by category</h3>
<h2 id="projects-by-category" class="mt-4">Energized projects by category</h2>
<div class="row">
<div class="col-md-7">
<div id="table-summary"></div>
Expand All @@ -61,7 +61,23 @@ <h2 id="projects-by-category" class="mt-4">Energized projects by category</h3>
</div>
</div>

<h2 id="planned-projects-by-category" class="mt-4">Planned projects by category</h3>
<h2 id="solar-installations-over-time" class="mt-4">Solar installations over time</h2>

<p>Our data covers utility solar projects starting in December 2009. Data from the Adjustable Block Program and Illinois Solar for All start in 2019.</p>

<p>Planned projects are based on scheduled energization dates, which can be delayed. All planned projects have recieved official approval and, based on our research, have a >95% chance of being built.</p>

<figure class="highcharts-figure">
<div id="timeseries-chart"></div>
<p class="highcharts-description"><strong>Description:</strong> Area chart showing the cumulative megawatts of Utility, Small Distributed Generation, Large Distributed Generation and Community solar energized and planned in Illinois. There is a notable increase in megawatts installed starting in late 2019.</p>

</figure>

<h2 id="planned" class="mt-4">Planned projects</h2>

<p>An additional <strong>{{site.planned_mw}} megawatts</strong> of solar is planned or under construction in Illinois, over double what is currently energized.
</p>

<div class="row">
<div class="col-md-7">
<div id="table-summary-planned"></div>
Expand All @@ -72,23 +88,11 @@ <h2 id="planned-projects-by-category" class="mt-4">Planned projects by category<
</figure>
</div>
</div>

<p><em>** Note: our source data does not show planned community solar projects. They are likely grouped with Large DG.</em></p>

<em>** Note: our source data does not show planned community solar projects. They are likely grouped with Large DG.</em>

<h2 id="solar-installations-over-time" class="mt-4">Solar installations over time</h2>

<p>Our data covers utility solar projects starting in December 2009. Data from the Adjustable Block Program and Illinois Solar for All start in 2019. </p>
<p>You can view where and what kind of projects are planned by clicking the 'Planned' selector on the map:</p>

<figure class="highcharts-figure">
<div id="timeseries-chart"></div>
<p class="highcharts-description"><strong>Description:</strong> Area chart showing the cumulative megawatts of Utility, Small Distributed Generation, Large Distributed Generation and Community solar installed in Illinois. There is a notable increase in megawatts installed starting in late 2019.</p>

</figure>

<h2 id="energized-vs-planned" class="mt-4">Energized vs planned projects</h2>

<p>An additional <strong>{{site.planned_mw}} megawatts</strong> of solar is planned or under construction in Illinois, over double what is currently energized. You can view where and what kind of projects are planned by clicking the 'Planned' selector on the map:
</p>
<p class="text-center">
<a href="/index.html#/?status=planned&geography=counties">
<img src="/images/energized-vs-planned.jpg" class="img-fluid img-thumbnail" alt="Energized vs planned solar projects by County" title="Energized vs planned solar projects by County">
Expand Down
36 changes: 31 additions & 5 deletions data/final/monthly-aggregate.csv
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,38 @@ energization_date,CS,Large_DG,Small_DG,Utility
2023-08-01,218,304,312,927
2023-09-01,218,307,327,933
2023-10-01,218,309,347,937
2023-11-01,224,312,367,1067
2023-12-01,224,316,386,1233
2023-11-01,224,313,367,1067
2023-12-01,224,317,386,1233
2024-01-01,224,321,408,1233
2024-02-01,247,327,429,1233
2024-03-01,247,334,447,1233
2024-04-01,247,341,462,1233
2024-04-01,247,342,462,1233
2024-05-01,261,346,474,1234
2024-06-01,268,347,483,1234
2024-07-01,268,347,483,1234
2024-06-01,268,370,483,1271
2024-07-01,268,377,484,1279
2024-08-01,268,445,485,1346
2024-09-01,268,486,486,1407
2024-10-01,268,508,487,1417
2024-11-01,268,540,489,1417
2024-12-01,268,557,494,1704
2025-01-01,268,582,497,2301
2025-02-01,268,633,505,2301
2025-03-01,268,650,511,2310
2025-04-01,268,676,515,2310
2025-05-01,268,710,525,2325
2025-06-01,268,836,528,2332
2025-07-01,268,905,537,2332
2025-08-01,268,1025,542,2345
2025-09-01,268,1137,552,2397
2025-10-01,268,1233,556,2397
2025-11-01,268,1348,559,2547
2025-12-01,268,1359,560,2547
2026-01-01,268,1429,574,2547
2026-02-01,268,1445,574,2547
2026-04-01,268,1455,574,2547
2026-05-01,268,1522,574,2547
2026-06-01,268,1530,574,2547
2026-07-01,268,1530,574,2617
2027-09-01,268,1530,574,3007
2027-12-01,268,1530,574,4207
2028-06-01,268,1530,574,4707
2 changes: 1 addition & 1 deletion data/final/solar-projects-by-place.geojson

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion data/scripts/aggregate_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ def generate_monthly_kw_time_series():
"""calculate aggregated solar by category over time"""
print("Generating monthly time series...")
# load csv into pandas dataframe
df = pd.read_csv("../final/all-projects-w-districts.csv")
all_files = ["../final/all-projects-w-districts.csv", "../final/all-projects_planned-w-districts.csv"]
df = pd.concat((pd.read_csv(f) for f in all_files), ignore_index=True)

# set energization_date column to datetime
df["energization_date"] = pd.to_datetime(df["energization_date"], format='mixed')
Expand Down
14 changes: 12 additions & 2 deletions js/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,24 @@ $.when($.get("/data/final/all_projects_summary.csv")).then(
enabled: false
},
title: {
text: 'Cumulative MW of solar installed over time'
text: 'Cumulative MW of solar energized and planned over time'
},
xAxis: {
type: 'datetime',
min: Date.UTC(2018, 0, 1),
labels: {
format: '{value:%b %Y}'
}
},
plotBands: [{
from: Date.UTC(2024, 6, 1),
to: Date.UTC(2028, 5, 0),
color: '#ccc',
label: {
text: 'Planned',
verticalAlign: 'top',
style: {color: '#333', fontWeight: 'bold'}
}
}]
},
yAxis: {
title: {
Expand Down

0 comments on commit 8a3accf

Please sign in to comment.