Webvar
CO2 Emissions (kt) | World Bank Open Data - logo

CO2 Emissions (kt) | World Bank Open Data

World Bank Open Data provides free and open access to various global development data. This release contains Carbon dioxide emissions in kiloton (kt) by all countries in the world. The data is available from year 1960. Carbon dioxide emissions, largely by-products of energy production and use, account for the largest share of greenhouse gases, which are associated with global warming.

Available in

AWS Marketplace

Available in

AWS Marketplace

Purchase this listing from Webvar in AWS Marketplace using your AWS account. In AWS Marketplace, you can quickly launch pre-configured software with just a few clicks. AWS handles billing and payments, and charges on your AWS bill.

About

Carbon dioxide emissions, largely by-products of energy production and use, account for the largest share of greenhouse gases, which are associated with global warming. Anthropogenic carbon dioxide emissions result primarily from fossil fuel combustion and cement manufacturing. In combustion different fossil fuels release different amounts of carbon dioxide for the same level of energy use: oil releases about 50 percent more carbon dioxide than natural gas, and coal releases about twice as much. Cement manufacturing releases about half a metric ton of carbon dioxide for each metric ton of cement produced. Data for carbon dioxide emissions include gases from the burning of fossil fuels and cement manufacture, but excludes emissions from land use such as deforestation. The unit of measurement is kt (kiloton). Carbon dioxide emissions are often calculated and reported as elemental carbon. They are converted to actual carbon dioxide mass by multiplying them by 3.667 (the ratio of the mass of carbon to that of carbon dioxide).

The original publisher of this data is The World Bank. This content is published as World Bank Open Data and provides free and open access to global development data. This work is licensed under a Creative Commons Attribution 4.0 (CC-BY 4.0). This data may be anonymized/aggregated at the source.

# More Information:

