{"id":2590,"date":"2020-05-21T12:33:44","date_gmt":"2020-05-21T00:33:44","guid":{"rendered":"http:\/\/blogs.lincoln.ac.nz\/gis\/?p=2590"},"modified":"2023-05-07T23:37:44","modified_gmt":"2023-05-07T23:37:44","slug":"where-the-wild-sub-clover-grows","status":"publish","type":"post","link":"https:\/\/blogs.lincoln.ac.nz\/gis\/where-the-wild-sub-clover-grows\/","title":{"rendered":"Where the Wild Sub Clover Grows"},"content":{"rendered":"<p><em>This posts looks at being mindful of creating ambiguous results in your spatial analysis, in a raster context<\/em><\/p>\n<p>The GIS Team recently did some work with Sonya Olykan and Derrick Moot on a North Island dryland farm.\u00a0 The aim was to identify where subterranean clover might be best\u00a0 grown on the Tokaroa Farm, near Martinborough.\u00a0 It&#8217;s a 608 hectare farm running sheep and beef (and do I sound like I know what I&#8217;m talking about here?).<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2020\/05\/TokaroaFarmBlogPostNew.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2601\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2020\/05\/TokaroaFarmBlogPostNew.jpg\" alt=\"\" width=\"1122\" height=\"794\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2020\/05\/TokaroaFarmBlogPostNew.jpg 1122w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2020\/05\/TokaroaFarmBlogPostNew-300x212.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2020\/05\/TokaroaFarmBlogPostNew-1024x725.jpg 1024w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2020\/05\/TokaroaFarmBlogPostNew-768x543.jpg 768w\" sizes=\"auto, (max-width: 1122px) 100vw, 1122px\" \/><\/a><\/p>\n<p>The aim of this analysis was to find the best places to\u00a0grow subterranean clover on the farm.\u00a0 The criteria were pretty straightforward and only considered slope and aspect over two parts of the farm: the flats and the ranges.<\/p>\n<p>For slope there were three classes:<\/p>\n<ul>\n<li>Flat: (0 &#8211; 7\u00ba)<\/li>\n<li><a href=\"https:\/\/en.wikipedia.org\/wiki\/Seed_drill\" target=\"_blank\" rel=\"noopener noreferrer\">Drillable<\/a>: (8 &#8211; 20\u00ba)<\/li>\n<li>Steep: (&gt; 20\u00ba)<\/li>\n<\/ul>\n<p>Flat and drillable are the most preferred areas for slope.\u00a0 The slope layer was reclassified so that:<\/p>\n<ul>\n<li>Flat = 1<\/li>\n<li>Drillable = 2<\/li>\n<li>Steep = 3<\/li>\n<\/ul>\n<p><em>(NB: there is a pretty big issue hiding in these classes, but <a href=\"http:\/\/blog.capterra.com\/wp-content\/uploads\/2015\/01\/dangerous.gif\" target=\"_blank\" rel=\"noopener noreferrer\">I&#8217;ll overlook it for now<\/a>.)<\/em><\/p>\n<p>For Aspect, two classes with their reclassified values:<\/p>\n<ul>\n<li>Sunny (northerly):\u00a0 W + NW + N + NE = 1<\/li>\n<li>Shady (southerly):\u00a0 E + SE + S + SW = 0<\/li>\n<\/ul>\n<p>As you might imagine, the north facing slopes are preferable.<\/p>\n<p>I now need to find a way to combine those two layers.<\/p>\n<p>So not too challenging to get these layers &#8211; slope and aspect are easy enough to derive once you&#8217;ve got a DEM, and then I can reclassify those layers to fit these criteria.<\/p>\n<p>The bigger challenge (and the reason why this is a blog post) is the next step of bringing these layers together in a meaningful way.\u00a0 Part of that means not creating a ambiguous results, or results that are difficult to interpret.\u00a0 GIS can be very much a <a href=\"https:\/\/techterms.com\/definition\/gigo\" target=\"_blank\" rel=\"noopener noreferrer\">GIGO\u00a0kind of thing<\/a> &#8211; good analysts will think ahead to any problems that might arise in a workflow and do their best to sidestep it ahead of time.\u00a0 Let&#8217;s start with our layers to illustrate this.\u00a0 Here&#8217;s my reclassified slope\u00a0layer using the classes from above:<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2020\/05\/slope.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2602\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2020\/05\/slope.jpg\" alt=\"\" width=\"1425\" height=\"843\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2020\/05\/slope.jpg 1425w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2020\/05\/slope-300x177.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2020\/05\/slope-1024x606.jpg 1024w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2020\/05\/slope-768x454.jpg 768w\" sizes=\"auto, (max-width: 1425px) 100vw, 1425px\" \/><\/a><\/p>\n<p>And here&#8217;s my aspect, simpler with just 0 (sunny) and 1 (shady).<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2020\/05\/aspect.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2603\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2020\/05\/aspect.jpg\" alt=\"\" width=\"1430\" height=\"841\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2020\/05\/aspect.jpg 1430w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2020\/05\/aspect-300x176.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2020\/05\/aspect-1024x602.jpg 1024w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2020\/05\/aspect-768x452.jpg 768w\" sizes=\"auto, (max-width: 1430px) 100vw, 1430px\" \/><\/a><\/p>\n<p>I next want to combine these layers so I can clearly know where the different conditions are, e.g flat\/sunnyor drillable\/shady.\u00a0 The key to do that is to think about how to combine these layers in a raster calculation to avoid anything ambiguous.\u00a0 As it is I&#8217;m combining 0s and 1s with 1s, 2s and 3s.\u00a0 I&#8217;ve got two simple options here, for the sake of argument: I could either add the layers together or multiply them.\u00a0 I&#8217;ll use a table here to illustrate the possible outputs:<\/p>\n<table style=\"height: 120px\" width=\"343\">\n<tbody>\n<tr>\n<td style=\"width: 68.6667px;text-align: center\">S + A<\/td>\n<td style=\"width: 68.6667px;text-align: center\">1<\/td>\n<td style=\"width: 68.6667px;text-align: center\">2<\/td>\n<td style=\"width: 69.3333px;text-align: center\">3<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 68.6667px;text-align: center\">0<\/td>\n<td style=\"width: 68.6667px;text-align: center\">1<\/td>\n<td style=\"width: 68.6667px;text-align: center\">2<\/td>\n<td style=\"width: 69.3333px;text-align: center\">3<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 68.6667px;text-align: center\">1<\/td>\n<td style=\"width: 68.6667px;text-align: center\">2<\/td>\n<td style=\"width: 68.6667px;text-align: center\">3<\/td>\n<td style=\"width: 69.3333px;text-align: center\">4<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>If I do this, I&#8217;ll get some ambiguous results &#8211; I won&#8217;t be able to separate the flat\/sunny slopes from the drillable\/shady ones.\u00a0 Same for drillable\/sunny and steep\/sunny.<\/p>\n<p>What if I multiple them together?<\/p>\n<table style=\"height: 127px\" width=\"343\">\n<tbody>\n<tr>\n<td style=\"width: 68.6667px;text-align: center\">S * A<\/td>\n<td style=\"width: 68.6667px;text-align: center\">1<\/td>\n<td style=\"width: 68.6667px;text-align: center\">2<\/td>\n<td style=\"width: 69.3333px;text-align: center\">3<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 68.6667px;text-align: center\">0<\/td>\n<td style=\"width: 68.6667px;text-align: center\">0<\/td>\n<td style=\"width: 68.6667px;text-align: center\">0<\/td>\n<td style=\"width: 69.3333px;text-align: center\">0<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 68.6667px;text-align: center\">1<\/td>\n<td style=\"width: 68.6667px;text-align: center\">1<\/td>\n<td style=\"width: 68.6667px;text-align: center\">2<\/td>\n<td style=\"width: 69.3333px;text-align: center\">3<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Clearly that&#8217;s not going to get me any closer.\u00a0 So I&#8217;ll do a bit of hybrid.\u00a0 I&#8217;ll multiply my slope classes by 10 and then add them to my aspect classes.\u00a0 This is just a raster calculation which I&#8217;ll do in one fell swoop:<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2020\/05\/RC.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2607\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2020\/05\/RC.jpg\" alt=\"\" width=\"566\" height=\"395\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2020\/05\/RC.jpg 886w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2020\/05\/RC-300x209.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2020\/05\/RC-768x536.jpg 768w\" sizes=\"auto, (max-width: 566px) 100vw, 566px\" \/><\/a><\/p>\n<p>What do I get from this?<\/p>\n<table style=\"height: 120px\" width=\"340\">\n<tbody>\n<tr>\n<td style=\"width: 67.3333px;text-align: center\">10*S + A<\/td>\n<td style=\"width: 68px;text-align: center\">10<\/td>\n<td style=\"width: 68px;text-align: center\">20<\/td>\n<td style=\"width: 69.3333px;text-align: center\">30<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 67.3333px;text-align: center\">0<\/td>\n<td style=\"width: 68px;text-align: center\">10<\/td>\n<td style=\"width: 68px;text-align: center\">20<\/td>\n<td style=\"width: 69.3333px;text-align: center\">30<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 67.3333px;text-align: center\">1<\/td>\n<td style=\"width: 68px;text-align: center\">11<\/td>\n<td style=\"width: 68px;text-align: center\">21<\/td>\n<td style=\"width: 69.3333px;text-align: center\">31<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>That&#8217;s cleared up any ambiguity for me now.\u00a0 I can clearly separate out the classes and know what&#8217;s what with certainty.<\/p>\n<ul>\n<li>10 = shady and flat<\/li>\n<li>11 = sunny and flat<\/li>\n<li>20 = shady and drillable<\/li>\n<li>21 = sunny and drillable<\/li>\n<li>30 = shady and steep<\/li>\n<li>31 = sunny and steep<\/li>\n<\/ul>\n<p>Here&#8217;s a subtle point that goes along with what were doing here.\u00a0 I started with Slope and Aspect grids &#8211; the values in those grids had a physical meaning.\u00a0 As soon as I reclassified them into their different classes, the numbers ceased being used as numbers.\u00a0 Now they&#8217;re being used like names; their values signify classes, or better still, categories.\u00a0 I have to do this with numbers because when we do raster calculations, it&#8217;s only a grid&#8217;s values that is worked with &#8211; none of the other attributes can really be used.\u00a0 Here I&#8217;m using numbers as names (in the parlance of the data analysis trade, they are now <a href=\"https:\/\/www.graphpad.com\/support\/faq\/what-is-the-difference-between-ordinal-interval-and-ratio-variables-why-should-i-care\/\" target=\"_blank\" rel=\"noopener noreferrer\">nominal data<\/a>).\u00a0 A value of 21 in my table above has no physical meaning whatsoever, but it points to a category of cells that are drillable\/northerly slopes.<\/p>\n<p>For the final mapping, I need to be able to separate these out as separate areas on the map, so removing any ambiguity is pretty critical.\u00a0 Here&#8217;s a final map of these classes, highlighting the most and least preferable areas:<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2020\/05\/FarmMap2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2606\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2020\/05\/FarmMap2.jpg\" alt=\"\" width=\"1122\" height=\"794\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2020\/05\/FarmMap2.jpg 1122w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2020\/05\/FarmMap2-300x212.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2020\/05\/FarmMap2-1024x725.jpg 1024w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2020\/05\/FarmMap2-768x543.jpg 768w\" sizes=\"auto, (max-width: 1122px) 100vw, 1122px\" \/><\/a><\/p>\n<p>(Hmmmm&#8230;really debating if that hillshade underneath is helping or hurting.\u00a0 What do you think?)<\/p>\n<p>Behind the scenes you can see how I&#8217;ve grouped the classes together for the symbology &#8211; note the raster values that tell me what&#8217;s what:<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2020\/05\/Symbology.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2608\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2020\/05\/Symbology.jpg\" alt=\"\" width=\"485\" height=\"203\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2020\/05\/Symbology.jpg 652w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2020\/05\/Symbology-300x126.jpg 300w\" sizes=\"auto, (max-width: 485px) 100vw, 485px\" \/><\/a><\/p>\n<p>Of course, you could easily make the argument that I should have thought this through when I assigned the new values in my reclassified grids &#8211; and right you would be &#8211; but then what would I have to blather on about?<\/p>\n<p>C<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This posts looks at being mindful of creating ambiguous results in your spatial analysis, in a raster context The GIS Team recently did some work with Sonya Olykan and Derrick Moot on a North Island dryland farm.\u00a0 The aim was to identify where subterranean clover might be best\u00a0 grown on the Tokaroa Farm, near Martinborough.\u00a0 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2590","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/posts\/2590","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=2590"}],"version-history":[{"count":9,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/posts\/2590\/revisions"}],"predecessor-version":[{"id":4183,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/posts\/2590\/revisions\/4183"}],"wp:attachment":[{"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/media?parent=2590"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/categories?post=2590"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/tags?post=2590"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}