 Hello, I'm Stacey, I'm a GIS analyst with a natural capital project, and I'm glad that you've joined me to learn some techniques for working with the geo spatial data that is used by the invest ecosystem services modeling toolkit. A reminder that this series is not an introduction to GIS in general, nor is it an introduction to GIS software, but it does cover specific topics that are useful for working with invest models. This episode provides an introduction to working with biophysical tables. 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 QGIS, and we'll be working with some sample data. The web page for this video provides a link to the sample data that we'll be using. So if you haven't already, now is a good time to pause this video, download the sample data, unzip it, and bring up a QGIS session before continuing. In this episode, we're looking at the biophysical table that most invest models require, and specifically how it relates to a land use and land cover map. Many invest models use a land use and land cover map. So we will focus on that for this tutorial. The models that don't use land use have an equivalent input such as habitat, which is also mapped to a table of parameter values and the same principles will apply. Here's a list of just a few of the invest models that have biophysical tables linked to a land use map. There are others as well, like the rest of the freshwater models that aren't listed here. You can see that this covers a range of services, even blue carbon, and these land use parameters are very important for modeling. So it's important to understand how to create these tables to work well with the spatial data that they are mapped to. Now let's go to our GIS and start by looking at the land cover map. If you don't already have the sample data in your GIS session, let's navigate to the sample data folder called biophysical table data QGIS and drag in the layer, LULCESANapal.tif. The first thing we need to do is determine which land cover classes are in our land cover map. Unfortunately, QGIS does not yet support raster attribute tables, so we can't look at the attribute table directly, and we'll have to do some workarounds. So let's right click on the land cover layer and select properties and then symbology. Under render type, we can choose palleted slash unique values. And then underneath this big white window we click the classify button. This will create a list of all of the unique integer values in the land cover raster. Each of these integer values corresponds to a particular land cover type like forest, agriculture, or urban. Now if you worked through the symbology tutorial in QGIS, you may have the land cover classes labeled with their descriptions in the symbology table. If you didn't do the symbology tutorial, you won't, you will only see the integer ID values and that's okay. The main thing we need to do here is know how to find the integer values contained in our land cover raster. And we can see that there are quite a few of them ranging from values 10 up to value 220. So whatever your symbology is, it's probably be different than mine, click OK to apply the symbology. Now if we click on the arrow next to the land use layer, we'll see a list of all of the land use codes in the raster. The way the model works is to do a table join between this land cover raster and the biophysical table, based on the values that you see here. And then it assigns values from the biophysical table to the raster's land use classes, so they can use those values and subsequent modeling calculations. Because of this, every one of these integer values must have an entry in the model's biophysical table or the model will produce an error. So let's see how to create the biophysical table to include everything that you need. For example, the European Space Agency provides a table that contains codes and descriptions for all of their land cover types. So we can use that as the basis for our biophysical table. Now personally, I find it much easier to edit tables in Excel rather than within a GIS. So let's go to the sample data folder, which is biophysical table data QGIS, and open the file, LULCESALegend.csv. Now I'm going to open it in Excel, but you may use a different spreadsheet program if you prefer, we won't be doing anything complicated, and it should be easy to follow along. In order to use this table in an invest model, we must make sure that this table has all of the columns that are required for the model. The Invest User Guide describes the requirements for each model. So let's do an example using the sediment or SDR model and open its user guide page. On this video's webpage, you will see a link that goes directly to the SDR data needs section of the user guide. You can click on that link. Each model's chapter of the user guide has a data needs section. This describes all of the inputs for the model, what format is required, and what their units are, as well as any special formatting or naming conventions. When using a new model, it is critical to consult the data needs section to understand what is required. We also provide sample data for each model, and that gives you an example and a template for formatting your own data. And I highly recommend also using those when you're learning a new model. Right now we're going to keep it simple and just use the user guide. If you need section for SDR, let's read the land use and land cover entry. The description here emphasizes that all values in this raster must have corresponding entries in the biophysical table. So next, let's see what's required in the biophysical table for SDR. The physical table entry says that the format of the table is .csv and again emphasizes that all LULC classes in the LULC raster must have corresponding values in this table. Now each row in the table corresponds to one land cover class, and there are three required columns. The first required column is LULC. This is the column that contains all of the unique integer land cover class values that are in your land cover raster. So these correspond to the value column in the raster, and they correspond to those values that we saw in the symbology table. So here's a reminder that the land cover raster will be joined to the biophysical table using this LULC column. The other two required columns are USLEC and USLEP. And these are both floating point values between zero and one. Without going into any detail about the SDR model, these are sediment related factors that are assigned to each land cover class. The US model will have its own specific parameters that are required. These two are just for SDR. So now we know that the table must have three columns, and they must be named LULC, USLEC, and USLEP. Your table may have additional columns, but Invest will just ignore them. Now that we know that, let's go back to our sample data in Excel. In this ESA table, the column NB underscore LAB contains the land use codes, and this corresponds to the LULC column for Invest. So we can simply change the name of this column from NB lab to LULC. So let's do that. One thing to note at this point is that if this kind of table is not available from your data provider, you will need to populate the biophysical table with land use codes and descriptions on your own, based on whatever documentation is provided, as well as the list of land use codes that you see in the raster symbology table. So there will be a lot more manual work if you don't have this information provided in a table like ESA has. Right now, actually, let's compare the list of land use codes in the table with a list of codes in the QGIS symbology table. So let's go side by side to check that all of the values in the raster are also in the CSV table. It looks like there are actually more entries in the ESA table than appear in the Nepal raster. This is because the ESA table contains all of the land use codes used over the whole world, and not all of them will apply in Nepal. So let's take a moment now to delete the entries in the CSV table that do not appear in the raster symbology table. Now that we've done that, we must add two new columns to the biophysical table. USLEC contains these extra entries, but we certainly don't want to spend time doing a literature search for values that aren't in our study area, and if the table doesn't match the raster, it gets confusing to work with. So we must add two new columns to the biophysical table. USLEC and USLEP. So I will add USLE underscore C and USLE underscore P. For the model to run successfully, every row in this table must have a valid value for both USLEC and USLEP. Right now, we're not concerned about the values themselves, just the formatting of the table. As the user guide said, the values must be floating point and between zero and one. So for now, for this example, let's assign a value of 0.5 to all of the rows for USLEC and assign a value of one for all of the rows for USLEP. I want to emphasize that these values are not what you would use in an actual analysis. They are only for the purposes of this tutorial. When you're doing your own analysis, you will be doing a literature search to find the best value for each individual land cover class in your study area. This can be and usually is a very time consuming process, but it's also very important since the models are typically quite sensitive to the parameters in this biophysical table. Now let's make sure that we're saving this table in the format required for invest. We can click on file and then save as now I am going to put this in the same folder that the sample data is in biophysical table data QGIS you may need to navigate somewhere else on your computer. I'm going to name this file biophysical table underscore Nepal. CSV. Now underneath the file name, if your screen is like mine. Excel will already show it as being of type CSV comma delimited. And this is correct. This is exactly the right, the right format that we want. That's not the same for you. You can find this option in the drop down list. If we click on the drop down list, you see that there are several other CSV types, but we don't want any of those. The one that we want is CSV comma delimited. It's possible that some of those other CSV file types might cause problems with invest. So again, we're going to choose CSV comma delimited for our file type. All right now click the save button. So this table that we created should work fine in invest, but what if it doesn't. It's very common to get errors that are related to biophysical tables. So let's look at some of them and how to troubleshoot them. These common errors happen because there are integer values in the land cover raster that are not included in the biophysical table. The model will determine this while it is running, and you'll get an error message like you see here. An error is very helpful in telling you what went wrong. In this example, invest found that the values 1020 and 40 are present in the land cover raster, but they are not present in the biophysical table. So if you get an error like that, you'll need to edit your biophysical table to add entries for values 1020 and 40, and then try running the model again. The biophysical table is missing a required field like LU code or US LEP invest will give an error when you enter the table into the user interface. If this happens, you will see red X's next to the biophysical table entry, as well as in the red button, like you see in the screen here. When you click on the red X, there is a message that will tell you which required field is missing. So if you get this error, you'll need to go back and edit the biophysical table to add this field and then populate it with values for every land cover class, then try running the model again. Okay, that's enough for this session. You might want to save your QGIS session so you can keep using it for later episodes. 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 post and respond as soon as we can. Thanks for following along.