-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmapping-homelessness-in-san-diego.html
80 lines (69 loc) · 17.6 KB
/
mapping-homelessness-in-san-diego.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<!DOCTYPE html>
<html><head>
<title>Mapping Homelessness in San Diego</title>
<base href="./">
<meta id="root-path" root-path="./">
<link rel="icon" sizes="96x96" href="https://publish-01.obsidian.md/access/f786db9fac45774fa4f0d8112e232d67/favicon-96x96.png">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes, minimum-scale=1.0, maximum-scale=5.0">
<meta charset="UTF-8">
<script src="https://code.iconify.design/iconify-icon/1.0.3/iconify-icon.min.js"></script>
<link rel="stylesheet" href="lib/styles/obsidian-styles.css">
<link rel="stylesheet" href="lib/styles/theme.css">
<link rel="stylesheet" href="lib/styles/plugin-styles.css">
<link rel="stylesheet" href="lib/styles/snippets.css">
<style> </style>
<!-- Graph View Data -->
<script>
let nodes=
{"nodeCount":30,"linkCount":29,"radii":[7,7,6.954081632653061,6.954081632653061,6.954081632653061,6.673469387755102,6.673469387755102,6.137755102040817,6.137755102040817,6.137755102040817,5.346938775510203,5.346938775510203,5.346938775510203,4.301020408163265,4.301020408163265,4.301020408163265,4.301020408163265,4.301020408163265,3,3,3,3,3,3,3,3,3,3,3,3],"labels":["Day 1","Datasets","Syllabus","Day 5","Day 2","Mapping Homelessness in San Diego","Day 3","San Diego Regional Data Library data example","National Survey of Child Health","Day 4","Fatal police shootings","Example 1","Add Health","Add-on Packages & Modules","Final web scrap medium","Consumer Complaints","Housing and Transportation Affordability Index","Household Pulse Survey Data Tables","Highlighting structure","Cheat Sheet","Lit Reviews","Research Reminders","Note taking","Daily Note","Example Template","Research Notes","focus_group","Research Paper","Research Ideas","research notes"],"paths":["day-1.html","datasets.html","syllabus.html","day-5.html","day-2.html","mapping-homelessness-in-san-diego.html","day-3.html","san-diego-regional-data-library-data-example.html","national-survey-of-child-health.html","day-4.html","fatal-police-shootings.html","example-1.html","add-health.html","add-on-packages-&-modules.html","final-web-scrap-medium.html","consumer-complaints.html","housing-and-transportation-affordability-index.html","household-pulse-survey-data-tables.html","00-meta/001-structure/highlighting-structure.html","00-meta/001-structure/cheat-sheet.html","00-meta/003-tools/lit-reviews.html","00-meta/003-tools/research-reminders.html","00-meta/003-tools/note-taking.html","00-meta/002-templates/daily-note.html","00-meta/002-templates/example-template.html","00-meta/002-templates/research-notes.html","00-meta/002-templates/meta/zdc-templates/focus_group.html","00-meta/002-templates/meta/zdc-templates/research-paper.html","00-meta/002-templates/meta/zdc-templates/research-ideas.html","00-meta/002-templates/meta/zdc-templates/research-notes.html"],"linkSources":[1,1,1,1,1,1,1,0,0,0,0,4,4,6,6,9,3,3,3,3,2,2,2,2,2,7,5,5,5],"linkTargets":[12,15,10,16,8,17,7,13,14,11,1,11,8,8,10,5,12,0,4,6,0,4,6,9,3,9,7,4,0]};
let attractionForce = 1;
let linkLength = 10;
let repulsionForce = 150;
let centralForce = 3;
let edgePruning = 100;
</script>
<script type="module" src="lib/scripts/graph_view.js"></script>
<script src="lib/scripts/graph_wasm.js"></script>
<script src="lib/scripts/tinycolor.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pixi.js/7.2.4/pixi.min.js" integrity="sha512-Ch/O6kL8BqUwAfCF7Ie5SX1Hin+BJgYH4pNjRqXdTEqMsis1TUYg+j6nnI9uduPjGaj7DN4UKCZgpvoExt6dkw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="lib/scripts/webpage.js"></script>
</head><body class="theme-dark mod-windows is-frameless is-hidden-frameless obsidian-app show-inline-title show-view-header outliner-plugin-better-lists outliner-plugin-dnd" style="--zoom-factor:1.2; --font-text-size:16px; --line-width:50em; --line-width-adaptive:50em; --file-line-width:50em; --content-width:500em; --sidebar-width:25em; --collapse-arrow-size:0.4em; --tree-horizontal-spacing:1em; --tree-vertical-spacing:0.5em; --sidebar-margin:12px;"><div class="webpage-container"><div class="sidebar-left sidebar"><div class="sidebar-content"><div><label class="theme-toggle-container" for="theme_toggle"><input class="theme-toggle-input" type="checkbox" id="theme_toggle"><div class="toggle-background"></div></label></div><div class="tree-container file-tree mod-nav-indicator" data-depth="0"><div class="tree-header"><span class="sidebar-section-header">Bootcamp</span><button class="clickable-icon collapse-tree-button is-collapsed"><iconify-icon icon="ph:arrows-in-line-horizontal-bold" width="18px" height="18px" rotate="90deg" color="currentColor"></iconify-icon></button></div><div class="tree-scroll-area"></div></div></div></div><div class="document-container"><div class="markdown-preview-view markdown-rendered node-insert-event allow-fold-headings show-indentation-guide allow-fold-lists" tabindex="-1" style="tab-size: 4;"><style id="MJX-CHTML-styles"></style><div class="markdown-preview-sizer markdown-preview-section" style="padding-bottom: ; padding-top: var(--file-margins); padding-right: var(--file-margins); padding-left: var(--file-margins); width: 100%; position: absolute;"><div class="markdown-preview-pusher" style="width: 1px; height: 0.1px; margin-bottom: 0px;"></div><div class="mod-header"><div class="inline-title" contenteditable="true" spellcheck="true" autocapitalize="on" tabindex="-1" enterkeyhint="done">Mapping Homelessness in San Diego</div></div><div><h3 data-heading="Mapping homelessness in San Diego" id="Mapping_homelessness_in_San_Diego" style="display: flex;"><div class="heading-collapse-indicator collapse-indicator collapse-icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon right-triangle"><path d="M3 8L12 17L21 8"></path></svg></div>Mapping homelessness in San Diego</h3></div><div><ul class="has-list-bullet">
<li data-line="0"><div class="list-bullet"></div>Recall Day 1 we downloaded the data for homelessness in San Diego. Now we can map it.</li>
<li data-line="1"><div class="list-bullet"></div>We are going to merge the count of homeless persons by block group that we created for Day 1. See <a data-href="San Diego Regional Data Library data example" href="san-diego-regional-data-library-data-example.html" class="internal-link" target="_self" rel="noopener">San Diego Regional Data Library data example</a> to refresh your memory on how we did this.</li>
<li data-line="2"><div class="list-bullet"></div>Download the shapefile for <strong>San Diego <em>blocks</em></strong> for the year 2010 (why 2010 versus 2020?). You can download that at <a data-tooltip-position="top" aria-label="https://www.census.gov/geographies/mapping-files/time-series/geo/tiger-line-file.html" rel="noopener" class="external-link" href="https://www.census.gov/geographies/mapping-files/time-series/geo/tiger-line-file.html" target="_blank">TIGER/Line Shapefiles (census.gov)</a> Unzip the files to your hard drive. You will see multiple files in the folder you just unzipped. We will review them now.</li>
<li data-line="3"><div class="list-bullet"></div>Open QGIS. From the file menu select Layer --> Add Layer --> add Vector Layer as shown below.<br>
<span alt="Pasted image 20230805125124.png" src="Pasted image 20230805125124.png" class="internal-embed media-embed image-embed is-loaded"><img alt="Pasted image 20230805125124.png" src="pasted-image-20230805125124.png"></span></li>
<li data-line="5"><div class="list-bullet"></div>Browse to the folder you just downloaded and select tl_2010_06073_tabblock10.shp. You can also open the file from the folder ex/homeless data that has been provided to you</li>
<li data-line="6"><div class="list-bullet"></div>You should see <em>something</em> that looks like the image below. The shape of the map is San Diego county and the boundaries contained therein represent census blocks in the county.<br>
<span alt="Pasted image 20230805133517.png" src="Pasted image 20230805133517.png" class="internal-embed media-embed image-embed is-loaded"><img alt="Pasted image 20230805133517.png" src="pasted-image-20230805133517.png"></span></li>
<li data-line="8"><div class="list-bullet"></div>Recall in <a data-href="Day 2" href="day-2.html" class="internal-link" target="_self" rel="noopener">Day 2</a> we learned that in order to merge files there needs to be a unique key. We also learned during <a data-href="Day 1" href="day-1.html" class="internal-link" target="_self" rel="noopener">Day 1</a> that Excel formulas are handy for data wrangling. We need to create a one-to-one correspondence between our census block groups and our homeless counts. </li>
<li data-line="9"><div class="list-bullet"></div>Take a look at the two datasets. It is clear that the field linking the two is geoid. Unfortunately, we need to remove the first 7 characters from our data file before the merge will be successful. See <a data-tooltip-position="top" aria-label="https://www.census.gov/programs-surveys/geography/guidance/geo-identifiers.html" rel="noopener" class="external-link" href="https://www.census.gov/programs-surveys/geography/guidance/geo-identifiers.html" target="_blank">Understanding Geographic Identifiers (GEOIDs) (census.gov)</a> for an in-depth explanation of the geographic identifiers contained in Census data.</li>
<li data-line="10"><div class="list-bullet"></div>We will create a new variable called GEOID10 (why?) that has the unique census block ID for each census block in the downtown area</li>
</ul></div><div><h4 data-heading="❓ Your turn" id="❓_Your_turn" style="display: flex;"><div class="heading-collapse-indicator collapse-indicator collapse-icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon right-triangle"><path d="M3 8L12 17L21 8"></path></svg></div>❓ Your turn</h4></div><div><ul class="contains-task-list has-list-bullet">
<li class="task-list-item plugin-tasks-list-item" data-task-priority="normal" data-task="" data-line="0" data-task-status-name="Todo" data-task-status-type="TODO"><div class="list-bullet"></div><input class="task-list-item-checkbox" type="checkbox" data-line="0"><span class="tasks-list-text"><span class="task-description"><span>Open the file count_by_blk.xlsx</span></span></span></li>
<li class="task-list-item plugin-tasks-list-item" data-task-priority="normal" data-task="" data-line="1" data-task-status-name="Todo" data-task-status-type="TODO"><div class="list-bullet"></div><input class="task-list-item-checkbox" type="checkbox" data-line="1"><span class="tasks-list-text"><span class="task-description"><span>Click on the tab GEOID10</span></span></span></li>
<li class="task-list-item plugin-tasks-list-item" data-task-priority="normal" data-task="" data-line="2" data-task-status-name="Todo" data-task-status-type="TODO"><div class="list-bullet"></div><input class="task-list-item-checkbox" type="checkbox" data-line="2"><span class="tasks-list-text"><span class="task-description"><span>Column C has the following formula <mark>>=right(A2, 15)<</mark></span></span></span></li>
<li class="task-list-item plugin-tasks-list-item" data-task-priority="normal" data-task="" data-line="3" data-task-status-name="Todo" data-task-status-type="TODO"><div class="list-bullet"></div><input class="task-list-item-checkbox" type="checkbox" data-line="3"><span class="tasks-list-text"><span class="task-description"><span>Compare this column with the GEOID10 column in the shapefile you have open in QGIS. They now match.</span></span></span></li>
<li class="task-list-item plugin-tasks-list-item" data-task-priority="normal" data-task="" data-line="4" data-task-status-name="Todo" data-task-status-type="TODO"><div class="list-bullet"></div><input class="task-list-item-checkbox" type="checkbox" data-line="4"><span class="tasks-list-text"><span class="task-description"><span>I created a separate file called GEOID10_counts_to_merge.csv.</span></span></span></li>
<li class="task-list-item plugin-tasks-list-item" data-task-priority="normal" data-task="" data-line="5" data-task-status-name="Todo" data-task-status-type="TODO"><div class="list-bullet"></div><input class="task-list-item-checkbox" type="checkbox" data-line="5"><span class="tasks-list-text"><span class="task-description"><span>Open this file in QGIS (Layer --> Add Layer --> Add delimited). Make sure you choose 'Text (string)' for the GEOID column as I show in the figure below and that 'No geometry (attribute only table)' is selected or this will FAIL.</span></span></span></li>
<li class="task-list-item plugin-tasks-list-item" data-task-priority="normal" data-task="" data-line="6" data-task-status-name="Todo" data-task-status-type="TODO"><div class="list-bullet"></div><input class="task-list-item-checkbox" type="checkbox" data-line="6"><span class="tasks-list-text"><span class="task-description"><span>Let's merge the two files and make the map shown on the webpage.</span></span></span></li>
</ul></div><div><hr></div><div><p><span alt="Pasted image 20230805131229.png" src="Pasted image 20230805131229.png" class="internal-embed media-embed image-embed is-loaded"><img alt="Pasted image 20230805131229.png" src="pasted-image-20230805131229.png"></span></p></div><div><ul class="has-list-bullet">
<li data-line="0"><div class="list-bullet"></div>Now the data are merged and can be mapped!<br>
<span alt="Pasted image 20230805132350.png" src="Pasted image 20230805132350.png" class="internal-embed media-embed image-embed is-loaded"><img alt="Pasted image 20230805132350.png" src="pasted-image-20230805132350.png"></span></li>
<li data-line="2"><div class="list-bullet"></div>Compare the map below to the one on the website. They look identical!<br>
<span width="400" alt="Pasted image 20230805133038.png" src="Pasted image 20230805133038.png" class="internal-embed media-embed image-embed is-loaded"><img alt="Pasted image 20230805133038.png" width="400" src="pasted-image-20230805133038.png"></span></li>
</ul></div><div><h4 data-heading="Even Better" id="Even_Better" style="display: flex;"><div class="heading-collapse-indicator collapse-indicator collapse-icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon right-triangle"><path d="M3 8L12 17L21 8"></path></svg></div>Even Better</h4></div><div><ul class="has-list-bullet">
<li data-line="0"><div class="list-bullet"></div>Let's incorporate more data into the map</li>
<li data-line="1"><div class="list-bullet"></div>Download the landmark dataset</li>
<li data-line="2"><div class="list-bullet"></div>Clip the landmark dataset to the downtown area</li>
<li data-line="3"><div class="list-bullet"></div>Add OpenStreetMap data</li>
<li data-line="4"><div class="list-bullet"></div>Make a heatmap<br>
<span alt="Pasted image 20230805170558.png" src="Pasted image 20230805170558.png" class="internal-embed media-embed image-embed is-loaded"><img alt="Pasted image 20230805170558.png" src="pasted-image-20230805170558.png"></span></li>
<li data-line="6"><div class="list-bullet"></div>Make some observations<br>
<span width="850" alt="Pasted image 20230805171345.png" src="Pasted image 20230805171345.png" class="internal-embed media-embed image-embed is-loaded"><img alt="Pasted image 20230805171345.png" width="850" src="pasted-image-20230805171345.png"></span></li>
</ul></div><div class="mod-footer"><div class="embedded-backlinks" style="display: none;"></div></div></div></div></div><div class="sidebar-right sidebar"><div class="sidebar-content"><span class="sidebar-section-header">Interactive Graph</span><div class="graph-view-placeholder">
<div class="graph-view-container">
<div class="graph-icon graph-expand" role="button" aria-label="Expand" data-tooltip-position="top"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon lucide-arrow-up-right"><line x1="7" y1="17" x2="17" y2="7"></line><polyline points="7 7 17 7 17 17"></polyline></svg></div>
<canvas id="graph-canvas" width="512px" height="512px"></canvas>
</div>
</div><div class="tree-container outline-tree" data-depth="0"><div class="tree-header"><span class="sidebar-section-header">Table Of Contents</span><button class="clickable-icon collapse-tree-button"><iconify-icon icon="ph:arrows-in-line-horizontal-bold" width="18px" height="18px" rotate="90deg" color="currentColor"></iconify-icon></button></div><div class="tree-scroll-area"><div class="tree-item mod-tree-heading" data-depth="1"><div class="tree-item-contents"><a class="tree-item-link" href="#Mapping_Homelessness_in_San_Diego"><span class="tree-item-title">Mapping Homelessness in San Diego</span></a></div><div class="tree-item-children"><div class="tree-item mod-tree-heading" data-depth="3"><div class="tree-item-contents"><a class="tree-item-link" href="#Mapping_homelessness_in_San_Diego"><span class="tree-item-title">Mapping homelessness in San Diego</span></a></div><div class="tree-item-children"></div></div><div class="tree-item mod-tree-heading" data-depth="4"><div class="tree-item-contents"><a class="tree-item-link" href="#❓_Your_turn"><span class="tree-item-title">❓ Your turn</span></a></div><div class="tree-item-children"></div></div><div class="tree-item mod-tree-heading" data-depth="4"><div class="tree-item-contents"><a class="tree-item-link" href="#Even_Better"><span class="tree-item-title">Even Better</span></a></div><div class="tree-item-children"></div></div></div></div></div></div></div></div></div></body></html>