{"id":3794,"date":"2022-10-12T12:01:59","date_gmt":"2022-10-11T23:01:59","guid":{"rendered":"http:\/\/blogs.lincoln.ac.nz\/gis\/?p=3794"},"modified":"2023-05-07T02:36:15","modified_gmt":"2023-05-07T02:36:15","slug":"burning-the-streams","status":"publish","type":"post","link":"https:\/\/blogs.lincoln.ac.nz\/gis\/burning-the-streams\/","title":{"rendered":"Burning the Streams"},"content":{"rendered":"<p><em>Here we talk about how GIS can be used to create catchment boundaries and river lines from elevation data.<\/em><\/p>\n<p>Far be it from a surface water person like me to advocate for burning streams in any way (we&#8217;re not talking about the <a href=\"https:\/\/www.smithsonianmag.com\/history\/cuyahoga-river-caught-fire-least-dozen-times-no-one-cared-until-1969-180972444\/\" target=\"_blank\" rel=\"noopener noreferrer\">Cuyahoga River<\/a>\u00a0here), but in a geospatial sense it can be a good thing.<\/p>\n<p>In a<a href=\"http:\/\/blogs.lincoln.ac.nz\/gis\/sometimes-simple-is-best\/\" target=\"_blank\" rel=\"noopener noreferrer\"> previous post<\/a> we were talking about the <a href=\"https:\/\/niwa.co.nz\/freshwater\/management-tools\/river-environment-classification-0\" target=\"_blank\" rel=\"noopener noreferrer\">River Environment Classification<\/a>\u00a0(REC) database &#8211; a very useful layer that shows us where the rivers are along with a range of useful attributes relating to <a href=\"https:\/\/www.youtube.com\/watch?v=vP4iY1TtS3s\" target=\"_blank\" rel=\"noopener noreferrer\">the content of their character<\/a>.\u00a0 One of the things we commented on was the jagged nature of the river lines in this image:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3900 size-large\" src=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/09\/v1-1024x627.jpg\" alt=\"\" width=\"900\" height=\"551\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/09\/v1-1024x627.jpg 1024w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/09\/v1-300x184.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/09\/v1-768x471.jpg 768w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/09\/v1.jpg 1268w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<p>With more detail here:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3749 size-full\" src=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/09\/v2.jpg\" alt=\"\" width=\"513\" height=\"313\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/09\/v2.jpg 513w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/09\/v2-300x183.jpg 300w\" sizes=\"auto, (max-width: 513px) 100vw, 513px\" \/><\/p>\n<p>Odd, those angular edges and I&#8217;m reminded of the classic London Tube maps were we see something similar &#8211; lines are either horizontal, or vertical or an angle of 45 degrees:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-4027 size-full\" src=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/63951-640x360-tubemap-640.jpg\" alt=\"\" width=\"640\" height=\"360\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/63951-640x360-tubemap-640.jpg 640w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/63951-640x360-tubemap-640-300x169.jpg 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>Here we get a few more rounded corners, but still only a limited set of orientations.<\/p>\n<p><em>(Sidenote: the reality is quite different:<\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-4028 size-large\" src=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/real-tube-map-1-1024x688.gif\" alt=\"\" width=\"900\" height=\"605\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/real-tube-map-1-1024x688.gif 1024w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/real-tube-map-1-300x201.gif 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/real-tube-map-1-768x516.gif 768w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<p>While the reasons for these two being similar are different <em>(Ed. That was quite a mouthful&#8230;)<\/em>, the underlying aim was the same: simplification.\u00a0 While I could spend quite a lot of time talking about the Tube map, I won&#8217;t here <em>(Ed. Thanks)\u00a0<\/em>but let&#8217;s look at a good source of &#8220;truth&#8221; for rivers, the 1:250,000 scale topo maps &#8211; here&#8217;s the same area shown in the first image above with a lot of transparency to the basemap so it doesn&#8217;t overwhelm:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-4029 size-large\" src=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/topo-1024x695.jpg\" alt=\"\" width=\"900\" height=\"611\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/topo-1024x695.jpg 1024w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/topo-300x204.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/topo-768x521.jpg 768w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/topo.jpg 1138w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><!--more--><\/p>\n<p>One important thing to note is that the rivers aren&#8217;t in the same place.\u00a0 Who&#8217;s right?\u00a0 Or perhaps better, who&#8217;s closer to right?<\/p>\n<p>One important difference between the river locations is that what we see on the topo map was derived from aerial photos.\u00a0 Some pour soul pored over the images and manually created the river lines you see on the basemap, so they are likely to be <em>closer<\/em> to the actual locations.\u00a0 (And that pour soul is now either blind, or insane, or both.)<\/p>\n<p>The REC riverlines were derived in an entirely different way, using elevation data and analysis tools.\u00a0 To do this analytically, there&#8217;s a well established methodology, colloquially known as &#8220;burning&#8221; steams into a DEM.\u00a0 There are a few steps in the process and maybe we should start with an overview.\u00a0 The basic idea goes back to the basics of rainfall and runoff on the land surface.\u00a0 When rain falls on an area of land, it can flow downhill driven by gravity in the direction of the steepest slope.\u00a0 Eventually, enough of this water combines in low points to form small streams that contribute all the way up to very large rivers.\u00a0 The area that contributes water to a river system is what we&#8217;ll call the catchment (or watershed to you North Americans).\u00a0 We&#8217;ve looked at <a href=\"https:\/\/blogs.lincoln.ac.nz\/gis\/on-the-edge\/\" target=\"_blank\" rel=\"noopener noreferrer\">defining this area manually<\/a> previously but from here on in we&#8217;re letting the computer do all the work.<\/p>\n<p>I&#8217;ll try and demonstrate this with some data from the Kaituna River on the nearby shores of Te Waihora.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-4030 size-full\" src=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/Kaituna.jpg\" alt=\"\" width=\"917\" height=\"802\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/Kaituna.jpg 917w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/Kaituna-300x262.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/Kaituna-768x672.jpg 768w\" sizes=\"auto, (max-width: 917px) 100vw, 917px\" \/><\/p>\n<p>You can get a rough sense of the catchment boundary by interpreting the contour lines and the terrain but that doesn&#8217;t get us any closer to lines on the map.\u00a0 To get this part started, we need a DEM and I&#8217;m going to use Manaaki Whenua\/Landcare Research&#8217;s <a href=\"https:\/\/lris.scinfo.org.nz\/layer\/48127-nzdem-south-island-25-metre\/\" target=\"_blank\" rel=\"noopener noreferrer\">25 m national DEM<\/a>, here\u00a0 displayed as a hillshade layer:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-4031 size-full\" src=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/KaiHS.jpg\" alt=\"\" width=\"887\" height=\"808\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/KaiHS.jpg 887w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/KaiHS-300x273.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/KaiHS-768x700.jpg 768w\" sizes=\"auto, (max-width: 887px) 100vw, 887px\" \/><\/p>\n<p>Pretty coarse, you might say in these days of LiDAR this and LiDAR that &#8211; but be aware that NIWA used a 30 m DEM to derive both REC layers.<\/p>\n<p>Before we go much further, we need to fix some potential problems in the DEM, mainly unnatural holes and peaks in the DEM. (<a href=\"https:\/\/blogs.lincoln.ac.nz\/gis\/topo-to-raster-tool\/\" target=\"_blank\" rel=\"noopener noreferrer\">Where did that DEM come from?<\/a>)\u00a0 Sometimes, as a result of the analysis, we end up with elevation values that are either unreasonably low (and hence would allow water to pour in), or excessively high elevation outliers.\u00a0 We can run the <a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/tool-reference\/spatial-analyst\/fill.htm\" target=\"_blank\" rel=\"noopener noreferrer\">Fill <\/a>tool to fill up these depressions.\u00a0 Then, the <a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/2.9\/tool-reference\/spatial-analyst\/zonal-statistics.htm\" target=\"_blank\" rel=\"noopener noreferrer\">Zonal Statistics <\/a>tool helps smooth out any excessively high elevation values (using the Mean value).\u00a0 This, hopefully gives us a nice, smooth DEM for our next step &#8211; flow direction.<\/p>\n<p>As we noted earlier, water flowing on the land surface tends to move downhill in the direction of steepest slope.\u00a0 Handily, there&#8217;s a<a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/tool-reference\/spatial-analyst\/flow-direction.htm\" target=\"_blank\" rel=\"noopener noreferrer\"> Flow\u00a0Direction\u00a0Too<\/a>l which explicitly does this for us &#8211; it&#8217;s kind of an alternative version of the Slope tool and, with the default settings, we get this:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-4033 size-large\" src=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/FlowD2-1024x648.jpg\" alt=\"\" width=\"900\" height=\"570\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/FlowD2-1024x648.jpg 1024w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/FlowD2-300x190.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/FlowD2-768x486.jpg 768w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/FlowD2.jpg 1361w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<p>Bit crazy looking &#8211; note the values in the Contents.\u00a0 These relate to flow directions relative to the grid cell of interest:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-4034\" src=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/FlowDtable.jpg\" alt=\"\" width=\"200\" height=\"202\" \/><\/p>\n<p><em>(And here the first inklings as to why our REC riverlines look the way they do&#8230;)<\/em><\/p>\n<p>Next, we run the <a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/tool-reference\/spatial-analyst\/flow-accumulation.htm\" target=\"_blank\" rel=\"noopener noreferrer\">Flow Accumulation<\/a> tool which takes the Flow Direction layer as its input and, for each cell, starts to sum up the number of cells above it that are contributing to that cell, so low flow accumulation values would be near the top of the catchment and values increase as one moves further down.\u00a0 Here&#8217;s ours for the Kaituna:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-4035 size-full\" src=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/FlowA.jpg\" alt=\"\" width=\"992\" height=\"793\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/FlowA.jpg 992w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/FlowA-300x240.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/FlowA-768x614.jpg 768w\" sizes=\"auto, (max-width: 992px) 100vw, 992px\" \/><\/p>\n<p>Nothing to write home about (yet) but we&#8217;ve now actually got a lot of useful information to start better defining where the rivers run.<\/p>\n<p>Next step &#8211; I have to create a &#8220;pour point&#8221; &#8211; this is just a point that tells the system where the outlet of the catchment is.\u00a0 I&#8217;ve placed it manually near the highway bridge that runs over the Kaituna River:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-4036 size-full\" src=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/PourPoint.jpg\" alt=\"\" width=\"916\" height=\"748\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/PourPoint.jpg 916w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/PourPoint-300x245.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/PourPoint-768x627.jpg 768w\" sizes=\"auto, (max-width: 916px) 100vw, 916px\" \/><\/p>\n<p>Yet another step along the way (anyone keeping a running tally?) &#8211; ran the <a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/tool-reference\/spatial-analyst\/snap-pour-point.htm\" target=\"_blank\" rel=\"noopener noreferrer\">Snap Pour Point<\/a> tool which basically just converts my point to a raster and snaps it to the nearest Flow Accumulation grid cell.\u00a0 Nothing to see with this output so we&#8217;re on to our next big step &#8211; creating a catchment boundary layer.<\/p>\n<p>The <a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/tool-reference\/spatial-analyst\/watershed.htm\" target=\"_blank\" rel=\"noopener noreferrer\">Watershed <\/a>tool helps us next define the extent of the catchment:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-4038 size-medium\" src=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/WS2-287x300.jpg\" alt=\"\" width=\"287\" height=\"300\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/WS2-287x300.jpg 287w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/WS2.jpg 312w\" sizes=\"auto, (max-width: 287px) 100vw, 287px\" \/><\/p>\n<p>And here&#8217;s my result:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-4039 size-full\" src=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/TEst.jpg\" alt=\"\" width=\"958\" height=\"791\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/TEst.jpg 958w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/TEst-300x248.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/TEst-768x634.jpg 768w\" sizes=\"auto, (max-width: 958px) 100vw, 958px\" \/><\/p>\n<p>Nice!\u00a0 It&#8217;s a raster layer which might be more useful as a vector polygon and the aptly names Raster to Polygon tool quickly does the job (symbolised in blue with a hollow fill):<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-4040 size-full\" src=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/catchment.jpg\" alt=\"\" width=\"918\" height=\"784\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/catchment.jpg 918w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/catchment-300x256.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/catchment-768x656.jpg 768w\" sizes=\"auto, (max-width: 918px) 100vw, 918px\" \/><\/p>\n<p>We&#8217;re now poised for the last and most important step along the way &#8211; creating the river lines based on all these layers.\u00a0 Hopefully you can see how they all work together to map where the river would flow based on the terrain.\u00a0 We&#8217;ll use a seldom used, unsung hero of raster analysis to get the rivers &#8211; the <a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/tool-reference\/spatial-analyst\/con-.htm\" target=\"_blank\" rel=\"noopener noreferrer\">Con <\/a>tool.\u00a0 This is basically a tool that let&#8217;s us reset values in a raster layer based on some conditions, such as if elevation value is above 100 m, give that cell a value of 1 in the output, so it&#8217;s really a form of reclassification.\u00a0 In this case, we use Con on the Flow Accumulation grid to find cells with accumulated values above some threshold &#8211; magically (according to <a href=\"https:\/\/lab.cccb.org\/en\/arthur-c-clarke-any-sufficiently-advanced-technology-is-indistinguishable-from-magic\/#:~:text=In%201962%2C%20in%20his%20book,technology%20is%20indistinguishable%20from%20magic%E2%80%9D.\" target=\"_blank\" rel=\"noopener noreferrer\">Clarke&#8217;s 3rd Law<\/a>) we get rivers out of this.\u00a0 Here&#8217;s how I set the tool up:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4041\" src=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/ConTool-221x300.jpg\" alt=\"\" width=\"221\" height=\"300\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/ConTool-221x300.jpg 221w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/ConTool.jpg 493w\" sizes=\"auto, (max-width: 221px) 100vw, 221px\" \/><\/p>\n<p>The 500 in &#8220;Value is greater than or equal to 500&#8221; was a bit of trial and error.\u00a0 The lower this number the more stream segments you get.\u00a0 500 gave me some results similar to the REC dataset, as shown below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-4042 size-full\" src=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/Output.jpg\" alt=\"\" width=\"597\" height=\"555\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/Output.jpg 597w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/Output-300x279.jpg 300w\" sizes=\"auto, (max-width: 597px) 100vw, 597px\" \/><\/p>\n<p>The output here is a raster with a 25 m resolution, so to better compare it to the REC data I&#8217;ll convert it to a vector feature class (using the <a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/tool-reference\/spatial-analyst\/stream-to-feature.htm\" target=\"_blank\" rel=\"noopener noreferrer\">Stream to Feature<\/a> tool) and set the line widths and colours to they stand out better; REC in green, ours in blue:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-4043 size-full\" src=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/Compare.jpg\" alt=\"\" width=\"563\" height=\"555\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/Compare.jpg 563w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/Compare-300x296.jpg 300w\" sizes=\"auto, (max-width: 563px) 100vw, 563px\" \/><\/p>\n<p>Some reasonably good agreement, though things are quite different near the outlet &#8211; which might get down to the differences between the different DEMs used.\u00a0 Let&#8217;s zoom in a bit and hopefully see the reason for this whole bloomin&#8217; post in the first place:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-4045 size-full\" src=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/ZoomCompare2.jpg\" alt=\"\" width=\"970\" height=\"676\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/ZoomCompare2.jpg 970w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/ZoomCompare2-300x209.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/ZoomCompare2-768x535.jpg 768w\" sizes=\"auto, (max-width: 970px) 100vw, 970px\" \/><\/p>\n<p>I hope this image makes sense &#8211; our resulting vector river line is in blue.\u00a0 The pinkish areas are from the original raster streams layer so the line basically goes through the centre of each of the cells.\u00a0 Notice how the line segments are either east-west, north-south, or at a 45 degree angle &#8211; just like we saw at the beginning.\u00a0 And this takes us right back to the raster nature of the original input &#8211; the 25 m DEM.\u00a0 This accounts for why the resulting line layer is so stair-steppy and not smooth &#8211; water only flows into one of its nearest neighbours in one of our three directional options.<\/p>\n<p>This is a fairly involved process and lots of places where it can go wrong.\u00a0 And it&#8217;s not a perfect process, especially in flat areas.\u00a0 Case in point, look at what a mess it makes of things trying to find it&#8217;s way through Te Waihora:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-4046 size-full\" src=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/mess.jpg\" alt=\"\" width=\"688\" height=\"564\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/mess.jpg 688w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/mess-300x246.jpg 300w\" sizes=\"auto, (max-width: 688px) 100vw, 688px\" \/><\/p>\n<p>But in hilly areas with enough terrain, this works pretty well.\u00a0 As a double bonus, the DEM I used for this exercise was one covering all of Banks Peninsula, so I&#8217;ve actually ended up with simulated streams across the whole peninsula:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-4047 size-full\" src=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/BP.jpg\" alt=\"\" width=\"825\" height=\"672\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/BP.jpg 825w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/BP-300x244.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/BP-768x626.jpg 768w\" sizes=\"auto, (max-width: 825px) 100vw, 825px\" \/><\/p>\n<p>And of course this is quite similar to what our friends at NIWA have done with the REC database, which covers the whole country (here&#8217;s just a bit for Canterbury):<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-4048 size-full\" src=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/CantREC.jpg\" alt=\"\" width=\"1018\" height=\"664\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/CantREC.jpg 1018w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/CantREC-300x196.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/10\/CantREC-768x501.jpg 768w\" sizes=\"auto, (max-width: 1018px) 100vw, 1018px\" \/><\/p>\n<p>I don&#8217;t know for sure if these are the tools NIWA would have used but they&#8217;re certainly one way to do them within the ArcGIS ecosystem.\u00a0 All of these tools live in the <a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/tool-reference\/ready-to-use\/an-overview-of-the-hydrology-toolset.htm\" target=\"_blank\" rel=\"noopener noreferrer\">Hydrology toolset<\/a>\u00a0and are there for the taking.\u00a0 All you need to get started is a DEM and a fair modicum of patience.<\/p>\n<p>One might be tempted to think that, in these days of LiDAR and all, that the improved resolution available would give you better outputs.\u00a0 I&#8217;ve looked in to this a bit and\u00a0my experience thus far is that LiDAR almost gives us too much information &#8211; the resulting stream networks end up doing some crazy things, but that&#8217;s a story for another day.<\/p>\n<p>I&#8217;m exhausted after all that&#8230;<\/p>\n<p>C<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here we talk about how GIS can be used to create catchment boundaries and river lines from elevation data. Far be it from a surface water person like me to advocate for burning streams in any way (we&#8217;re not talking about the Cuyahoga River\u00a0here), but in a geospatial sense it can be a good thing. [&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-3794","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/posts\/3794","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=3794"}],"version-history":[{"count":3,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/posts\/3794\/revisions"}],"predecessor-version":[{"id":4049,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/posts\/3794\/revisions\/4049"}],"wp:attachment":[{"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/media?parent=3794"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/categories?post=3794"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/tags?post=3794"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}