Skip to Main Content Skip to Search
Product Documentation

pix2latlon - Convert pixel coordinates to latitude-longitude coordinates

Syntax

[lat, lon] = pix2latlon(R,row,col)

Description

[lat, lon] = pix2latlon(R,row,col) calculates latitude-longitude coordinates lat, lon from pixel coordinates row, col. R is either a 3-by-2 referencing matrix that transforms intrinsic pixel coordinates to geographic coordinates, or a spatialref.GeoRasterReference object. row and col are vectors or arrays of matching size. The outputs lat and lon have the same size as row and col.

Examples

Find the latitude and longitude of the upper left outer corner of a 2-by-2 degree gridded data set.

R = makerefmat(1, 89, 2, 2);
[UL_lat, UL_lon] = pix2latlon(R, .5, .5)

The output appears as follows:

UL_lat =
    88
UL_lon =
     0

Find the latitude and longitude of the lower right outer corner of a 2-by-2 degree gridded data set.

[LR_lat, LR_lon] = pix2latlon(R, 90.5, 180.5)

The output appears as follows:

LR_lat =
   268
LR_lon =
   360

See Also

latlon2pix | makerefmat | pix2map

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS