{"id":70,"date":"2015-04-18T19:09:19","date_gmt":"2015-04-18T19:09:19","guid":{"rendered":"http:\/\/transnationalhistory.net\/mapping\/?page_id=70"},"modified":"2023-08-29T15:13:38","modified_gmt":"2023-08-29T15:13:38","slug":"shapefiles","status":"publish","type":"page","link":"https:\/\/transnationalhistory.net\/mapping\/tutorials\/shapefiles\/","title":{"rendered":"Finding, Importing, and Editing Shapefiles"},"content":{"rendered":"<p style=\"text-align: right;\"><em><strong>Tutorial 3<\/strong><\/em><\/p>\n<p>&nbsp;<\/p>\n<p>In this tutorial, we are interested in getting more layers and data for our maps. There are thousands of files available online, that amateurs, experts, academics and GIS specialists have come up with.<\/p>\n<p><strong>STEP 1: FINDING SHAPEFILES<\/strong><\/p>\n<p>As you probably remember from <a title=\"Finding and Adding a Base Layer\" href=\"http:\/\/transnationalhistory.net\/mapping\/tutorials\/baselayer\/\">the first tutorial<\/a>, there are handfuls of websites with many base layers available: <a href=\"http:\/\/naturalearthdata.com\/\" target=\"_blank\" rel=\"noopener\">Natural Earth Data<\/a>, <a href=\"https:\/\/www.nhgis.org\/\" target=\"_blank\" rel=\"noopener\">NHGIS<\/a> (for US data), <a href=\"http:\/\/www.visionofbritain.org.uk\/index.jsp\" target=\"_blank\" rel=\"noopener\">Vision of Britain<\/a> (for UK data), <a href=\"http:\/\/www.fas.harvard.edu\/~chgis\/\" target=\"_blank\" rel=\"noopener\">China Historical GIS<\/a> (for Chinese historical data), etc.<\/p>\n<p><a href=\"http:\/\/worldmap.harvard.edu\/\" target=\"_blank\" rel=\"noopener\">Harvard Worlmap<\/a> has a lot to offer. It allows you to access an impressive amount of data projected onto Google Maps, you can play with layers by ticking and unticking boxes. In certain cases, you can download shapefiles by clicking on the\u00a0<strong>Share<\/strong> option of each page.<\/p>\n<p>Countries usually have their own official geographic source, such as\u00a0<a href=\"http:\/\/www.usgs.gov\/\" target=\"_blank\" rel=\"noopener\">USGS<\/a>\u00a0for the United States. However, there may be different official sources offering the same data under different formats (in the case of Scotland: the <a href=\"http:\/\/crtb.sedsh.gov.uk\/spatialDataDownload\/licenc.asp\" target=\"_blank\" rel=\"noopener\">Scottish Government Spatial Data<\/a>,\u00a0<a href=\"http:\/\/www.data.gov.uk\" target=\"_blank\" rel=\"noopener\">data.gov.uk<\/a>, <a href=\"http:\/\/data.historic-scotland.gov.uk\/pls\/htmldb\/f?p=2100:10:0::::CURRENT_GIS:about\" target=\"_blank\" rel=\"noopener\">Historic Scotland<\/a>): you should\u00a0double-check their accuracy, in case one of them offers more details than the other one.<\/p>\n<p>However you might also want to look for more specialised\u00a0data elsewhere. Google can actually help you find them. You can of course try out different terms in order to find what you are looking for, but you can also use an option that will only show a certain type of document. If you are looking for a shapefile, you should type at the end of your query\u00a0<strong>filetype:shp<\/strong>. This works for any file format (<strong>filetype:csv<\/strong>,\u00a0<strong>filetype:doc<\/strong>,\u00a0<strong>filetype:xls<\/strong>, etc.).<\/p>\n<p>For instance, if you are looking for shapefiles depicting lakes, you may type into Google:<\/p>\n<p style=\"text-align: center;\"><b>lakes filetype:shp<\/b><\/p>\n<p>Only documents named .shp will appear. This technique may be very useful but you will have to look for the right terms as there will be much fewer results!<\/p>\n<p><strong>STEP 2: IMPORTING SHAPEFILES<\/strong><\/p>\n<p>We are going to use the example of the city of Boston via a shapefile <a href=\"http:\/\/boston.maps.arcgis.com\/home\/item.html?id=c423eda7a64b49c98a9ebdf5a6b7e135\" target=\"_blank\" rel=\"noopener\">downloaded from this website<\/a>. To add the shapefile, click on <strong>Add Vector Layer<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-33 aligncenter\" src=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-Add-Vector-Layer.jpg\" alt=\"2 Add Vector Layer\" width=\"140\" height=\"37\" \/><\/p>\n<p><strong>STEP 3: MODIFYING SHAPEFILES<\/strong><\/p>\n<p>Let&#8217;s pretend that there used to be a small house at the entrance of Boston Common. This example is purely experimental.<\/p>\n<p><a href=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/3-toggle-editing.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-full wp-image-92\" src=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/3-toggle-editing.jpg\" alt=\"\" width=\"113\" height=\"70\" \/><\/a>To start editing the shapefile you need to make sure the right layer is selected, then click on &#8220;Toggle Editing&#8221;. The aspect of your layer will slightly change: now each angle is selectable and editable. By zooming in onto\u00a0the North-West corner of Boston Common you will see the angle of each building.<\/p>\n<p><a href=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/3-node-mode-borders1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-289 size-full\" src=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/3-node-mode-borders1.jpg\" alt=\"\" width=\"615\" height=\"439\" srcset=\"https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/3-node-mode-borders1.jpg 615w, https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/3-node-mode-borders1-300x214.jpg 300w\" sizes=\"auto, (max-width: 615px) 100vw, 615px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/3-node-tool.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-full wp-image-94\" src=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/3-node-tool.jpg\" alt=\"\" width=\"357\" height=\"44\" srcset=\"https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/3-node-tool.jpg 357w, https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/3-node-tool-300x37.jpg 300w\" sizes=\"auto, (max-width: 357px) 100vw, 357px\" \/><\/a><\/p>\n<p>The toolbar along the Toggle Editing button allows you to edit your shapefile in certain ways, by adding new features, moving the angles, or deleting your selection. I want to extend one of the buildings, so I am opting for the Node tool option.<\/p>\n<p>With this option, I am bringing each angle closer to the one that is depicted in the Constituency layer, so both can coincide. Each black arrow here shows what movement I need to make.<\/p>\n<p><a href=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/3-edit-boston-building.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-290\" src=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/3-edit-boston-building.jpg\" alt=\"3 edit boston building\" width=\"737\" height=\"489\" srcset=\"https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/3-edit-boston-building.jpg 737w, https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/3-edit-boston-building-300x199.jpg 300w\" sizes=\"auto, (max-width: 737px) 100vw, 737px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/3-add-feature.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-full wp-image-292\" src=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/3-add-feature.jpg\" alt=\"3 add feature\" width=\"262\" height=\"75\" \/><\/a>In addition to this building extension, we would like to add another building that used to stand along the entrance of the park. I am clicking on\u00a0the <strong>Add feature<\/strong>\u00a0button in the toolbar then drawing it with my mouse.<\/p>\n<p><a href=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/3-new-building.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-291\" src=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/3-new-building.jpg\" alt=\"3 new building\" width=\"550\" height=\"357\" srcset=\"https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/3-new-building.jpg 550w, https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/3-new-building-300x195.jpg 300w\" sizes=\"auto, (max-width: 550px) 100vw, 550px\" \/><\/a><\/p>\n<p>Right click when done. Other functions will allow you to separate buildings (<strong>Cut<\/strong>) or to move them completely\u00a0on your map (<strong>Move<\/strong>).<\/p>\n<p><strong>Note: there may be very few situations in which you might want to do this. Indeed, you would need to know the exact location of this old house. If said house is an old map, you shall be able to follow the old map&#8217;s lines by georeferencing it. This is something you will learn to do <a href=\"http:\/\/transnationalhistory.net\/mapping\/tutorials\/georeferencing\/\">in the next tutorial<\/a>.<\/strong><\/p>\n<p><strong>STEP 4: SAVING YOUR SHAPEFILE<\/strong><\/p>\n<p>Once you are done editing, click on the Toggle Editing button again, a message will ask you if you wish to save your shapefile. You must click on\u00a0<strong>Save<\/strong>, otherwise the map will go straight back to the original layer.<\/p>\n<p><a href=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/3-save-layer-as.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-full wp-image-97\" src=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/3-save-layer-as.jpg\" alt=\"\" width=\"256\" height=\"250\" \/><\/a><\/p>\n<p>The process is a bit different if you wish to have both the original shapefile and the new one you came up with. To do so, click on <b>Layer<\/b> then\u00a0<strong>Save as<\/strong>. The screen that will open will allow you to choose a new name. The\u00a0<strong>Format<\/strong> and\u00a0<strong>CRS,<\/strong>\u00a0which we will see in another tutorial very soon, should be already preselected and you shouldn&#8217;t need to change these options. If you want to the new layer to appear on your map straight after saving it, make sure the <strong>Add saved file to map<\/strong> box is ticked.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><strong><a href=\"http:\/\/transnationalhistory.net\/mapping\/tutorials\/shapefiles\/advanced\/\">One step further: merging layers with the Union feature<\/a><\/strong><\/p>\n<p>Last update:\u00a026 May 2015 on QGIS 2.8.1 Wien.<\/p>\n<p style=\"text-align: right;\"><a title=\"Georeferencing Maps\" href=\"http:\/\/transnationalhistory.net\/mapping\/tutorials\/georeferencing\/\">Next tutorial:<\/a><br \/>\n<a title=\"Georeferencing Maps\" href=\"http:\/\/transnationalhistory.net\/mapping\/tutorials\/georeferencing\/\"> <strong>Georeferencing Maps<\/strong><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tutorial 3 &nbsp; In this tutorial, we are interested in getting more layers and data for our maps. There are thousands of files available online, that amateurs, experts, academics and GIS specialists have come up with. STEP 1: FINDING SHAPEFILES As you probably remember from the first tutorial, there are handfuls of websites with many [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":8,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-70","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/transnationalhistory.net\/mapping\/wp-json\/wp\/v2\/pages\/70","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/transnationalhistory.net\/mapping\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/transnationalhistory.net\/mapping\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/transnationalhistory.net\/mapping\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/transnationalhistory.net\/mapping\/wp-json\/wp\/v2\/comments?post=70"}],"version-history":[{"count":2,"href":"https:\/\/transnationalhistory.net\/mapping\/wp-json\/wp\/v2\/pages\/70\/revisions"}],"predecessor-version":[{"id":593,"href":"https:\/\/transnationalhistory.net\/mapping\/wp-json\/wp\/v2\/pages\/70\/revisions\/593"}],"up":[{"embeddable":true,"href":"https:\/\/transnationalhistory.net\/mapping\/wp-json\/wp\/v2\/pages\/8"}],"wp:attachment":[{"href":"https:\/\/transnationalhistory.net\/mapping\/wp-json\/wp\/v2\/media?parent=70"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}