How can I use the Mapping Toolbox 2.7.2 (R2009a) to map a specific region of pixels to lat-lon coordinates?
조회 수: 4 (최근 30일)
이전 댓글 표시
MathWorks Support Team
2013년 10월 7일
답변: MathWorks Support Team
2013년 10월 7일
I am using a GeoTIFF file, and I would like to know how to do the necessary projections to allow me to map pixels to latitude-longitude coordinates.
채택된 답변
MathWorks Support Team
2013년 10월 7일
You can relate image rows and columns to latitude-longitude (if the GeoTIFF file is referenced to a geographic coordinate system) or to map X-Y coordinates (if the GeoTIFF is referenced to a projected coordinate system). First call GEOTIFFINFO and examine the INFO structure that it returns. Examine the 'ModelType' field to see what kind of system the image is in. Then you can use the 3-by-2 referencing matrix in the 'RefMatrix' field of the INFO structure to map X-Y or latitude-longitude limits to column and row limits. See functions MAP2PIX and LATLON2PIX.
If it turns out that the image is in a projected coordinate system but you have limits that are specified as a latitude-longitude quadrangle, you can pass the INFO structure to the PROJFWD function, along with latitudes and longitudes defining the corner points of the quadrangle. It will return those corner points in map X-Y, which you can pass on into MAP2PIX.
Note that MAP2PIX and LATLON2PIX may return row/column values that are less than 1 or that exceed the number or columns or rows in the image. In this case you can clamp them before calling IMREAD.
As a final step, work with PIX2MAP or PIX2LATLON in combination with MAKEREFMAT, to create a referencing matrix that is appropriate to the sub image returned by IMREAD.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Geographic Coordinate Reference Systems에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!