{"id":258,"date":"2015-05-21T11:24:36","date_gmt":"2015-05-21T11:24:36","guid":{"rendered":"http:\/\/transnationalhistory.net\/mapping\/?page_id=258"},"modified":"2023-08-29T15:13:38","modified_gmt":"2023-08-29T15:13:38","slug":"advanced","status":"publish","type":"page","link":"https:\/\/transnationalhistory.net\/mapping\/tutorials\/performing-queries\/advanced\/","title":{"rendered":"One Step Further: Creating a New Layer out of a Query"},"content":{"rendered":"<p>Picture you are a specialist of Savoy and you only wish to keep the communes of the two\u00a0<em>d\u00e9partements<\/em> covering the former Duchy. You may consider creating a new layer which will only feature those towns. The file size would certainly be lighter.<\/p>\n<p><strong>STEP 1: SELECT FEATURES IN THE ATTRIBUTE TABLE<\/strong><\/p>\n<p><a href=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/05\/6-select-features.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-full wp-image-348\" src=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/05\/6-select-features.jpg\" alt=\"6 select features\" width=\"224\" height=\"59\" \/><\/a>Open your attribute table and choose the tool\u00a0<strong>Select features using an expression<\/strong>\u00a0You know that the two d\u00e9partements you wish to keep are called\u00a0<em>Savoie<\/em> and\u00a0<em>Haute-Savoie<\/em>. Perform a query as shown below.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-263\" src=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/05\/6-filter-savoie.jpg\" alt=\"6 filter savoie\" width=\"468\" height=\"383\" \/><\/p>\n<p>Savoy is highlighted on your map and in your attribute table, but the rest of the layer is still visible.<\/p>\n<p><a href=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/05\/6-savoie-highlighted.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-265\" src=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/05\/6-savoie-highlighted.jpg\" alt=\"6 savoie highlighted\" width=\"582\" height=\"516\" srcset=\"https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/05\/6-savoie-highlighted.jpg 582w, https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/05\/6-savoie-highlighted-300x266.jpg 300w\" sizes=\"auto, (max-width: 582px) 100vw, 582px\" \/><\/a><\/p>\n<p><strong>STEP 2: SAVE AS<\/strong><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignright size-full wp-image-266\" src=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/05\/6-save-layer-as.jpg\" alt=\"6 save layer as\" width=\"309\" height=\"251\" srcset=\"https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/05\/6-save-layer-as.jpg 309w, https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/05\/6-save-layer-as-300x244.jpg 300w\" sizes=\"auto, (max-width: 309px) 100vw, 309px\" \/><br \/>\nNow right click on the layer and choose\u00a0<strong>Save as<\/strong>. Keep the selected\u00a0CRS, simply choose a name for your new layer (I called it &#8216;savoy&#8217;) and tick the <strong>Save only selected features\u00a0<\/strong>box . Click\u00a0<strong>OK<\/strong>.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/05\/6-save-as.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-350\" src=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/05\/6-save-as.jpg\" alt=\"6 save as\" width=\"557\" height=\"207\" srcset=\"https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/05\/6-save-as.jpg 557w, https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/05\/6-save-as-300x111.jpg 300w\" sizes=\"auto, (max-width: 557px) 100vw, 557px\" \/><\/a><\/p>\n<p>You now have two layers: your original one and your newly created one.<\/p>\n<p><a href=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/05\/6-two-layers.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-351\" src=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/05\/6-two-layers.jpg\" alt=\"6 two layers\" width=\"113\" height=\"32\" \/><\/a><\/p>\n<p>Untick the original one (or even remove it by right clicking on it and selecting\u00a0<strong>Remove<\/strong>). You now have a layer with only the towns\u00a0your previously selected.<\/p>\n<p><a href=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/05\/6-final-savoy.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-269\" src=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/05\/6-final-savoy.jpg\" alt=\"6 final savoy\" width=\"473\" height=\"491\" srcset=\"https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/05\/6-final-savoy.jpg 473w, https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/05\/6-final-savoy-289x300.jpg 289w\" sizes=\"auto, (max-width: 473px) 100vw, 473px\" \/><\/a><\/p>\n<p>Last update: 2 June\u00a02015 on QGIS 2.8.1 Wien.<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/transnationalhistory.net\/mapping\/tutorials\/datavis-circles\/\">Back to Tutorial 6: Performing Queries<\/a>\u00a0| <a href=\"http:\/\/transnationalhistory.net\/mapping\/tutorials\/datavis-circles\/\">Next tutorial: Data Visualisation on your Map<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Picture you are a specialist of Savoy and you only wish to keep the communes of the two\u00a0d\u00e9partements covering the former Duchy. You may consider creating a new layer which will only feature those towns. The file size would certainly be lighter. STEP 1: SELECT FEATURES IN THE ATTRIBUTE TABLE Open your attribute table and [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":142,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-258","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/transnationalhistory.net\/mapping\/wp-json\/wp\/v2\/pages\/258","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=258"}],"version-history":[{"count":2,"href":"https:\/\/transnationalhistory.net\/mapping\/wp-json\/wp\/v2\/pages\/258\/revisions"}],"predecessor-version":[{"id":381,"href":"https:\/\/transnationalhistory.net\/mapping\/wp-json\/wp\/v2\/pages\/258\/revisions\/381"}],"up":[{"embeddable":true,"href":"https:\/\/transnationalhistory.net\/mapping\/wp-json\/wp\/v2\/pages\/142"}],"wp:attachment":[{"href":"https:\/\/transnationalhistory.net\/mapping\/wp-json\/wp\/v2\/media?parent=258"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}