 Hello, welcome back on my YouTube channel. In today's video I'm going to show how to interpolate points to a raster using the t-cent polygon or nearest neighbor method. There are other videos explaining that but here I'm going to specifically address how to control the spatial resolution and the extent of the output, which is not a standard option in the interface. Let's first open the processing toolbox and we search for interpolation and I'm going to first look at how the extent is defined in the idw interpolation. On the idw interpolation tool you can specify the attribute that you want to interpolate but you can also specify the extent and if I want to use the canvas extent I use this drop down and I choose use canvas extent and for this purpose I'm going to also use the canvas extent for the t-cent polygon so I'm copying this. You can also see that here you can control the pixel size nicely integrated in the dialogue for nearest neighbor or t-cent that is not the case. Let's now have a look at the grid nearest neighbor tool which we use for the t-cent polygon interpolation. We can identify the layer that we want to interpolate and under advanced parameters we need to indicate the field from the attribute table that is used for the interpolation but as you see there is no way to indicate the extent and resolution of the output but we do see here at the bottom that it executes the gdal grid command. You can find these gdal commands on the website gdal.org under the programs you find gdal grid with all the options that you can add and here we see that we can specify the geo-referenced x and y extents of the output file and the spatial resolution of the output file so we can type those additional command line parameters here so we use the dash txe for the coordinates of the x and I'm just pasting here the extents that I copied from the idw tool which is the extent of the map canvas and I need to remove the commas that they become spaces and add the dash tye before the y coordinates and then for the spatial resolution I use dash tr and then I specify the x and the y resolution in the map units so I could do 100 meters or I can do 50 meters then you can specify an output file name here I just generate a temporary file and it now executes the gdal grid command which then results in the interpolation for the specified map extent with the specified spatial resolution if you don't want to type these commands there's another way to do this using the pc raster tools plugin and a tool that is available as a model in the qgis resource sharing repository let's install the pc raster tools plugin remember that for using the pc raster tools plugin you also need to install pc raster itself because it's a processing provider tool if you click there on homepage you see how to install it or you can watch videos on this channel to find out how it works on your operating system I'm also going to install the qgis resource sharing plugin which enables us to connect to repositories with scripts and models so I click on this button and then I go to settings and there I add the repository with all kinds of pc raster tools and models you need to add dot get to the repository name otherwise it does not work so now it's added and under all collections I find there the models so form models are now installed and added to your processing toolbox and here's the user script collection never use the script collection because that is now replaced by the scripts that come with the with the plugin so here under models hydrology we find this model tson polygons and I can execute the model choose the stations and then the attribute for the points we want to interpolate the spatial resolution and I choose here the extent and then I can run it it's a bit slower than the other method because it does all kinds of conversions in the background but if you don't like to type these commands then you can use this as an interface and you can also have a look at the model and see how this processing tool was created here's the result it looks slightly different than the other result because there's another algorithm used here but it's very similar and it also does it for the specified extent and the differences in the extent is because the zoom level has been changed between using the tools I hope this was useful please subscribe to my youtube channel if you want to see updates I look forward to see you again