<br />
<b>Warning</b>:  Undefined variable $num in <b>/home/shroutdo/public_html/courses/wp-content/plugins/single-categories/single_categories.php</b> on line <b>126</b><br />
<br />
<b>Warning</b>:  Undefined variable $posts_num in <b>/home/shroutdo/public_html/courses/wp-content/plugins/single-categories/single_categories.php</b> on line <b>127</b><br />
<br />
<b>Warning</b>:  Undefined variable $num in <b>/home/shroutdo/public_html/courses/wp-content/plugins/single-categories/single_categories.php</b> on line <b>126</b><br />
<br />
<b>Warning</b>:  Undefined variable $posts_num in <b>/home/shroutdo/public_html/courses/wp-content/plugins/single-categories/single_categories.php</b> on line <b>127</b><br />
<br />
<b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /home/shroutdo/public_html/courses/wp-content/plugins/single-categories/single_categories.php:126) in <b>/home/shroutdo/public_html/courses/wp-includes/rest-api/class-wp-rest-server.php</b> on line <b>1902</b><br />
<br />
<b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /home/shroutdo/public_html/courses/wp-content/plugins/single-categories/single_categories.php:126) in <b>/home/shroutdo/public_html/courses/wp-includes/rest-api/class-wp-rest-server.php</b> on line <b>1902</b><br />
{"id":396,"date":"2014-10-01T19:08:00","date_gmt":"2014-10-01T23:08:00","guid":{"rendered":"http:\/\/sites.davidson.edu\/dig360\/?p=396"},"modified":"2014-10-01T19:08:00","modified_gmt":"2014-10-01T23:08:00","slug":"qgis-data-tutorial","status":"publish","type":"post","link":"https:\/\/courses.shroutdocs.org\/dig360-fall2014\/2014\/10\/01\/qgis-data-tutorial\/","title":{"rendered":"QGIS data tutorial"},"content":{"rendered":"<p>For PA4 you&#8217;ll be overlaying data onto a georectified map.\u00a0 This tutorial shows you how to upload the vector shapefile for Davidson College, how to create your own vector shapefiles, and how to attach non-geographic data to those shapefiles.<\/p>\n<h5>Importing the Davidson shapefile<\/h5>\n<p>In the description for PA4, you&#8217;ll find a link to Davidson shapefiles.\u00a0 Download them all, and place them in a folder called Davidson.<\/p>\n<p>Open QGIS and add a vector layer:<\/p>\n<p><a href=\"http:\/\/dig360.shroutdocs.org\/wp-content\/uploads\/2014\/10\/Screen-Shot-2014-10-01-at-2.43.13-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-397\" src=\"http:\/\/dig360.shroutdocs.org\/wp-content\/uploads\/2014\/10\/Screen-Shot-2014-10-01-at-2.43.13-PM-300x219.png\" alt=\"Screen Shot 2014-10-01 at 2.43.13 PM\" width=\"300\" height=\"219\" srcset=\"https:\/\/courses.shroutdocs.org\/dig360-fall2014\/files\/2014\/10\/Screen-Shot-2014-10-01-at-2.43.13-PM-300x219.png 300w, https:\/\/courses.shroutdocs.org\/dig360-fall2014\/files\/2014\/10\/Screen-Shot-2014-10-01-at-2.43.13-PM.png 316w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Select Davidson_buildings.shp and also upload Davidson_roads.shp<\/p>\n<p>Once you&#8217;ve uploaded your shapefile, it should appear in the main area of QGIS.\u00a0 I&#8217;ve projected these shapefiles in WGS84, but check to make sure that the CRS is set properly.<\/p>\n<p>First, right-click on the Davidson shapefile.\u00a0 Scroll down to Set Layer CRS, and select WGS84.<\/p>\n<p><a href=\"http:\/\/dig360.shroutdocs.org\/wp-content\/uploads\/2014\/10\/Screen-Shot-2014-10-01-at-2.43.47-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-398\" src=\"http:\/\/dig360.shroutdocs.org\/wp-content\/uploads\/2014\/10\/Screen-Shot-2014-10-01-at-2.43.47-PM-300x253.png\" alt=\"Screen Shot 2014-10-01 at 2.43.47 PM\" width=\"300\" height=\"253\" \/><\/a><\/p>\n<p><a href=\"http:\/\/dig360.shroutdocs.org\/wp-content\/uploads\/2014\/10\/Screen-Shot-2014-10-01-at-2.44.06-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-399\" src=\"http:\/\/dig360.shroutdocs.org\/wp-content\/uploads\/2014\/10\/Screen-Shot-2014-10-01-at-2.44.06-PM-300x187.png\" alt=\"Screen Shot 2014-10-01 at 2.44.06 PM\" width=\"300\" height=\"187\" \/><\/a><\/p>\n<p>Your map might disappear, but fear not! You also have to set the project CRS to match the layer you just imported.\u00a0 Right-click on the layer again, and select\u00a0 &#8220;Set Project CRS from Layer&#8221;<\/p>\n<p><a href=\"http:\/\/dig360.shroutdocs.org\/wp-content\/uploads\/2014\/10\/Screen-Shot-2014-10-01-at-2.44.15-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-400\" src=\"http:\/\/dig360.shroutdocs.org\/wp-content\/uploads\/2014\/10\/Screen-Shot-2014-10-01-at-2.44.15-PM-300x284.png\" alt=\"Screen Shot 2014-10-01 at 2.44.15 PM\" width=\"300\" height=\"284\" srcset=\"https:\/\/courses.shroutdocs.org\/dig360-fall2014\/files\/2014\/10\/Screen-Shot-2014-10-01-at-2.44.15-PM-300x284.png 300w, https:\/\/courses.shroutdocs.org\/dig360-fall2014\/files\/2014\/10\/Screen-Shot-2014-10-01-at-2.44.15-PM.png 519w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>If you still don&#8217;t see your map, click the check-box next to your layer, go to View&gt;Zoom to Layer.\u00a0 Your map should appear.<\/p>\n<p><a href=\"http:\/\/dig360.shroutdocs.org\/wp-content\/uploads\/2014\/10\/Screen-Shot-2014-10-01-at-2.44.32-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-401\" src=\"http:\/\/dig360.shroutdocs.org\/wp-content\/uploads\/2014\/10\/Screen-Shot-2014-10-01-at-2.44.32-PM-290x300.png\" alt=\"Screen Shot 2014-10-01 at 2.44.32 PM\" width=\"290\" height=\"300\" srcset=\"https:\/\/courses.shroutdocs.org\/dig360-fall2014\/files\/2014\/10\/Screen-Shot-2014-10-01-at-2.44.32-PM-290x300.png 290w, https:\/\/courses.shroutdocs.org\/dig360-fall2014\/files\/2014\/10\/Screen-Shot-2014-10-01-at-2.44.32-PM.png 605w\" sizes=\"auto, (max-width: 290px) 100vw, 290px\" \/><\/a><\/p>\n<h5>Overlaying your map<\/h5>\n<p>Now that you have a base map, you can overlay your own map.\u00a0 If you need a refresher in georectifying in QGIS, go back to the QGIS tutorial from earlier in the semester.\u00a0 You can either input Longitude and Latitude coordinates or, if your map has features that are recognizable today, you can try to match them by hand, as we did with MapTiler.<\/p>\n<p>For instance, if since the Davidson shapefile has Chambers clearly marked, I could insert a reference point in the center of Chambers<a href=\"http:\/\/dig360.shroutdocs.org\/wp-content\/uploads\/2014\/10\/Screen-Shot-2014-10-01-at-3.19.05-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-406\" src=\"http:\/\/dig360.shroutdocs.org\/wp-content\/uploads\/2014\/10\/Screen-Shot-2014-10-01-at-3.19.05-PM-300x191.png\" alt=\"Screen Shot 2014-10-01 at 3.19.05 PM\" width=\"300\" height=\"191\" \/><\/a><\/p>\n<p>But instead of entering longitude and latitude points, I could click on &#8220;From map canvas&#8221; and estimate the same place in the middle of the Chambers on my base map.<\/p>\n<p><a href=\"http:\/\/dig360.shroutdocs.org\/wp-content\/uploads\/2014\/10\/Screen-Shot-2014-10-01-at-3.21.03-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-407\" src=\"http:\/\/dig360.shroutdocs.org\/wp-content\/uploads\/2014\/10\/Screen-Shot-2014-10-01-at-3.21.03-PM-300x218.png\" alt=\"Screen Shot 2014-10-01 at 3.21.03 PM\" width=\"300\" height=\"218\" srcset=\"https:\/\/courses.shroutdocs.org\/dig360-fall2014\/files\/2014\/10\/Screen-Shot-2014-10-01-at-3.21.03-PM-300x218.png 300w, https:\/\/courses.shroutdocs.org\/dig360-fall2014\/files\/2014\/10\/Screen-Shot-2014-10-01-at-3.21.03-PM.png 553w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Once you have georeferenced your map, it should automatically appear on the canvas, on top of the Davidson shapefile.\u00a0 If it doesn&#8217;t check to make sure that all of your maps are using the same CRS.<\/p>\n<p>When you&#8217;re finished, you can play with the transparency of your georectified map by double clicking and adjusting the transparency slider bar.\u00a0 When finished, you should have something like this:<\/p>\n<p><a href=\"http:\/\/dig360.shroutdocs.org\/wp-content\/uploads\/2014\/10\/Screen-Shot-2014-10-01-at-3.23.42-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-408\" src=\"http:\/\/dig360.shroutdocs.org\/wp-content\/uploads\/2014\/10\/Screen-Shot-2014-10-01-at-3.23.42-PM-300x187.png\" alt=\"Screen Shot 2014-10-01 at 3.23.42 PM\" width=\"300\" height=\"187\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h5>Adding Data<\/h5>\n<p>There are a few ways to overlay data on to your map: adding points, assigning information to shapefiles that someone else created, or assigning information to shapefiles you create.\u00a0 We&#8217;re going to walk through the first and last approaches here &#8211; for a refresher on the middle one go back to the choropleth map tutorial.<\/p>\n<h6>Adding Points<\/h6>\n<p>One way to get data on to your map is simply to upload a spreadsheet that contains some kind of non-geographic data paired with Lat\/Long data.<\/p>\n<p>You can use the dorm data linked in PA4, or create your own spreadsheet.\u00a0 Save as a comma separated file &#8211; the file type should be .csv<\/p>\n<p>(If you&#8217;re working on a mac, sometimes the .csv files don&#8217;t upload properly.\u00a0 To fix the problem, save your file as &#8220;Windows Comma Separated&#8221;)<\/p>\n<p><a href=\"http:\/\/dig360.shroutdocs.org\/wp-content\/uploads\/2014\/10\/Screen-Shot-2014-10-01-at-6.46.19-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-410\" src=\"http:\/\/dig360.shroutdocs.org\/wp-content\/uploads\/2014\/10\/Screen-Shot-2014-10-01-at-6.46.19-PM-300x187.png\" alt=\"Screen Shot 2014-10-01 at 6.46.19 PM\" width=\"300\" height=\"187\" \/><\/a><\/p>\n<p>In QGIS, go to Layer&gt;Add Delimited Text Layer and select your file.<\/p>\n<p><a href=\"http:\/\/dig360.shroutdocs.org\/wp-content\/uploads\/2014\/10\/Screen-Shot-2014-10-01-at-4.19.45-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-409\" src=\"http:\/\/dig360.shroutdocs.org\/wp-content\/uploads\/2014\/10\/Screen-Shot-2014-10-01-at-4.19.45-PM-300x168.png\" alt=\"Screen Shot 2014-10-01 at 4.19.45 PM\" width=\"300\" height=\"168\" \/><\/a><\/p>\n<p>Set X field to Longitude and Y field to Latitude.\u00a0 If you don&#8217;t see those options in the drop-down menu, make sure that &#8220;Number of header lines to discard&#8221; is set to 0.<\/p>\n<p>Click OK, and select the appropriate CRS.<\/p>\n<p>Congrats, you&#8217;ve now put data on the map!<\/p>\n<p>Double click on the layer name to play around with labels, colors, etc.<\/p>\n<h6>Adding polygons<\/h6>\n<p>But, say you wanted to do more than just put some points on a map.\u00a0 Say you wanted to represent the percentage of African-American students in each dorm.\u00a0 To do that, we need to create some shapes to fill with different colors.<\/p>\n<p>To do that, you need to create a new shapefile layer.<\/p>\n<p><a href=\"http:\/\/dig360.shroutdocs.org\/wp-content\/uploads\/2014\/10\/Screen-Shot-2014-10-01-at-2.46.07-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-403\" src=\"http:\/\/dig360.shroutdocs.org\/wp-content\/uploads\/2014\/10\/Screen-Shot-2014-10-01-at-2.46.07-PM-300x144.png\" alt=\"Screen Shot 2014-10-01 at 2.46.07 PM\" width=\"300\" height=\"144\" \/><\/a><\/p>\n<p>This is going to be a layer composed of polygons, so select polygon, make sure the CRS is set to WGS 84 and add whatever attributes you think are important.\u00a0 In this case, you could either hand enter all of the data from the Dorm Data document, or create a linking category, that allows us to merge the dorm data table with our shapefile.\u00a0 Let&#8217;s create a category called BLDGNUM and add it to the attributes list.<\/p>\n<p><a href=\"http:\/\/dig360.shroutdocs.org\/wp-content\/uploads\/2014\/10\/Screen-Shot-2014-10-01-at-7.00.26-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-411\" src=\"http:\/\/dig360.shroutdocs.org\/wp-content\/uploads\/2014\/10\/Screen-Shot-2014-10-01-at-7.00.26-PM-300x187.png\" alt=\"Screen Shot 2014-10-01 at 7.00.26 PM\" width=\"300\" height=\"187\" \/><\/a><\/p>\n<p>Create a folder and name the shapefile something like dormdata.<\/p>\n<p>Now we can start making some polygons.<\/p>\n<p>Highlight the layer we&#8217;re going to be making.\u00a0 Then right-click and toggle editing.<\/p>\n<p>Now click on the add feature tool.<\/p>\n<p><a href=\"http:\/\/dig360.shroutdocs.org\/wp-content\/uploads\/2014\/10\/Screen-Shot-2014-10-01-at-7.03.11-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-412\" src=\"http:\/\/dig360.shroutdocs.org\/wp-content\/uploads\/2014\/10\/Screen-Shot-2014-10-01-at-7.03.11-PM.png\" alt=\"Screen Shot 2014-10-01 at 7.03.11 PM\" width=\"125\" height=\"71\" \/><\/a><\/p>\n<p>Use this tool to define the corners of a shape.\u00a0 So, for a dorm, click on all of the corners until the red area covers the shape you want.\u00a0 Then move the cursor inside the red area and right-click.<\/p>\n<p>You&#8217;ll be asked to enter information.\u00a0 This is where we need to make sure that each building has the right code associated with it.\u00a0 So we would open the dormdata .csv file, and when we traced Belk, for instance, we&#8217;d make sure that the BLDGNUM is 4.\u00a0 Same for the others.\u00a0 When you are finished making these shapes, toggle editing off.<\/p>\n<p><a href=\"http:\/\/dig360.shroutdocs.org\/wp-content\/uploads\/2014\/10\/Screen-Shot-2014-10-01-at-7.06.44-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-413\" src=\"http:\/\/dig360.shroutdocs.org\/wp-content\/uploads\/2014\/10\/Screen-Shot-2014-10-01-at-7.06.44-PM-300x187.png\" alt=\"Screen Shot 2014-10-01 at 7.06.44 PM\" width=\"300\" height=\"187\" \/><\/a><\/p>\n<p>Once you&#8217;ve created all of the shapefiles for all of the dorms, you can merge data like we did with the U.S. unemployment data.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For PA4 you&#8217;ll be overlaying data onto a georectified map.\u00a0 This tutorial shows you how to upload the vector shapefile for Davidson College, how to create your own vector shapefiles, and how to attach non-geographic data to those shapefiles. Importing the Davidson shapefile In the description for PA4, you&#8217;ll find a link to Davidson shapefiles.\u00a0 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/courses.shroutdocs.org\/dig360-fall2014\/2014\/10\/01\/qgis-data-tutorial\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;QGIS data tutorial&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[147,1],"tags":[],"class_list":["post-396","post","type-post","status-publish","format-standard","hentry","category-admin","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/courses.shroutdocs.org\/dig360-fall2014\/wp-json\/wp\/v2\/posts\/396","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/courses.shroutdocs.org\/dig360-fall2014\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.shroutdocs.org\/dig360-fall2014\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.shroutdocs.org\/dig360-fall2014\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.shroutdocs.org\/dig360-fall2014\/wp-json\/wp\/v2\/comments?post=396"}],"version-history":[{"count":0,"href":"https:\/\/courses.shroutdocs.org\/dig360-fall2014\/wp-json\/wp\/v2\/posts\/396\/revisions"}],"wp:attachment":[{"href":"https:\/\/courses.shroutdocs.org\/dig360-fall2014\/wp-json\/wp\/v2\/media?parent=396"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.shroutdocs.org\/dig360-fall2014\/wp-json\/wp\/v2\/categories?post=396"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.shroutdocs.org\/dig360-fall2014\/wp-json\/wp\/v2\/tags?post=396"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}