added text explanations

This commit is contained in:
Jeremy Kidwell 2019-03-13 22:53:08 +00:00
parent 7138b39e11
commit 6c4ea02cc1
6 changed files with 69 additions and 69 deletions

View File

@ -1,32 +1,42 @@
01-Session1.Rmd
# Session 1
# Challenge 1: Find yourself on the map
## Challenge 1: Find yourself on the map
Goal: getting comfortable with the Carto interface
Part 1, building a data set:
- Carto, create empty map
- Click "Add points"
- Zoom and drag to UK, then to greater Birmingham (zoom level 10)
- Click through basemaps until you find one you like
- Now click and drag until you find your home (zoom level 17)
- Add a point for your place of residence
- Now switch to "data view"
- Add a name and description for your point on the table
- Add a new column (click on arrow next to "name" column) and click on "Add new column" give the column a new name "rating" and change the data type to "number"
- Now choose a category to add some points of interest, maybe coffee shops, restaurants, study places, etc. Add at least five features to the map (click on the small button on the bottom right hand side - a circle with a +) which fit in this category. Make sure you are setting accurate locations (at zoom level 17). Now add "metadata" - give each point a name, brief description, and then fill in a number to rate those sites based on your personal sense of the place. I recommend you use a five point scale with 5 being "best" and 1 being "worst".
First, log into your account at [https://carto.com/login](https://carto.com/login). Once you are logged in you can start to tinker with the platform.
Part 2, visualising your data:
- Zoom out so that you can see all your points
- Open up the "map layer" toolbar on the right hand side.
- Rename your table from "untitled table" to something descriptive (maybe "my coffee shops").
Let's begin by building a data set, so you can get a sense of how those points get on the (digital) map.
### Part 1, building a data set:
- In Carto, create an empty map. You do this by clicking on "New map" from the second toolbar while in your Carto dashboard. Then click on "Create Empty Map" on the right hand side. This will take a minutes.
- From the dialogue that comes up, click "Add points"
- The map will begin at the whole world. First zoom in (double click on the map, or click on the + sign on the left corner and click + drag the map to center it properly) until you can just see the UK. Zoom in a bit futher on to greater Birmingham. Notice how Carto gives you a number for your "zoom level" on the left hand side. You should eventually be on zoom level 10, centered on Birmingham.
- The backgrond map is called a "base map". Carto gives you several options to choose from. Click on "Change basemap" in the bottom left corner, and test out different basemaps until you find one you like.
- Now click and drag until you find your residence in Birmingham, probably around zoom level 17.
- Add a point for your place of residence. Note, you may need to "discard" the point and add a new one, using the add button on the bottom right-hand corner (it's a circle with a + on it). Simply click on the map to add your point. Then click "done".
- Now switch to "data view" (it's on the top, in the centre).
- Data view looks a lot like a spreadsheet, except there are coordinates and a bit of information about the point you've just put down.
- Double-click in the box for name and description and add some relevant information for your point on the table.
- Next, add a new column (click on the small down arrow next to "name" column) and click on "Add new column" give the column a new name "rating".
- Change the data type to "number" - you can do this by bring up the column settings menu (down arrow at the top of the column next to the title) and clicking on "Change data type". Select "number" and then click on "OK, Change it".
- Next, I'd like you to add several other points to your map for the local area. To make this simple, think of an arbitrary category around which to add some points of interest, maybe coffee shops, restaurants, study places, etc. Add at least five features to the map (click on the small button on the bottom right hand side - a circle with a +) which fit in this category. Make sure you are placing them at accurate locations (at zoom level 17). Now add "metadata" - give each point a name, brief description, and then fill in a number to rate those sites based on your personal sense of the place. I recommend you use a five point scale with 5 being "best" and 1 being "worst".
Once you have a table in data view that has 6 rows, you're ready to move on to the next step.
### Part 2, visualising your data:
- Switch to "Map View"
- Zoom out until you can see all your points on the screen. The easiest way to do this is by clicking on the layer number ("1") to open the drawer for the menu.
- Open up the "map layer wizard" toolbar on the right hand side (it may already be open as it's the default).
- Rename your table from "untitled table" to something descriptive (maybe "my neighbourhood").
- You should already be on the "wizards" pane (icon of square with paintbrush) but switch to this if you aren't already there
- Change the map type from "simple" to "bubble"
- Change the max radius to 50 so we'll have a more dramatic effect.
- Change the bubble fill to your favourite colour.
- Switch to the info window pane (icon of text bubble) - note that there are tabs for "click" and "hover"
- Set the "hover" setting to display the name of each of your sites and the "click" setting to show name and description.
- Make the dots 60% transparent (0.6)
- Change the max radius to 50 so we'll have a more dramatic effect (radius is the third line under options, the max is the second box).
- Change the bubble fill to your favourite colour. Do this by clicking on the coloured rectangle, which will bring up a range of options.
- Now, switch to the info window pane (icon is a text bubble) - note that there are tabs for "click" and "hover"
- Set the "hover" setting to display the name of each of your sites and the "click" setting to show name and description.
- Move the mouse over your points on the map to see how this behaviour works.
- Return to the "map layer wizard menu" and make the dots 60% transparent (0.6). Do this by clicking on the down/up arrows next to the box with a number in it. This should be to the right of "Bubble fill"
- Now zoom out (zoom level 12 or lower).
- Try out a few different map types to see which is best for visualising your data at this zoom level. Try "choropleth," "heat map" and "intensity".

View File

@ -1,15 +1,23 @@
02-Session2.Rmd
# Session 2
# Challenge 2: Work with existing data
## Challenge 2: Work with existing data
Part 1, getting data:
- Download some West Midlands crime statistics using the following file: [https://github.com/kidwellj/intro_to_geospatial_carto/raw/master/data/westmids_crime.zip] - note I've gotten these from here: [https://data.police.uk/](https://data.police.uk/).
- There will be a whole bunch of files in there (2 years worth of monthly crime stats for the West Midlands). Unzip the file (by double-clicking on it), then find the folder `2018-12` and inside that the file `2018-12-west-midlands-street.csv`
- Import the `2018-12-west-midlands-street.csv` data file into your carto account. In map view click "Add Layer" then click on "Connect Dataset", make sure "Data file" is selected and then click and drag the csv file onto "Drag and drop your file" (or click on "Browse" and locate it that way).
Now that you've learned how to work with your own simple data set, for this second session, we will work with some existing and more complex data.
### Part 1, getting data:
Start off by downloading some West Midlands crime statistics using the following file: [https://github.com/kidwellj/intro_to_geospatial_carto/raw/master/data/westmids_crime.zip](https://github.com/kidwellj/intro_to_geospatial_carto/raw/master/data/westmids_crime.zip). If you type this URL into a web browser, it should begin to download automatically. Note, this data is a tidied version of publicly available police statistics that you can find here: [https://data.police.uk/](https://data.police.uk/).
There will be a whole bunch of files in there (2 years worth of monthly crime stats for the West Midlands). Unzip the file (by double-clicking on it), then find the folder `2018-12` and inside that the file `2018-12-west-midlands-street.csv`
Import the `2018-12-west-midlands-street.csv` data file into your carto account:
- In map view click "Add Layer" then click on "Connect Dataset", make sure "Data file" is selected and then click and drag the csv file onto "Drag and drop your file" (or click on "Browse" and locate it that way).
- Click "Add layer" and the file will be uploaded into carto as a new data layer. This may take a wee while, so be patient.
- Now you have a whole lot of new dots! Let's make those dots more meaningful with some visualisation tricks you've just learned in the previous challenge.
Part 2, visualisation by category:
### Part 2, visualisation by category:
Open the toolbox to the right and the map layer wizard we just used in the previous session:
- Switch your map style to "Category" and switch the column to "crime_type"
- Carto does a lot of the hard work for you here, but you might want to do a bit of tweaking.
- Add some transparency so that overlapping dots darken a spot (change the number after marker fill from 0.9 to 0.6 or lower and watch what happens.
@ -17,10 +25,11 @@ Part 2, visualisation by category:
- There are a lot of categories here, and some of the colours assigned by Carto may be light/dark versions of the same colour. This can be a bit confusing as we're working with overlapping transparency. It's best if we can make sure all of the colours are unique. Experiment a bit with using different shapes or icons to differentiate categories. To change to a shape/icon click on "img" to the right of the category. Consider taking a diversion into the noun project here if you'd like to spend a bit more time on this (below).
- Choose a basemap that looks nice for this map.
- Set up your map so that it displays information on hover, I'd recommend crime_type, last_outcome_category, and reported_by - but will leave the details to you.
- Polish off your map with a title!
- This map does a good job of showing individual incidence of crimes and works best at a close zoom (level 15 or higher). Let's create a new layer now that shows a different kind of visualisation at a wider zoom.
- Polish off your map with a title! You can add elements like a title by clicking on "Options" in the bottom left-hand corner.
Part 3, visualisation by density:
This map does a good job of showing individual incidence of crimes and works best at a close zoom (level 15 or higher). Let's create a new layer now that shows a different kind of visualisation at a wider zoom.
### Part 3, visualisation by density:
- Return to the main carto dashboard by clicking on "Maps" and "New Map"
- From the add datasets window that appears, select from "Your Datasets" and then pick out your crime data table (default name is "table_2018_12_west_midlands_street" unless you've changed it). We're going to add the same data to our map as a new layer and configure it differently.
- Once the new layer has been added, turn off display for the other two tables (using the small slider on the right of the title).

View File

@ -1,8 +1,8 @@
pdf:
Rscript --quiet _render.R "bookdown::pdf_book"
Rscript --quiet index.Rmd "bookdown::pdf_book"
gitbook:
Rscript --quiet _render.R "bookdown::gitbook"
Rscript --quiet index.Rmd "bookdown::gitbook"
all:
Rscript --quiet _render.R
Rscript --quiet index.Rmd

View File

@ -1,7 +1,7 @@
book_filename: "data_ethics-law_course"
book_filename: "intro_to_geospatial"
chapter_name: "Chapter "
repo: https://github.com/kidwellj/data_ethics-law_course
repo: https://github.com/kidwellj/intro_to_geospatial_carto
output_dir: docs
rmd_files: ["index.Rmd", "01-Overview.Rmd", "02-Session1.Rmd", "03-Session2.Rmd", "04-Session3.Rmd", "05-Session4.Rmd"]
rmd_files: ["index.Rmd", "00-Authors.Rmd", "01-Session1.Rmd", "02-Session2.Rmd"]
clean: [packages.bib, bookdown.bbl]
new_session: yes

View File

@ -1,17 +0,0 @@
bookdown::gitbook:
css: style.css
split_by: chapter
config:
toc:
collapse: subsection
before: |
<li><a href="./">An OER on the ethics and legality of working with digital data in research</a></li>
after: |
<li><a href="https://github.com/rstudio/bookdown" target="blank">Published with bookdown</a></li>
bookdown::pdf_book:
includes:
in_header: preamble.tex
latex_engine: xelatex
citation_package: natbib
bookdown::epub_book:
stylesheet: style.css

View File

@ -1,24 +1,22 @@
---
title: "what can I do with stuff I find online?"
author: "Alex Fenlon and Jeremy H. Kidwell"
date: "2016-12-02"
title: "Introduction to Geospatial Data Visualisation"
author: "Jeremy H. Kidwell"
date: "2019-03-12"
site: bookdown::bookdown_site
documentclass: book
bibliography: [book.bib]
biblio-style: apalike
# bibliography: [book.bib]
# biblio-style: apalike
link-citations: yes
github-repo: kidwellj/data_ethics-law_course
url: 'http\://jeremykidwell.info/files/bookdown/data_ethics-law_course/'
# cover-image:
description: "A short course on the ethics and legality of working with data"
github-repo: kidwellj/intro_to_geospatial_carto
url: 'http\://jeremykidwell.info/files/bookdown/intro_to_geospatial_carto/'
description: "A brief OER lab/course intended to give Undergraduates a basic orientation to geospatial data using the carto platform"
---
# Introduction to the module
This module has been designed to enable independent learners to aquire knowledge about contemporary legal and methodological issues surrounding digital data and research, and to provoke some thinking on the big questions that underpin some of the more practical issues we discuss here.
This module has been designed to enable independent learners to gain a basic familiarity with data visualisation, using the CartoDB platform.
Ideally, a student should expect to invest at least four hours in independent learning activities (reading articles, writing reflections, etc.) over the course of a week. It should be possible to work through this a bit more slowly and in-depth. We have tried to point to a range of resources, both those which are accessible and those which are challenging. It is also worth noting that this module is included in a broader effort underway at the University of Birmingham, the "Birmingham Digital" which has other modules working alongside this one.
Ideally, a student should expect to invest at least four hours in independent learning activities over the course of a week. It should be possible to work through this a bit more slowly and in-depth. I have tried to point to a range of resources, both those which are accessible and those which are challenging.
For the week, we have divided content into five parts. Included here (and below) is a brief introduction to the course. There are four additional sessions, which each have associated activities which explore more specific areas within the topic we are exploring here.
Now let's dive into the big issues together! We will explain more along the way as we go along together.
For the week, we have divided content into four challenges. Included here (and below) is a brief introduction to the course. There are four additional sessions, which each have associated activities.