- [Source - Carbon Dioxide Information Analysis Center, Environmental Sciences Division, Oak Ridge National Laboratory, Tennessee, United States](https://data.worldbank.org/indicator/EN.ATM.CO2E.KT)

- [Schema Definitions](https://s3.amazonaws.com/rearc-data-provider/co2-emissions/public/co2-emissions-schema.docx)

- [Sample Dataset](https://s3.amazonaws.com/rearc-data-provider/co2-emissions/public/sample.csv)

- [Terms of Use](http://www.worldbank.org/en/about/legal/terms-of-use-for-datasets)

- [World Bank Open Data Homepage](https://data.worldbank.org)

- Frequency: Annual

## What's included?

You will receive access to the following:

- CO2 emissions in kiloton (kt) by major countries in the world from 1960 (co2-emissions.csv)

- CloudFormation template that setups up automatic revision updates using AWS Lambda plus AWS analytics services such as AWS Glue and Amazon Athena (cloudformation.yaml)

- AWS Lambda code for revision updates (post-processing-code.zip)

# Automatic Revision Updates, Analytics and Visualizations

Apart from the source data, what we also provide in this product listing is an automated way to receive automatic revision updates as well as an easy way to interact and extract value out of the dataset. Native AWS Analytics services such as AWS Glue, Amazon Athena and Amazon QuickSight provide different ways to interact and visualize the data. The included AWS CloudFormation template sets up AWS Glue and Amazon Athena automatically in your AWS account and the documentation below describes how to visualize the data using Amazon QuickSight.

[Automatic Revision Updates - This diagram shows the automatic revision update process](https://rearc-data-provider.s3.amazonaws.com/co2-emissions/public/automatic-revision-updates.png)

[Analytics & Visualizations - This diagram shows how the native AWS services are used for Analytics & Visualizations](https://s3.amazonaws.com/rearc-data-provider/co2-emissions/public/data-analysis.png)

## Deploy automation to set up automatic revision updates and AWS Analytics services

Assuming you have subscribed to this product listing, below are the detailed steps to deploy CloudFormation template:

(*Please note that you will need IAM permissions for CloudFormation, AWS Data Exchange, IAM, Lambda, Glue, Athena and QuickSight, in order to deploy the CloudFormation template.*)

- Under the product listing, scroll down to `Data sets` section and click on the Data set name

- Under the `Revisions` section, click on the most recent revision

- Under `Assets`, checkmark `co2-emissions/automation/post-processing-code.zip` and click `Export to S3`

- Choose the S3 Bucket where you would like to store the dataset. Make sure you only choose the S3 bucket. The asset comes with a pre-defined directory structure

- Under `Assets`, checkmark `co2-emissions/automation/cloudformation.yaml` and click either `Export to S3` or `Export to computer`

- If you exported the `cloudformation.yaml` to S3, go to the S3 UI on the AWS console and navigate to the location where the `cloudformation.yaml` is stored. In S3, click on the cloudformation.yaml and copy the url from the `Object URL`

- Now, from your AWS Management Console, log onto Amazon CloudFormation UI and click `Create Stack`

- Under `Choose a template` either provide the template via uploading from local computer or specify the S3 object url and click `Next`

- Provide a friendly stack name in the `Stack name` text box

- In the `SourceS3Bucket` field, input the S3 bucket name that you chose earlier to store the co2-emissions/automation/post-processing-code.zip file

- Leave rest of the fields as is

- Click `Next`

- On the `Configure stack options` page, click `Next`

- On the `Review test` page, checkmark the `I acknowledge...` boxes

- Click `Create stack`

### At a high level, CloudFormation will setup following resources automatically.

- Lambda function to setup automatic AWS Data Exchange revision updates for this dataset

- CloudWatch Event rule that will automatically trigger the Lambda function every time a new revision update is published

- Analytics Lambda function to setup AWS Glue and Amazon Athena

- Necessary IAM roles and permissions

If you are interested in looking at the AWS Lambda code or the CloudFormation template, feel free to inspect files inside `co2-emissions/automation/post-processing-code.zip` and `co2-emissions/automation/cloudformation.yaml`

*Please note, the code for automatic daily revision updates runs in AWS Lambda using Python runtime. AWS Python SDK (boto3) that comes with the default Lambda Python runtime is currently not updated to support AWS Data Exchange and AWS Marketplace Catalog APIs. Hence, we use a Lambda layer on top of the Lambda Python runtime that extends the AWS Python SDK (boto3) to support AWS Data Exchange and AWS Marketplace Catalog APIs as of November 13, 2019. Once the Lambda Python runtime is updated with a newer version of AWS Python SDK (boto3), we will update the code to remove this Lambda layer.*

## Using AWS Glue and Amazon Athena to run interactive queries against the dataset

Once the CloudFormation template is successfully deployed, the data is immediately searchable, queryable, and available on Athena. You can go to the Athena UI from the AWS Management Console and run SQL queries on the dataset.

### Here are some sample Athena SQL queries you can try on the dataset.

**# list co2 emissions for all countries for year 2014**

```bash

SELECT "country_name", "2014" FROM "co2_emissions"."data";

```

**# list yearly co2 emissions for "united states"**

```bash

SELECT * FROM "co2_emissions"."data" WHERE "country_name" = 'united states';

```

**# compare co2 emissions for "united states between year "1980" and "2014"**

```bash

SELECT "country_name", "1980", "2014" FROM "co2_emissions"."data" WHERE "country_name" = 'united states';

```

**# compare co2 emissions between "united states" and "china"**

```bash

SELECT * FROM "co2_emissions"."data" WHERE "country_name" IN ('united states', 'china');

```

## Setup Amazon QuickSight to create visualizations on the dataset

Below are the detailed steps to analyze dataset using Amazon QuickSight

- From your AWS Management Console, log onto Amazon QuickSight

- Click `Manage data`

- Click `New data set`

- If you ran the provided CloudFormation template, you should already have your database and table with schema created in AWS Glue and Athena

- Click on `Athena` to connect to your data source

- Provide a name for your QuickSight `Data source name` and click `Create data source`

- In the `Database: contain sets of table` dropdown, choose database as `co2_emissions` and under `Tables: contain the data you can visualize`, choose table as `data`

- At this point, you can `Edit/Preview data` if you like

- You can then click on `Select`

- In the `Finish data set creation` screen, you can select `Visualize` to finish the creation of data set process

- Visualize the data set by selecting the `Horizontal bar chart` from the `Visual types`

- Drag `country_name` field to the `Y axis` in `Field wells` and for e.g. drag `2014` field in the `Value` block to chart the data

You are now ready to start analyzing and visualizing the dataset.

# Contact Information

If you have questions about the source data, please contact data@worldbank.org. If you have any questions about the CloudFormation stack, Lambda code or any of the AWS services being used, please contact data@rearc.io.

## About Rearc

Rearc is a cloud, software and services company. We believe that empowering engineers drives innovation. Cloud-native architectures, modern software and data practices, and the ability to safely experiment can enable engineers to realize their full potential. We have partnered with several enterprises and startups to help them achieve agility. Our approach is simple — empower engineers with the best tools possible to make an impact within their industry.

Related Products

How it works?

Search

Search 25000+ products and services vetted by AWS.

Request private offer

Our team will send you an offer link to view.

Purchase

Accept the offer in your AWS account, and start using the software.

Manage

All your transactions will be consolidated into one bill in AWS.

Create Your Marketplace with Webvar!

Launch your marketplace effortlessly with our solutions. Optimize sales processes and expand your reach with our platform.