How do I convert latitude and longitude to rows and columns on a geotiff?

I am trying to analyze a specific region of interest (ROI) on a very large geotiff. The image is from landsat 7. I want to input the latitude and longitudes of the top left and bottom right corners of the region I am interested in. I want to then use that data to find the rows and columns that I will be averaging.
I have tried to use functions such as latlon2pix. The pixel locations did not help me (the values I received didn't make sense). The setpostn function gives me errors.
Any help would be greatly appreciated!

답변 (2개)

Chad Greene
Chad Greene 2015년 3월 16일

0 개 추천

If latlon2pix returned funny numbers, I'd guess there's something wrong with your georeferencing matrix.
If you only need a small region of a Landsat image, geoimread may be all you need.
Calvin Kielas-Jensen
Calvin Kielas-Jensen 2015년 3월 20일

0 개 추천

Thank you very much for the quick reply. I tried using that and unfortunately it does not seem to like the latitude and longitude values that I am providing. I will look through the code to see if I am missing something. This is proving to be quite a difficult problem for me.

질문:

2015년 3월 16일

답변:

2015년 3월 20일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by