I am new to QGIS and I have a simple question.

How can I get the pixel value at a given latitude and longitude coordinate in a satellite raster image?

Related to this, I cannot see the latitude and longitude coordinates anywhere. Instead I see at the bottom some x,y coordinates with values like : 411243,2304551. I am using QGIS 2.01 (last vewrsion) and the image is a Landsat 7 ETM+ in geotiff format.

Many thanks


You can use gdallocationinfo. Example:

$ gdallocationinfo utm.tif 256 256
  Location: (256P,256L)
  Band 1:
    Value: 115

You can go to Plugins->Manage and Install Plugins , then click "Get More" and find the "Point Sampling Tool", then you just press Install.

This tool takes a layer of points (which will be your coordinates), and a layer (either raster or vector) and gets the values from the layer for each of the points (I think it stores them in the attribute table).

As to your coordinates - it sounds like your data is projected. If you want lat-lng then just right click on the layer in the "Layers list", go to "Save As", and set the Coordinate Reference System to a geographic one (probably WGS84) by clicking on the "Change" button on the CRS line. This should save you a copy that uses lat-lng coordinates like you want. If you close your old layer and open your new one it should be fine. If not, right click on the layer again and click "Set Project CRS from layer".

Is that what you need?


Thank you, with your comments I found a solution. I clicked in "Set Project CRS from layer" and that was enough to see the lat, lon coordinates. To know the pixel value I just do zoom on the image, find the coordinates I want select the tool "identify spatial objects" in the upper tool bar and click over the pixel. There's also a plugin to know the pixel value named Value Tool.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.