The development of the area around Canada Line is explored by looking at the number of business licences issued at different areas along the track over time.
R 3.2.2(with the checkpoint library)QGIS 2.12.0-Lyon(with the NNJoin and Table Manager plugins installed)Python 2.7(with the virtualenv package)
- Google Maps API secret key in the environmental variable
GOOGLE_MAPS_SECRET
Install the checkpoint package and run src/requires.R.
# start in the src/ directory
virtualenv .proj
. .proj/bin/activate
pip install -r requirements.txt- Open as an RStudio project and run
requires.R(this will take a while) - Run
s1_business_data_download.R - Run
s2_transit_selection.R - Run
# start in the data directory
touch geocoded_02_08_14.txt
./geocode.py addresses.txt geocoded_02_08_14.txt
(with the virtualenv activated). The output file geocoded_02_08_14.txt is imported in the next step.
5. Run s3_import_geocoded.R
6. Perform instructions from the Prepare the Spatial data section
7. Run s4_combine_geocoded_with_rest_of_data.R
Run s5_graphics.Rmd for the report graphics, s5_table.R for the table
statistics and s5_graphics.R for the presentation graphics
Additional datasets required:
- Local Area Boundary
- Rapid Transit Lines
- Rapid Transit Stations
- Import the Rapid Transit Line
RTLfile into QGIS. - Select Canada Line from the
RTLlayer - Reproject the dataset into UTM Z10N (EPSG 32610) using the selected feature and save it disk (I'll call it
CanLine)
- Import the Rapid Transit Stations
RTSfile into QGIS. - Select all Canada Line stations from the
RTSlayer - Reproject the dataset into UTM Z10N (EPSG 32610) using the selected feature and save it disk (I'll call it
CanStations)
- Import the Local Area Boundary
RTSfile into QGIS. - Reproject the dataset into UTM Z10N (EPSG 32610) using the selected feature and save it disk (I'll call it
LocalArea)
- Import the
data/stage3.csvfile into QGIS (should have been produced after runnings3_import_geocoded.R) - Reproject the dataset into UTM Z10N (EPSG 32610) using the selected feature and save it disk (I'll call it
Stage3)
- Create a 1km buffer around Canada Line using Geoprocessing Tools
- Save it and call it
CanLineBuffer
Select business licences from Stage3 that interesect CanLineBuffer and call it Stage3InBuffer
- Use NNJoin (input layer:
Stage3InBufferand join layerCanLine). Use Table Manager to delete all columns beginning with "join_", rename the "distance" column to "d_to_track" and call the outputPart2Stage3InBuffer - Use NNJoin (input layer:
Part2Stage3InBufferand join layerCanStaions). Use Table Manager to delete all columns beginning with "join_", rename the "distance" column to "d_to_stat" and call the outputPart3Stage3InBuffer - Export
Part3Stage3InBufferas a csv file (call itdist.csvand place it in thedatadirectory for use in step 7 of the reproduce the graphs section)
- Import
data/complete.txtinto QGIS and reproject it UTM Z10N (call itBusinessLicences) - Add styles to
BusinessLicences,CanLineBuffer,CanStationsandCanLineto match the final maps shown in thegraphicsdirectory. - Use QGIS print composer to add the scale bars and projection information export the results
filtering the
BusinessLicenseslayer to the year 2002 and 2014 respectively.