 Welcome to the NPTEL course on Remote Sensing and GIS for Rural Development. This is week 9, lecture 2. In this week, we have been looking at the different classification types of LULC, how to classify and bring data together for effective mapping. In today's lecture, we will be using the skills that we have looked upon in the past lectures, especially, we will download the data and do a quick LULC classification. A very basic classification will be done in a semi-supervised fashion where data clustering will happen and some clusters will be labeled by us. So, let us go ahead with today's lecture. First, let me introduce the supervised classification stage. In the supervised classification, you will need to provide a training stage in which correct representative spectra from each user class from the image will be done. So, for example, in the image in the bottom you could see, I have taken some spectral signatures for water and the system or GIS platform will use all the water signatures that I determine as water for cluster. So, that is the training stage where I have to collect data and provide it a class name. In the second stage, we see that you have a classification stage. So, I have created the spectral signatures. I have created a signature file and the signature file will be now input to the system and the GIS software runs and classifies. So, there is a run algorithm part to assign each pixel to a user class. And the last of course is output stage where the outputs are filtered and a map with statistics is derived. So, at the bottom there is an example given of the three stages. In the first stage, you have the training data all taken together. So, this is the data from your remote sensing platforms, NASA, ISRO, Bhuvan, you download it. Once you download it, you have each pixel has a number, unique identification number. And in the second case, you have a class that you have determined, water, sand, forest, urban, corn, hay. So, each unique identification number. So, for example, this pixel is 37. So, third row and seventh column is the unique identification code for that pixel. And that pixel takes one of these classes based on the classification idea. So, in the first stage, you take the training stage, you give classes, you take spectral signatures for each class, and then you run the algorithm and the output comes. So, in the output, you have categorized set, digital numbers are replaced by the category types. So, you don't see any 37, but that will become F for forest and along the land use classification pattern. So, this is what we will be doing in an exercise in today's lecture. So, for a surprise classification, as I said, all the classes have to be given. And in the surprise classification, if you don't have all the labels, all the classes, it is a semi-surprise. In today's example, within the surprise, there is a part of classes which we won't be labeling and those are called unclassified. So, let's look at these colors. So, the first step is to download the data. We have already shown that multiple data sets are available. However, the current data set will give you a better LULC because the latest ones we have from the open source systems are 2050-2016. So, let's start processing a data for a current data set for Maharashtra region. So, you have the data download link I have given, the Earth Explorer. I hope all of you have created an account. It's free. You can download data. Pre-processing of raster image is done once the data is collected. In the pre-processing stage, you will be only using the part of data that you want. You don't need the entire type. It is too cumbersome, too much memory storage. So, you can bring it down. The cache memory will take a long time if you have large data sets. And then you prepare a training data set with classes and the class names, the labels you will be giving, and then you run the classification. So, these are the steps. Download data, pre-process the data, create a label of classes and the signature file, and then you do a classification. Before that, as I said, there are certain aspects that are needed for QGIS classification. Plugins are very good. And one of the plugins is supervised classification plugin. So, let's take it out from the list of supervised classification plugins available. The ones we will be using is the plugin coordinate capture. We will use the first plugin. So, what it does is, it helps us to create a training data set. So, it basically, you can move the mouse to a particular location and click a pixel and the lat-long, the coordinate of that pixel will come out. This you would have seen already in Google Earth where we, Google Earth Pro where we move the mouse and then the lat-long was changing on the bottom. So, here in QGIS, we are going to have it typed already and taken out. Instead of you typing it, you click it, it comes out as a clipboard, it copies for yourself and then you can use it in different coordinate reference systems. Then we will use a semi-automatic classification plugin. As I said, semi-automatic is not fully automatic. It's not unsupervised where you let it classify by itself. You give it some weightages, some labels and then the classification starts. So, there is a pre-processing stage in it, a classification stage and post-processing stage. The coordinate capture plugin is just for you to help you to extract the lat-longs for creating the training set, which is part of the pre-processing stage. So, let's go ahead. The first one is the coordinate capture. If those who do not have it already, please go to the plugins. All plugins will come 998. I've showed you how to access the plugins on the QGIS top toolbar. Go to the toolbar and then type coordinate capture, you will find it, just install it as a plugin. Some of the steps I'm going to fast forward because in a 30 minute, I want to capture most of the classification part. The second plugin is a semi-automatic classification plugin. Please look at the icon. This is what icon will come when you type semi and then the third one semi-automatic will pop up. Just click it, install the plugin and I've installed it. I've kept it ready for the class so that if any error comes, we won't waste time while recording. So, the final results will come once we show it. I have made a slide, but before that, let us start the data download process. So, what we will do is we will start with the USGS Explorer and then we will look into the data download file. So, here you would see that there is a Earth Explorer that we are going to use. We will start with the supervised classification data. So, as I said, let's go to USGS Explorer and then we will create these points of interest and then I'll show you how to download the data. So, what we will do is select the study area, random study area and then I'm just pulling the points and moving so that we can select the study area part and then when you click the data sets in the bottom, you will see that there are multiple data sets that are available, but we will take the Landsat data. In the Landsat, we have multiple Landsat classifications and collections. We will use the recent ones, 8, 9, because we want the 2022. So, we'll click it and for that particular coordinate systems that we have given, it is searching for data and all the data for that particular location area of interest is coming. So, now we're going to download the data and then all the download we want. So, product options are there, what type of products, how you want to download it. We want all the downloads, so all the bundle will be downloaded. Just you can select one or two of the bands. Right now, we haven't discussed the bands, so let's download it. So, now I've downloaded and kept it ready for QGIS. Now, I've opened my QGIS so that you could look into it and see where the plugin has happened. So, you could see that SCP plugin has come up, which is the semi-automatic plugin. And then in the browser where all the tiles are there, I am going to open my browser and download the data, all the Landsat files have come. So, LC08 2022 Landsat 8 have been downloaded for that particular area of interest. We are dragging it to the layer panel so that the map has been created. So, but we need to understand what are the bands. So, in the QGIS, you saw band 1 to band 7. So, to go back, we can go back to the Earth Explorer and see in the Earth Explorer profile what is each band. So, for example, band number 5 is near infrared, band number 4 is red, and then we have band 3 is green, etc. So, these are the wavelengths that are given and the resolutions that are given at the end. So, within the bracket, it is the wavelength range. So, we have Landsat 8, which is what we wanted, the recent land use land cover map we want to do. So, now we are ready. Each image is on top of one another. So, you will see that you have a data set and each data set is on top of each other. So, it is like a composite we are going to see. So, right now we just see one on top of the other. So, it is covering each layer. So, now let us define each of the 7 bands as a band set. We can select it from your layers or the tools, SCP tool. Let us go to the SCP tool on the top because you have installed it, it will come. Now, we are going to create one band, one band which is a composite. So, since I have the previous bands are going to come here. So, when we refresh the band on the refresh tool on the side, what will happen is all the bands are coming and populating. All the bands that are available on my QGS are now populated. The previous existing let us remove it. So, I am just going to click the remove button and remove it. So, because we work on this a lot, I have a lot of other bands remersed. So, now all the bands are being pulled in and called as band set 1 because I have imported them into the band by putting the arrow marks and import it into addition. So, now we can also move it up and down if the band needs to be moved up and down. We go back, now this minimizes, go back to your QGIS layer. So, only one location we need to do. So, what we have to do is before we make a band, I am going to come back to the band stuff again. But we do not, as I said, we do not need the entire type. We just going to do a part of the land because too much it will become slower and you are not going to do the entire band for now. So, let us do a clip. The mask tool has already been discussed in this class. Let us zoom in and select an area. I can extract using a shape file or I can give an area of interest. So, this is the built up area where we would like to look at it and extract. What we need to do is go back to SCP. In a normal scenario, you will use the raster processing tools and then you do a mask. But since SCP has a tool that can take all the rasters together, I am going to go into that. So, go to SCP tool again and then clip multiple rasters, clip, you are going to cut. As I said, the first option is you can give a shape file and then load the shape file and clip it. But we do not have it. So, we are going to do a define an area. So, we are going to define a plus sign and then you are going to draw a box. A small box you can draw which is the area of interest. So, now I have selected the area. Now, when we run this clip tool, it will only take the data. So, we are going back to the SCP tool. In the clip multiple rasters, we have selected the extent. Which bands do you want to take off? Right now band one we have prepared. So, the band set is basically creating all of them together. So, we had initially seven bands. We have clubbed it into one band as a band set. So, one band one is band set of seven bands and that is what I am giving here and I am going to click okay and run the tool. So, instead of doing each one separately where you want to save is asking. So, I am going to save it in a selected folder. So, all the bands are going to be clicked. Just wait for a couple of seconds. It is clipping on the left hand side. You will see the processing going on. Once it finished, you can see that on the screen you have another image overlapping and that is the clipped image. So, now we can remove all the original bands which are the whole of Maharashtra tiles. We can remove them. So, now we have a clipped bands. So, seven bands have been clipped using one shape that we determined. Now for doing classification, now we need to again do the banding. So, now we will go back to the SCP tool. So, stacking is basically you are bringing all the bands together, go back to band set and the previous bands would come. So, just refresh it and the new clipped bands are coming. The same on the bottom you see the older bands we can remove them. So, click the negative button on the bottom. It will go off. So, once you have select all, you can select one by one or select all and then add the plus sign all the data bands will come in. So, now all of them again we can create it as band set one. So, the previous band is gone. The band set one is gone. We have created a new band. Make sure you select the bottom two options and then run. Now we have six bands. We have run it and then we have tickled it. We will put it in as a folder called sample. So, now the band has been created. You can see that all of them are stacked together as a band set. So, I am going to remove all the clips on. But you can see that the band set has been written there. I am opening it and also we can open the RGB to change the colouring. So, raster can be symbolised or coloured using different colouring schemes. What we are going to do here is we are going to RGB and 543. Let us give a scheme which bands we are going to take. So, 5 is near-infrared, 3 is green, 4 is red. So, when we say 543, those bands are going to be coloured higher. So, you could see that the infrared is captured by or represents more the vegetated area. So, all the vegetated area will show up very well if we use 543. Let us try to use another colouring scheme 654. You could see that 654 is better for the water body. So, you can try play with all these RGB's on the top which is part of the classification tool, the SCP tool. Which ones you want to check for visualisation you can select. See, right now we are going to visualise it better so that we are going to extract training cells. Let us do the 543 again because the vegetation area of the infrared is captured well. So, all the red areas here are vegetation. So, now the combination is ready. Let us go into the creating the classes and training sample set. We are not going to do 10-15 classifications like the booban. As I said that takes a long, long time. Just for the small class we are going to create only 4-5 classes. So, look at this image. You have vegetation, you have water bodies, you have build-up area, you have other areas of interest. So, let us go through these areas. But again, if you do not know about this area, how are you going to do it? And that is where some tools that I have initially recommended as plugins will be helpful. So, first let us visualise this image and then make sure that we differentiate the colouring scheme here. What is represented as blue? What is represented as red? Etc. So, now if you can zoom into the full area and keep on zooming, you will see the image getting pixelated. Pixelated means it is no longer smooth. Every pixel you can see. Now you can place your coordinate capture tool which is on the left hand bottom. You can see here on the bottom of the video there is a tool which says the coordinate capture thing. So, please enable the start capture and then go ahead and see which ones you want to capture. First, when you click it, you will see that the coordinate is being captured in the coordinate box. As I said, you can also look at it as a start capture. Go back and then I am clicking a point on the vortex. Copy the coordinate system on it and go to Google Earth. So, now we are going to juggle between the image and the Google Earth Pro. Make sure that when you click, when you copy it on Google Earth Pro, the orientation of the lat-long is different. So, in the coordinate system A, B, in Google Earth, you have to do B, A. So, just change it. So, copy paste it, take the first part out and then put it at the back, cut it and put it at the back, and then click search. You can see that it zooms into that particular area. So, here now you have a visual proof which is going to clarify what is that location. So, in this image, you can see that that location is showing a vegetated area, an agricultural field. So, this is what we call as supervised classification where you go to the field, collect data and then come back and then classify the image. Sometimes there is no time, there is no money to go up and down in the field. So, these kinds of satellite images can be used for classifying satellite images. So, again as I said, now we can see it is a agriculture field. So, now go back to QGIS. Now we will go back to QGIS and then attest that this particular pixel that is a vegetated area. So, now we know how to take each pixel, go back and forth and then check it in Google Earth. So, that is for us to confirm. So, now we are going to go to the ACP tool and create a training set. So, in the left hand side, if the ACP tool comes out as the left hand panel, sometimes it will float on the QGIS screen. You can also dock it on the left as I have done. You can see a button in the second button called create a new training input. Click that and then we are going to extract points or shapes that are going to give you where you want to give classes and also you will have to store this classification because the GQGIS will go and access this sample naming scheme and then apply it to the all the data sets. So, you can see that let us say sample 2. So, now we have defined a training set. Now, let us now go to zoom into the map. So, zoom into the data. Let us start with the water. Each feature may be questionable because the coloring may be different as we have changed the 5, 4, 3, 6, 4, 3, etc. If you change the RGB combination, the band combination, you will have different colors. So, just to make sure you can click on the coordinate system, I will do it again. I am just going to click on the coordinate. So, you can see the coordinate on the left. I copy it, paste it in Google Earth Pro, put it upside down, switch the coordinates and then when I click okay and search after input, the Google Earth Pro will go to the location of the coordinate system. Now, you could see that it is a water body. I have also taught you that just make sure that it is not a flood. If it is a flood, then you can go back and forth and see if the water is always there. Okay. So, the water is always there. It is not a flood. It is a water body. Also, make sure that the same year is chosen. So, here, 2022, I have selected on the Google Earth Pro because my image is 2022 in QGIS. So, this is a water body. I go back to the QGIS. The shape is almost the same. Now, I know that if I extract the pixels from here, it is a good training data for water body. So, I am going to create a first training set and the first class. So, the first top is MC name is waterW. There is a main classification name. There is a sub classification name or subclass name as SC name. We do not need that because in this example, we are just going to do major classification. So, MC is given as W and then C is given as W1. Now, let us take samples which is pixels that are representing water. So, there is dark blue, light blue, all represent water. So, I am going to create a polygon. So, carefully select not too much on the boundary. The boundary is a gray line because some land image is also coming. The water image is also coming in the pixel. So, do not take that. Just take within the water body and then click over. Say water, I have clicked it and then it is added. Once you save this button, then it gets added. Make sure that as much as samples you select, the accuracy of the image is going to go higher. So, one water body is a lake. So, let us look at a river also. So, just to make sure this is a river or a road, you can go back, take the coordinate, go back and then come to the initial image. So, I am going back and then see that along the lake, it is a river. So, if you could see that I can take the coordinate system, it is moving, we can take coordinate system, but I am confident. So, I am taking this as a sample. So, I am taking a sample, I am clicking it and now it goes in. So, similarly, let us take some more, one more sample along the same river and I am selecting another one and then hit the enter for the third sample. So, slowly, slowly it gets loaded, the toolbar is showing the loading. So, just for water, we have three already. Now, we are going to let us do the agricultural area. Agriculture is different. So, because there will be growing crops, mature crops, initial crops. So, I am just going to go to one area and then we will look into the pixels. I know that along the river bodies it is agriculture. So, first let me create the class name. So, it is agriculture, I have created a click and then we have A1, so, which is the agriculture one. And then zooming in, I am zooming into the red areas because the infrared is going to show the agriculture. Any questions, any doubts on this land, you can always use the coordinate system, coordinate capture, go to Google Earth Pro, check the land and come back. So, if you miss typing, just click the left click, the buttons, your new area can be drawn. So, now you are drawing the new area and then the class IDs are given, I add it. So, now it is slowly going to go into the semi-SCP tool and then you see on the bottom, it is going to show as agriculture. So, agriculture is created, A1 is created. Similarly, we are going to create some more A1s. A1 is a subclassification, as I said. If you are doing it very, very carefully, you can actually do a growing A1, mature A2 like that. So, right now we are just going to take some more samples in the agricultural area, click, add, add it in. So, a lot of different red colors you can see, mature red and then light red, all of them are related to agriculture. So, let us take as much samples as we can. So, here we are taking another red color, a parcel of red colors. One I have taken around the water, but you can see that not on the boundary I am taking, some pixels away from the boundary because maybe on the boundary there was a water, the plants are not growing well, too much suffocation. So, let us take some outside. So, we have diverse regions we have taken samples and then we are adding all the red colors. I have checked the image, so I know that the image is all agriculture, but you have to go back and forth between Google Earth Pro and then select. So, now we have selected around four or five data for the crops. Now, let us finish the agricultural area and let us go to the next class soon. So, I will just finish off some more and then let us go to the agricultural area, we have selected samples. Now, let us go to the built up area. As I said in the Google Earth Pro, you can see that there is around the lake area, there is a lot of built up area and that built up area is coming here. So, the coordinate system capture we have used. So, all the blue light blues are built up area. So, let us type a new class, class 3 ID 3 and then 3 you have put and then let us type urban and then we will type it as U1 and then it is classes 3 and then go and do the add. So, zoom in as much as possible and then check all the colors. You look at it, I am selecting mostly the blue colors which are representing. The black could be roads or non built up areas, so let us not take that or barren land. So, let us take some more samples for urban area, urban built up area. Make sure you have enough samples. So, slowly I am taking different shades of blue. In my image blue represents the classification of built up area. So, we have 3 urban now, let us take some more, 4. I am adding it. You can see that you can also cancel in between if it is not correct. So, we have 3 classes now. You can spend as much as much time and add more colors, more signature files, it will become more accurate. So, we have enough for 3 and then open spaces also I have selected. Open areas are areas without any agriculture, water or built up area. So, we are going to have open areas also. Now you could see that the water, agriculture and urban have different colors which are automatic colors, but we know that we want to see something logical, which means blue for water is logical, brown or red for urban built up is logical, agriculture is green. So, let us change the colors. So, click agriculture, the color scheme will come. Put okay for green, just take green, just put your mouse on a green color. Same urban, let us take orange color or red color as I always use, then we will use it. Open space we can keep yellow and then we will say okay. So, we have given a color scheme. So, what we have done so far is we have taken spectral signatures, not only one sample, we have taken multiple sample for each class. First we define class, we say okay for the time being we are going to only have water, agriculture, urban and open space, four classes and then one more it will add the system will add by itself which is unclassified. So, some colors which are not given will be unclassified. So, now you are going to have five classes of which four we define. Each class we gave some examples by taking pixels and then mapping it to the system. Now, we are going to give colors to the classes. So, all of them will become blue and we are going to we are ready to run it. So, now go back to SCP, come back down to the down it is minimized which is going to the SCP tool and then go to classification tool. Here it lasts which band you want to classify bad one because we already made a band set band set as one. So, keep one. So, only the main classes we have. So, just say MC you can click you do not have a C we did not give the sub classification as C values we did not give. So, let us click the MC values and then classification report is good for error analysis. So, you can just click maximum likelihood is one of the best performance. So, just click the maximum likelihood algorithms. There are multiple algorithms available but select the maximum likelihood because it has been used widely across in literature. So, now you click run it will run and ask you where you want to save the file as a tiff file or you can also change the file type if you want. Let us say we will see 2022 in house running it is some for some systems it will take more time I will cut the because of the time I am going to you know fast forward that part and now yes the system has run it the classification is complete. Here you could see that only less number of classes are given because not all are water agriculture urban. So, you will see some classes but more importantly you could see that the pixels have been extracted based on your preference of what is water and all those have been cluster. So, that is clustering the second objective of classification and the cluster is given a name and a color which is water water and blue. So, for agriculture is green and and then for urban it is red and then yellow for open space. But you can see that it is not as accurate as the Google approach but let us look at the classification report it will be generated in your report folder where you had stored it. So, now we have completed it just for the class I have done a very very small amount of classifications and sizes and quickly we have done within 20 minutes but if you are very patient and click accurately the pixels which I have done already I will share you the report and the image now. So, this is how the image looks like if you take a very very slow approach click each pixel and then make sure that you have enough classes. Here you can see that you have enough classes unclassified black water and agriculture open space and urban you can see it matches with the Google Earth Pro that we have taken. So, beautifully these two images are matching because we have spent more time on each different colors of pixel in the previous image I will go back and show just for sake of it. You can see that all this was taken as red and we know that urban area is not that big because we did not take green color from those areas and the brown little bit brown was enough for the system to say it was all urban. So, what we have done is we have now gone back and forth and did a very very accurate classification which is here and then that has given better results even the report vouchers the same you can see that the report says that the classification report says the water is this much area agriculture open space urban area and total area is 42 square kilometers 42.9 you can estimate the boundary that you drew initially while downloading the data it will be the same. So, percentage of total areas also coming to is 100 percent. So, in the error class if you do not have a particular class and the pixel is not represented then the total 100 percent will not come it will be like 80 percent which means 20 percent of the land you are not mapping. So, with this yes today's lecture went a little bit overtime because we did a hands on on landage land classification I will see you in the next class. Thank you.