{"id":178,"date":"2013-04-29T23:19:09","date_gmt":"2013-04-29T23:19:09","guid":{"rendered":"http:\/\/www.lincoln.ac.nz\/conversation\/gis\/?p=178"},"modified":"2023-05-07T00:22:42","modified_gmt":"2023-05-07T00:22:42","slug":"how-do-i-clip-data","status":"publish","type":"post","link":"https:\/\/blogs.lincoln.ac.nz\/gis\/how-do-i-clip-data\/","title":{"rendered":"How do I Clip Data?"},"content":{"rendered":"<p><em>This post covers a very useful skill &#8211; clipping subsets of <strong>vector <\/strong>data from larger datasets (<a title=\"How do I clip raster data?\" href=\"http:\/\/blogs.lincoln.ac.nz\/gis\/how-do-i-clip-raster-data\/\" target=\"_blank\" rel=\"noopener noreferrer\">clipping raster data<\/a> is covered in another post &#8211; Updated May 2021 for Pro). <\/em><\/p>\n<p>As seen is some earlier posts, most of the\u00a0<a title=\"Data, data everywhere, but what about what I need?\" href=\"http:\/\/blogs.lincoln.ac.nz\/gis\/data-data-everywhere-but-what-about-what-i-need\/\" target=\"_blank\" rel=\"noopener noreferrer\">data on the J: drive<\/a> is at a national scale. \u00a0In many cases, though, you&#8217;ll be working at a much larger scale (and by that I mean a smaller area in the Cartography sense of scale). \u00a0The <a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/tool-reference\/analysis\/clip.htm\" target=\"_blank\" rel=\"noopener noreferrer\">Clip tool<\/a> is what we&#8217;ll use to do this. \u00a0Like a cookie cutter, the Clip tool uses the boundary of the polygon to clip out the data inside the polygon; this can be done on points, lines or polygons, but we must have a polygon layer that defines the area we&#8217;re clipping.<\/p>\n<p>Sometimes you&#8217;ve already got a polygon layer that you can use &#8211; that&#8217;s what we&#8217;ll talk about here. \u00a0Other times, you need to create a new polygon layer &#8211; <a href=\"http:\/\/blogs.lincoln.ac.nz\/gis\/how-do-i-create-a-new-feature-classshapefile\/\" target=\"_blank\" rel=\"noopener noreferrer\">this post covers<\/a> how to create a new feature class or shapefile.<\/p>\n<p>Now onto clipping. \u00a0If, for example, we wanted to clip out all of the roads within the Canterbury region, I would add the road_cl.shp (road centrelines &#8211; a massive layer at the best of times) layer from J:\\Data\\Toposhapefiles:<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2013\/04\/Roads-1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3013\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2013\/04\/Roads-1.jpg\" alt=\"\" width=\"1631\" height=\"878\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2013\/04\/Roads-1.jpg 1631w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2013\/04\/Roads-1-300x161.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2013\/04\/Roads-1-1024x551.jpg 1024w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2013\/04\/Roads-1-768x413.jpg 768w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2013\/04\/Roads-1-1536x827.jpg 1536w\" sizes=\"auto, (max-width: 1631px) 100vw, 1631px\" \/><\/a><\/p>\n<p>Next, I need a polygon layer that shows the extent of the Canterbury region. \u00a0I&#8217;ll add the regions.shp layer from J:\\Data\\Administrative_Boundaries. \u00a0Note that this gives me all the regions but I want to use only the Canterbury Region, so I&#8217;ll go into the Attribute table and select the Canterbury record &#8211; note how it&#8217;s outlined in blue. \u00a0With most tools in ArcGIS, if a tool is run on a layer that has any features selected, it will only work on those features. \u00a0(Alternatively, with the Canterbury region selected, I could right-click on the layer name and go to <span style=\"color: #0000ff\">Data &gt; Export Data<\/span> to create a new layer with just the Canterbury region in it and use that as my boundary.)<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2013\/04\/Canty.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3014\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2013\/04\/Canty.jpg\" alt=\"\" width=\"1628\" height=\"880\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2013\/04\/Canty.jpg 1628w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2013\/04\/Canty-300x162.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2013\/04\/Canty-1024x554.jpg 1024w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2013\/04\/Canty-768x415.jpg 768w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2013\/04\/Canty-1536x830.jpg 1536w\" sizes=\"auto, (max-width: 1628px) 100vw, 1628px\" \/><\/a><\/p>\n<p>Now I&#8217;ll run the Clip tool. \u00a0You can find it in two places, either:<\/p>\n<ul>\n<li><span style=\"color: #0000ff\">ArcToolbox &gt; Analysis Tools &gt; Extract &gt; Clip,<\/span><\/li>\n<li><span style=\"color: #000000\">Search for it on the Geoprocessing pane, or<\/span><\/li>\n<li>Or, since it&#8217;s such a popular tool, it&#8217;s also found on the Analysis tab with the often used Tools section:<\/li>\n<\/ul>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2013\/04\/ToolOnAnalysis.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3015\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2013\/04\/ToolOnAnalysis.jpg\" alt=\"\" width=\"1377\" height=\"125\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2013\/04\/ToolOnAnalysis.jpg 1377w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2013\/04\/ToolOnAnalysis-300x27.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2013\/04\/ToolOnAnalysis-1024x93.jpg 1024w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2013\/04\/ToolOnAnalysis-768x70.jpg 768w\" sizes=\"auto, (max-width: 1377px) 100vw, 1377px\" \/><\/a><\/p>\n<p>From\u00a0any path, you set the Input Features as the layer you want to clip, specify your polygon boundary layer as the Clip Features and set the output location and name:<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2013\/04\/ClipTool-1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3016\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2013\/04\/ClipTool-1.jpg\" alt=\"\" width=\"283\" height=\"246\" \/><\/a><\/p>\n<p>Notice that I&#8217;ve got both layers added from the J: drive but am saving the output to my H: drive &#8211; no problem doing this. \u00a0Click\u00a0<span style=\"color: #0000ff\">Run <\/span>and off it goes. \u00a0When finished, the new layer is added to your map:<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2013\/04\/Output-1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3017\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2013\/04\/Output-1.jpg\" alt=\"\" width=\"1627\" height=\"886\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2013\/04\/Output-1.jpg 1627w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2013\/04\/Output-1-300x163.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2013\/04\/Output-1-1024x558.jpg 1024w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2013\/04\/Output-1-768x418.jpg 768w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2013\/04\/Output-1-1536x836.jpg 1536w\" sizes=\"auto, (max-width: 1627px) 100vw, 1627px\" \/><\/a><\/p>\n<p>Now I can remove the unneeded roads_cl.shp layer from my map and just work with the clipped data.<\/p>\n<p>Clipping is a fundamentally useful tool and one often used at the beginning of a project. \u00a0It allows you to work with a subset of larger dataset and can be used with points (e.g. water wells), lines (e.g powerlines or roads) or polygons (e.g. landcover, soils). \u00a0Clipping grids is a different process and warrants its own separate post.<\/p>\n<p>C<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post covers a very useful skill &#8211; clipping subsets of vector data from larger datasets (clipping raster data is covered in another post &#8211; Updated May 2021 for Pro). As seen is some earlier posts, most of the\u00a0data on the J: drive is at a national scale. \u00a0In many cases, though, you&#8217;ll be working [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-178","post","type-post","status-publish","format-standard","hentry","category-common-how-to-questions"],"_links":{"self":[{"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/posts\/178","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/comments?post=178"}],"version-history":[{"count":1,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/posts\/178\/revisions"}],"predecessor-version":[{"id":3988,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/posts\/178\/revisions\/3988"}],"wp:attachment":[{"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/media?parent=178"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/categories?post=178"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/tags?post=178"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}