Pixel Value according to location
Afficher commentaires plus anciens
Hello I have posted this question before at:
https://www.mathworks.com/matlabcentral/answers/369563-extracting-the-values-of-pixel-at-certain-points?s_tid=prof_contriblnk
I'm very lost in what I have to do, below is my question:
I have a large raster layer that has aridity values assigned to each pixel. I also have latitude and longitude data of some locations in USA. I would like to know the pixel value according to my latitude and longitude locations . I first clipped the raster to my area of interest (USA) in Arcmap the I converted my clipped raster in to a .tif file then I did the following, where i convert these pixels into lat and lon but I am having problems finishing the code. I'm not sure what to do. Or is there a different approach. Any suggestions?
I = imread('ai_yr1.tif');
info = geotiffinfo('ai_yr1.tif');
height = info.Height; % Integer indicating the height of the image in pixels
width = info.Width; % Integer indicating the width of the image in pixels
[rows,cols] = meshgrid(1:height,1:width);
[ADlat,ADlon] = pix2latlon(info.RefMatrix, rows, cols);
I unfortunately can't attach my .tif file but I have attached a picture to give an idea of what I have
Thank You!!
3 commentaires
Walter Roberson
le 28 Nov 2017
We were waiting for your file to be attached; you should merge this question with your original at https://www.mathworks.com/matlabcentral/answers/369563-extracting-the-values-of-pixel-at-certain-points
KSSV
le 29 Nov 2017
IF you have geotiff file in hand..it means you have all the information in hand...what problem you are facing?
Mariam Salem
le 29 Nov 2017
Réponses (0)
Catégories
En savoir plus sur Images dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!