QGIS Plugins – Point Sampling Tool

Previous posts in this series

QGIS Plugin – RasterCalc
QGIS Plugin – OpenLayers

Point Sampling Tool

I have recently been working on a project that has required the extraction of information from a raster layer based on point positions in a vector layer. I’m not a big user of vector data, but I suspect this problem comes up from time to time. In my investigation of how to solve this, I found a great QGIS plugin, the Point Sampling Tool. The Point Sampling Tool allows you to easily extract values from a raster layer based on a vector point layer. In my case, I had data points collected over a lake and I wanted to extract the raster data from an optical layer. Here is a quick look at my project.

Screen shot 2013-01-20 at 1.20.19 PM

You can see there is a small lake, with point data irregularly spaced around it.

Screen shot 2013-01-20 at 1.32.36 PM

Now, open the Point Sampling Tool and you get the following dialog.

Screen shot 2013-01-20 at 1.34.58 PM

Select the point and raster layers and then select your output layer. In this case, I exported the point values to PST.shp. Looking at the attributes table for PST.shp, we can see the values from the raster band. However, it is just the values from the raster band.

Screen shot 2013-01-20 at 1.36.04 PM

The last step we need to do is merge the new point layer with the original point layer. It would be nice if the original attributes were carried into the new layer, but this is easy enough to do in QGIS. Under Vector->”Data Management Tools”->”Joint attributes by location”

Screen shot 2013-01-20 at 2.00.05 PM

After merging the layers, we now have a final layer with all the attributes from the original point layer, plus the values from our raster layer.

Screen shot 2013-01-20 at 1.54.32 PM

You can get more information about the Point Sampling Tool and links for downloading HERE.

That’s it. I hope this is useful in your work. As always, thanks for reading.

Previous posts in this series

QGIS Plugin – RasterCalc
QGIS Plugin – OpenLayers

0 0 votes
Article Rating
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments