Pixel Value according to location
古いコメントを表示
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 件のコメント
Walter Roberson
2017 年 11 月 28 日
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
2017 年 11 月 29 日
IF you have geotiff file in hand..it means you have all the information in hand...what problem you are facing?
Mariam Salem
2017 年 11 月 29 日
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Images についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!