Skip to content

audev/pct-load

 
 

Repository files navigation

Propensity to Cycle Tool - data loading

This repository generates data hosted in pct-data.

It was originally cloned from pct.

The main script on this repo is load.Rmd. This script runs the R code contained within while creating a summary of the data generating process. It even reports summary statistics from the data as it is created.

To run load.Rmd you should be able to simply hit 'Knit HTML' while loaded RStudio. There are other dependencies, listed below.

Relationship to other pct- folders

The purpose of this repo is to build the data used by pct-shiny. To do this it creates new folders and creates files in pct-data. It relies on open data hosted on pct-bigdata.

Each of the these folder should be 'siblings' in the same folder. All of the folders needed to run the Propensity to Cycle Tool, and modify the input data it uses (e.g. to create new scenarios), can be created with the following shell commands:

# clone the pct data creation scripts
git clone [email protected]:npct/pct-load.git 

# clone the data (warning - large)
git clone [email protected]:npct/pct-data.git --depth 1

# clone the shiny online visualisation framework
git clone [email protected]:npct/pct-shiny.git 

# clone the national level input data
git clone [email protected]:npct/pct-bigdata.git 

The other dependencies are described below. If you have issues with any of these, please report them as an issue.

Set the CS_API_KEY Environment variable

Some of the examples pull data from the CycleStreets.net API. Once you have a token, you can add it in Ubuntu as a session variable using the following in your terminal

echo "export CS_API_KEY='my_token'" >> ~/.profile

or system wide variable

sudo echo "export CS_API_KEY='my_token'" > /etc/profile.d/cyclestreet.sh

Set up rgdal

The version of gdal needs to be newer than 1.11

rgdal::getGDALVersionInfo()
## [1] "GDAL 1.11.2, released 2015/02/10"
# Should return GDAL 1.11.2, released 2015/02/10 (or newer)

It is possible to use the following Personal Package Archive (PPA) to get the latest version of gdal on Ubuntu.

sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable && sudo apt-get update
sudo apt-get install gdal-bin libgdal-dev

About

The scripts for building pct

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • R 100.0%