 Hello, I'm Stacey, the GIS analyst with the Natural Capital Project, and I'm glad that you've joined me to learn some techniques for working with the geospatial data that's used by the Invest Ecosystem Service Modeling Toolkit. In this episode, we'll talk about creating watersheds. To get the most out of this tutorial, I highly recommend following along in your own GIS session. In this video, we will demonstrate techniques in ArcGIS, and we will be working with some sample data, which is linked to on the web page for this video. Also, in this episode, we'll be using one of the Invest Tools, so make sure that Invest is installed and working. In several previous episodes, including preparing the DEM, we worked with data in Nepal, so we will continue with that location in this video. If you happen to have an ArcGIS session saved from those earlier episodes in Nepal, you can use it again now. If you don't, that's totally fine too. Just open up a new session. So if you haven't already, now is a good time to pause this video, download the sample data, unzip it, and bring up an ArcGIS session before continuing. Using watersheds is the last step in processing the hydrology-related layers that go into Invest Models. As a reminder of the workflow, we usually start out with raw DEM tiles, which we merge into a mosaic. Then we check the mosaic for missing data. We project it to the project's coordinate system, fill sinks, and verify that it makes an acceptable stream network. At this point, we probably feel comfortable using it for our analysis, so we can commit to creating the watershed that we'll use for our area of interest in the model. A watershed represents the upslope area that creates streams that drain into a particular point on the landscape. Often, when we are running hydrology models, we are interested in evaluating the landscape that provides water, sediment, or nutrient to a reservoir, a drinking water facility, a community, or some other point of interest. This point is called the outlet of the watershed, and it's indicated by a star in the map that you see here. And in this map, that's actually the town of Belmapon, the capital city of Belize. Even if we are not focused on a specific point, most of the hydrology models recommend that we provide an entire watershed as the area of interest, because if we don't use a watershed, but instead use something like an administrative boundary, it will probably artificially cut off some of the drainage area, interrupting the flow path so that the result does not capture all of the water, sediment, or nutrient that is actually contributing to water quality or water quantity in the streams within the landscape that you're studying. In the example that you see here, we were working with partners in the western part of Belize, and we were informing policy that would only affect Belize, but there was a focus on water-related services. And it turns out that a large part of the watershed draining into the city of Belmapon is actually in Guatemala. There's even one major river, the Mopon, down here in the southern part, that starts out in Belize, travels into Guatemala, and then comes back into Belize. So the water quality and quantity that arrives to Belmapon is actually very much dependent on what happens in Guatemala, too. So even though we were informing policy in Belize, we actually modeled this whole watershed that you see. And if you look at where the border is, if we had only modeled hydrology inside of the border of Belize, we would only be seeing part of the picture, and you can see how the rivers would be artificially cut off. And especially, we would be missing the effect of the Mopon River, which would just drain off the map, instead of contributing water to Belmapon. One side note is that right now, we are only talking about watersheds, but two of the urban models, flood risk and stormwater retention, can take either watersheds or sewer sheds as the area of interest. Now where a watershed represents natural topography flowing to a single point, a sewer shed represents an area in an urban landscape where all of the sewers drain to a single point. Maps of sewer sheds are not based solely on topography or digital elevation model, so we will not be covering them in this tutorial. What we will cover is creating watersheds from a DEM using the invest tool delineated. Now of course, there are many other tools that we can use to create watersheds, including those provided by our GIS software. And if you have a favorite one that works for you, great, feel free to use it. I use delineated because it is simple to use, it works well, and it can generate watersheds that overlap, which is sometimes useful for ecosystem service analyses, like when your points of interest all lie on the same river. The geospatial inputs to the tool are a digital elevation model or DEM, and the point location of the outlet or outlets that you're generating watersheds for. It's important to make sure that you use the same DEM to create your watershed as you are using as input to the hydrology model. So in other words, the same DEM as you're using as input to the SDR, NDR, or seasonal water yield models. Because if you use a different source for your watershed, it might not line up correctly with hydrology that is generated by the model, and the results that are aggregated within that watershed will not be accurate. It also takes in a threshold flow accumulation or TFA value, which is used to create the stream network. Threshold flow accumulation is a number that defines the number of upstream pixels that must flow into a particular pixel for it to be considered part of the stream. Another way of thinking about this is that it defines the upslope contributing area that's required for a stream to form. Large values of TFA create a stream network with fewer tributaries, like you see in the picture on the top, and a small values of TFA create a stream network with more tributaries, like you see in the image on the bottom. For creating watersheds, it's important to choose this value so that the streams are created in the right place to correspond with your points of interest. The next input, snapping distance, is also related to streams. It's very common that the location of our outlet point is not exactly on top of a stream generated by the model. This can happen for a variety of reasons, but when it does happen, the watershed that is created by the tool tends to be extremely small, much smaller than in real life, because it's not recognizing the whole stream network flowing to that point. The snapping distance allows the tool to search for the nearest stream around the outlet point and move or snap the outlet point to that stream so that a correct watershed can be generated. If you are only using one or a small number of outlets in the tool, you could instead manually edit the location of the outlet so that it lies exactly on the stream that the model generates. But if you have a lot of points, or you just don't want to manually edit the points, you can use this feature. The output of delineated are the watersheds flowing to your outlet points. And as you can see in this map, it can make many watersheds at a time, or it can just make one if that's all you need. For one of our projects, I made thousands of watersheds using this tool. And one thing to notice about many of the watersheds in this particular example is that they do run up against the country border of Mozambique. But in reality, they drain across many other African countries. Now, for this project, the stakeholders decided only to model within the border of Mozambique, with the understanding that most of the water flowing to these dams originates outside of its borders. So we actually did this differently than we did in Belize. OK, let's go look at our sample data in the GIS. All right, let's open a file explorer to the sample data folder, which is called creating watersheds data. And inside this folder are two layers, the DEM that we've previously prepared for use and invest, and a shapefile with a point location for a dam, which we will create a watershed for. Bring both of these layers into the GIS, DEM filled.tif and damintake.shp, and I'm going to change the symbology for the dam so that we can see it a little bit better. Now we're going to use these layers as inputs to delineate it. You can launch delineate it in the same way that you do other invest tools. I'll do this through the Windows start menu. And if you're doing Mac, you'll know how to do it a little bit differently. All right, so let's go into the invest model folder and find the tool called delineate it and launch that tool. All right, for workspace, let's navigate to the folder where you want the tool's output files to be written. I'm going to make a new folder called delineate it output. So delineate it output. You can call it something else if you like, right, and I'm going to select that folder. For result suffix, let's keep it simple and just enter the string dam, D-A-M. All right, for digital elevation model, let's drag in DEM filled.tif. And then this next box, detect poor points, we're going to leave that unchecked. If you select detect poor points, the model will try to find outlets based on where streams flow off of the edge of the raster, but we have our own outlet point already created. So we'll use that instead and we'll drag that into the outlet features box. So bring in dam intake.shp. We will check the box next to skip invalid geometries. This way, if the tool finds an outlet point or polygon that is invalid, it will skip it and move on to the next one. If you leave this box unchecked, the tool will throw an error if it encounters an invalid geometry and it will not continue. We will also check the box next to snap points to the nearest stream. As I mentioned earlier, it is common that our outlet points are close to but not quite on top of the streams that are generated by invest. So we can tell the tool to snap our points to the nearest stream before delineating the watershed. And when we check this box, two more inputs are now required. The first is the threshold flow accumulation, which is similar to what is used by the different hydrology models. And for this example, we will give this a value of 1000. Next is the pixel distance to snap outlet points. This value is given in a number of pixels. And for this example, we'll give it a value of five. This means that the tool should search for five pixels in all directions of the outlet point to find the nearest stream. Since our pixels are 30 meters in size, this equates to searching in a radius of 150 meters around each point. Now sometimes you need to try several values for this input before all of your outlet points snap correctly. So just note that you may need to play with this value. All right, now hit run. As with other tools that process hydrology layers, delineated can take a while to run. So feel free to pause this video until yours is finished. Once the tool is finished, let's click the open workspace button. In this output folder, the first three rasters are related to hydrology processing. So the filled DEM, the flow accumulation map, and flow direction. The next output is pre-processed geometries, which is in g-package format. This is a set of outlet geometries that the model found to be valid. And we're going to look at the rest of the outputs in the GIS. Since our GIS still doesn't have very good support for g-package format, we can't just drag and drop those in, but we can drag in streams underscore DEM.tiff. So let's do that. As usual, when we're zoomed out like this, the streams look very choppy. But if we zoom in, we can see that they're actually continuous, right? And that's good. If they were not continuous, then we would need to do work on our DEM. And there are separate video tutorials that cover working with the DEM and creating streams. So please see those for more information. Now, in order to view the g-package results, we'll need to click on the Add Data button. Navigate to the location of your delineated workspace. And then double-click on snapped-outlets-dem.g-package. Inside of there, there's just one layer. So we'll single-click on the entry main dot snapped-outlets-dem and click Add. And then we're going to do the same for the watershed results. Click Add Data. And then go to watersheds underscore DEM dot g-package and double-click on that. And then single-click on main watershed-dem and click Add. All right, let's change the symbology of the watershed layer so that we can see the streams underneath. All right, so let's set the fill color to no color and then change the outline color to something that you can see easily. I'm going to choose a bright blue. Now, once we're zoomed out to this watershed layer, we can see what it looks like. The tool created a rather large basin that looks reasonable to me based on the stream network. If you happen to know what the basin should look like, you can critique the watershed that the tool creates and either adjust some of the input parameters to get a better fit, or it may be that you need to use a different DEM because this one doesn't represent your hydrology very well. But for now, we're going to call this watershed good. All right, let's zoom way in to look at the snapped outlet point down here at the bottom of the watershed. All right, I'm going to change the symbology again so we can see it better. Let's make it a little bit bigger and I'm going to make it orange. Okay, so if we zoom way in here, we can notice that the original point here in yellow was very close to but not right on top of the streams generated by delineated. But the snapped outlet here in orange is right on the stream, so a good watershed could be created. Now for homework, I suggest that you rerun delineated without snapping the original DEM point location. That way you can see the small, strange looking watershed that's often created when the outlets and streams don't overlap. So that's your homework, rerun delineated without snapping the outlet point and look at the difference. Now that we've created the watershed that we'll use as input to the model, we'll generally want to use it to clip our other spatial inputs to the same area of interest. What I usually do is clip the DEM using the same watershed polygon. Then I create a new polygon with a small buffer around the watershed, which I use to clip the other spatial inputs. This is especially important if any of your other spatial inputs are coarse in resolution. This is often the case with climate data, for example. So let's look at a globally available reference evapotranspiration layer from CGIAR. Let's go back to our file explorer window and go into the folder called ET0 CGIAR. I've provided just one of the raw data sets from CGIAR, which represents reference evapotranspiration for the month of January. This raster could be used as input to the seasonal water yield model or urban cooling model. Let's bring this layer into the GIS. So we're going to bring in ET0 V301.tif. Right, and I'm going to zoom back to the extent of our watershed. The resolution of this raster is 30 arc seconds, which is approximately one kilometer at the equator. This is much coarser than the 30 meter resolution of our DEM. So let's see what happens when we clip the ET0 raster using the watershed that we just generated. In our toolbox, open spatial analyst tools and then extraction, and then open the tool extract by mask. Our input raster is the ET0 layer, so let's drag that in. And our feature mask data is going to be our watershed, so we'll drag that in. For output raster, let's navigate again to the folder where we want to save the output data. I'm just going to put it right here in my working folder and I'm going to call it ET0 underscore 01 underscore clip.tif. The 01 indicates that it's data for the month of January. So let's click OK, and that should run really fast. Now let's zoom in to the area around the edge of the watershed. It doesn't really matter where you zoom in, you'll probably see the same thing. Now since the pixel size for the ET0 layer is very large, when it is clipped, we end up with a lot of missing data here along the edge of the watershed. And this is a problem for the model because we want to include all of the area within the watershed so that we capture all of the hydrology correctly. So by comparison, let's do the same thing and clip the DEM layer to the watershed polygon and see how it looks. So let's open extract by mask again. And this time for the input raster, let's bring in the DEM. For the feature mask data, we'll bring in the watersheds. And then for our output raster, I'm going to call it DEM underscore clip.tif. And then click OK. Let's give the DEM a new color so we can see it a little bit better compared with the other layers. You can choose whatever you want. I'm going to choose this purple one just because it's there. So if we turn on and off the DEM layer, you can see how the DEM really fills around the edge of the watershed. This isn't surprising since the watershed was created from the DEM, right? So then if we turn off the DEM, we can see a comparison of how the ET zero layer does not fill all the edges of the watershed. There are a lot of gaps along the edge where there is DEM data, but there's no ET zero data. OK, if I put the DEM underneath, you can really see how the DEM fills in those gaps. This is why we need to create a buffer around the watershed. And we can use that to clip our course input rasters in order to fill in these gaps. So let's do that. In our toolbox, let's go up to analysis tools, then proximity, and let's launch the buffer tool for input features. Let's give it our watershed layer for output feature class. Let's call the file watershed underscore two kilometer buffer.shp, right? I'm going to call it this because I'm going to give the watershed a two kilometer buffer, easy enough. Now, for distance, we'll specify a linear unit of two kilometers. Now, I usually make the buffer size equal to one or two times the largest pixel size of my input layers. In this case, the ET zero layer has a pixel size of one kilometer. So I'm going to specify a buffer size of two kilometers. Right, for side type, we're going to leave it as full. And this will produce a polygon that contains both the original watershed polygon and the two kilometer buffer, which is what we want. And we'll leave the rest of the inputs as default. You can play with them on your own if you like. All right, let's click OK to run the tool. And again, let's change the symbology to see things better. And I'm going to give a fill of no color. And I'm going to give an outline color. That is different than the original watershed. And when we do that, you can see this large buffer that's been created around the edge. So now we can reclip the ET zero layer with this buffered watershed. So let's go back down to spatial analyst tools, extraction, and then extract by mask. The input raster is going to be the original layer. ET zero V three zero one dot TIF. And then for our feature mask data, we're going to use the buffered watershed that we just created for output raster. We will go to our output folder and name the result ET zero underscore oh one underscore clip. Underscore buffer dot TIF and then hit OK. Now if we look closely at the edge of the original watershed, which is shown in blue on my screen, we see that the ET zero layer now completely fills it. There are no gaps of missing data around the edge. And that's what we want. Now remember that you still need to re project this layer to match the projected coordinate system of the other layers before it can be used in the models, but we won't do that now. Now when you enter data into the hydrology model, you will provide the DEM that is clipped to the original watershed layer, not the buffered watershed. And then we'll provide the coarser layers like ET zero that are clipped to the buffered watershed so that they are able to fill in all of the watershed boundaries. And don't worry that this ET zero layer is now larger than our DEM and larger than the watershed. The model will only do calculations where all of our input layers have data. So the results should only cover the extent of the DEM, which covers the extent of the watershed and that is hydrologically complete. OK, that's enough for this session. We've now covered all of the major steps in creating hydrology inputs to invest models. We've processed the DEM, evaluated the stream network, and now we've created the watershed that will be our area of interest. If you have any questions or comments about this episode, we'd love to hear from you on our community forum. There's a link to the forum in this video's webpage where you can search for previous posts and create a new post under the category of training. I and other techies at NACAP will see your posts and will respond as soon as we can. Thanks for following along.