{"id":5014,"date":"2025-10-28T00:04:39","date_gmt":"2025-10-28T00:04:39","guid":{"rendered":"https:\/\/blogs.lincoln.ac.nz\/gis\/?p=5014"},"modified":"2025-10-28T00:06:39","modified_gmt":"2025-10-28T00:06:39","slug":"zoning-in-on-landcover","status":"publish","type":"post","link":"https:\/\/blogs.lincoln.ac.nz\/gis\/zoning-in-on-landcover\/","title":{"rendered":"Zoning in on Landcover"},"content":{"rendered":"\n<p><em>We look at summarising vector polygon data within larger polygon zones using two different workflows.<\/em><\/p>\n\n\n\n<p>Polygons give us a handy way of creating <a href=\"https:\/\/blogs.lincoln.ac.nz\/gis\/zones-of-influence\/\" target=\"_blank\" rel=\"noreferrer noopener\">zones<\/a>, within which we might be interested in knowing what&#8217;s going on.  Think of country boundaries, regions, school zones or even your own property boundary.  Within those zones we often need to summarise some other phenomenon or physical characteristic.  Suppose, for example, we&#8217;re interested in getting a breakdown of landcover within a river catchment.  Sounds like it should be a pretty easy thing in GIS, yeah?  Well, not necessarily.  At least I haven&#8217;t found a straightforward way to do it yet so here I&#8217;ll outline two ways to do this.  To give us some context, we&#8217;ll work with the catchment for Lake Forsyth\/Wairewa on Banks Peninsula (which is composed of several different rivers and the lake): <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"721\" src=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/LRcatchment-1024x721.png\" alt=\"\" class=\"wp-image-5015\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/LRcatchment-1024x721.png 1024w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/LRcatchment-300x211.png 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/LRcatchment-768x541.png 768w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/LRcatchment.png 1129w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>I extracted this from the level 10 HydroBASINs layer on J:, just to give us something to work with.  And here&#8217;s the Landcover Database layer:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"542\" src=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/lcdb-1024x542.png\" alt=\"\" class=\"wp-image-5016\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/lcdb-1024x542.png 1024w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/lcdb-300x159.png 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/lcdb-768x406.png 768w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/lcdb-1536x813.png 1536w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/lcdb.png 1618w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Clearly, there are a number of different landcovers within the catchment &#8211; my aim here is to quantify their areas and percentages within the boundaries of the catchment.  Here&#8217;s a quick look at the LCDB attribute table:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"357\" src=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/lcdbtable-1024x357.png\" alt=\"\" class=\"wp-image-5017\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/lcdbtable-1024x357.png 1024w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/lcdbtable-300x104.png 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/lcdbtable-768x267.png 768w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/lcdbtable.png 1212w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>What I&#8217;m mostly interested in are the Name_ attributes.  They tell me the name (or category) of each landcover with values for 2018, 2012, 2008, 2001 and 1996 (seems like we&#8217;re overdue of an update).  Note too that there is a Class_ attribute.  This has a numerical code for each landcover.  <\/p>\n\n\n\n<p>It&#8217;s a subtle but very important point that, even though this code is a number, it&#8217;s really just a category (the data mavens amongst us would call them <a href=\"https:\/\/en.wikipedia.org\/wiki\/Level_of_measurement\">nominal data<\/a>).  While we could add 22 and 21 (the codes for Estuarine Open Water and River respectively), the result doesn&#8217;t mean anything: what landcover is 43?  It&#8217;s actually Tall Tussock Grassland, but adding the two doesn&#8217;t magically change the landcover &#8211; and Pro won&#8217;t stop you from doing this.  Key takeaway here is that the Class_ attribute is a name masquerading as a number.  <\/p>\n\n\n\n<p>As a first cut it might be tempting to try the <a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/tool-reference\/analysis\/summarize-within.htm\" target=\"_blank\" rel=\"noreferrer noopener\">Summarize Within<\/a> tool, which is designed to do just what I might want here: &#8220;Overlays a polygon layer with another layer to summarize the number of points, length of the lines, or area of the polygons within each polygon, and calculate attribute field statistics about the features within the polygons.&#8221;  The only problem here is that this tool only works with numerical rather than categorical attributes, i.e. numbers rather than names.  Let&#8217;s set the tool up so you can see what I mean:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"290\" height=\"517\" src=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/SWtool-1.png\" alt=\"\" class=\"wp-image-5019\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/SWtool-1.png 290w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/SWtool-1-168x300.png 168w\" sizes=\"auto, (max-width: 290px) 100vw, 290px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Under the Summary Fields, the tool only recognises the number fields.  In the case of these data, I can make this work by setting the field to Class_2018 and the Statistic to Sum:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"288\" height=\"216\" src=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/SWfields.png\" alt=\"\" class=\"wp-image-5020\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>The output is a new polygon layer and the table looks something like this &#8211; I can only show a small part to make it readable:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"116\" src=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/SWOutput-1024x116.png\" alt=\"\" class=\"wp-image-5021\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/SWOutput-1024x116.png 1024w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/SWOutput-300x34.png 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/SWOutput-768x87.png 768w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/SWOutput-1200x136.png 1200w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/SWOutput.png 1205w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>See how each of the class names is now a field?  It&#8217;d be easy to assume that the values for each field are in square kilometers (especially as I&#8217;ve set the Shape Unit to these units) but they are actually <em><strong>percentages <\/strong><\/em>of the total catchment area.  I only picked this up on a very careful reading of the help files.  Note that since my input polygon layer has only one record, there&#8217;s only one output record &#8211; but there&#8217;s no problem with having multiple input polygons.  For New Zealand, HydroBASINs at level 10 has 1,849 catchments which you could do all at once.<\/p>\n\n\n\n<p>Summarize Within only works here because I&#8217;ve got my Class_ codes.  But what if I didn&#8217;t have that?  Let&#8217;s assume I&#8217;ve only got my Name_ attributes and still want to do the summarising?  Here&#8217;s where a two-step approach comes in, namely by using Tabulate Intersection followed by Pivot Table.  Let me explain.  <\/p>\n\n\n\n<p><a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/tool-reference\/analysis\/tabulate-intersection.htm\" target=\"_blank\" rel=\"noreferrer noopener\">Tabulate Intersection<\/a> does just what it sounds like &#8211; it &#8220;Computes the intersection between two feature classes and cross tabulates the area, length, or count of the intersecting features.&#8221;:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"633\" height=\"274\" src=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/TIhelp.png\" alt=\"\" class=\"wp-image-5022\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/TIhelp.png 633w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/TIhelp-300x130.png 300w\" sizes=\"auto, (max-width: 633px) 100vw, 633px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>The Zone features are the polygons we want to summarise within while the Class features are what we want to summarise.  In the output (which is a table) each Zone can have multiple rows &#8211; one for each class within it.  Plus, we get Area and Percentage in one fell swoop.  Let&#8217;s try it on our Little River Catchment:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"297\" height=\"502\" src=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/TIsetup.png\" alt=\"\" class=\"wp-image-5023\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/TIsetup.png 297w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/TIsetup-177x300.png 177w\" sizes=\"auto, (max-width: 297px) 100vw, 297px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>I&#8217;ve set the Zone Field to HYBAS_ID.  This is a unique identifier for each catchment in this layer.  This will become more important when we use Pivot Table (I could have used OBJECTID as well).  Here&#8217;s the output:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"440\" height=\"586\" src=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/TIoutput.png\" alt=\"\" class=\"wp-image-5024\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/TIoutput.png 440w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/TIoutput-225x300.png 225w\" sizes=\"auto, (max-width: 440px) 100vw, 440px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>As we may have expected, we&#8217;ve got a record for each Name_2018 value with AREA and PERCENTAGE fields and all the HYBAS_IDs are the same.  This has tallied things up for us nicely but as a next step, we&#8217;ll attach these back to our catchment polygon using <a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/tool-reference\/data-management\/pivot-table.htm\" target=\"_blank\" rel=\"noreferrer noopener\">Pivot Table<\/a>.<\/p>\n\n\n\n<p>This tool works just like it does in Excel &#8211; we can reorganise the table and &#8220;flatten&#8221; this many-to-one relationship.  This image from the help file may help:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"404\" height=\"280\" src=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/PThelp.png\" alt=\"\" class=\"wp-image-5025\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/PThelp.png 404w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/PThelp-300x208.png 300w\" sizes=\"auto, (max-width: 404px) 100vw, 404px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>I&#8217;ll be honest, whenever I use this tool I have to think hard about which field is which and often have to run it a few times to get it right.  What I&#8217;m wanting to do is to convert this table of 20 rows to just one, with a column for each landcover&#8217;s AREA and PERCENTAGE.  The only drawback here is that I can only do AREA or PERCENTAGE, not both.  Here I&#8217;ve set it to do the PERCENTAGE: <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"295\" height=\"371\" src=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/PTsetup.png\" alt=\"\" class=\"wp-image-5026\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/PTsetup.png 295w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/PTsetup-239x300.png 239w\" sizes=\"auto, (max-width: 295px) 100vw, 295px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>The output is, once again, a table:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"106\" src=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/PToutput-1024x106.png\" alt=\"\" class=\"wp-image-5027\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/PToutput-1024x106.png 1024w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/PToutput-300x31.png 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/PToutput-768x80.png 768w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2025\/10\/PToutput.png 1222w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>If I need this as part of my polygon layer, I can next use a table join to link this back using HYBAS_ID, giving me a breakdown of the percentage area for each landcover.  Again, if I had multiple polygons in my input layer, I&#8217;d also have a breakdown for each one.  <\/p>\n\n\n\n<p>We&#8217;ve looked at two ways of summarising one layer&#8217;s polygons within a different set of polygons: Summarize Within and Tabulate Intersection\/Pivot Table.  Each can be made to work and which one you choose will depend on what attributes you&#8217;ve got to work with.  As another example, I was recently wanting to do something similar with zoning data within a town boundary.  The input data had categories of planning areas but no numerical code to go with it.  My only option was Tabulate Area\/Pivot Table so, once again, Analyst, know thy data.    <\/p>\n\n\n\n<p>We&#8217;ve got a few other things to cover while we&#8217;re talking about summarising data within polygons, especially when it comes to raster data (spoiler alert: <a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/3.3\/tool-reference\/spatial-analyst\/zonal-statistics.htm\" target=\"_blank\" rel=\"noreferrer noopener\">zonal statistics<\/a>).  But that&#8217;s a job for another day. <\/p>\n\n\n\n<p>C<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We look at summarising vector polygon data within larger polygon zones using two different workflows. Polygons give us a handy way of creating zones, within which we might be interested in knowing what&#8217;s going on. Think of country boundaries, regions, school zones or even your own property boundary. Within those zones we often need to [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":5030,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5014","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/posts\/5014","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=5014"}],"version-history":[{"count":2,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/posts\/5014\/revisions"}],"predecessor-version":[{"id":5029,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/posts\/5014\/revisions\/5029"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/media\/5030"}],"wp:attachment":[{"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/media?parent=5014"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/categories?post=5014"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/tags?post=5014"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}