Main Content

setltln

(Removed) Convert data grid rows and columns to latitude-longitude

The setltln function has been removed. Use the intrinsicToGeographic function instead. For more information, see Version History.

Syntax

[lat, lon] = setltln(Z, R, row, col)
[lat, lon, indxPointOutsideGrid] = setltln(Z, R, row, col)
latlon = setltln(Z, R, row, col)

Description

[lat, lon] = setltln(Z, R, row, col) returns the latitude and longitudes associated with the input row and column coordinates of the regular data grid Z. R can be a geographic raster reference object, a referencing vector, or a referencing matrix.

If R is a geographic raster reference object, its RasterSize property must be consistent with size(Z).

If R is a referencing vector, it must be 1-by-3 with elements:

[cells/degree northern_latitude_limit western_longitude_limit]
If R is a referencing matrix, it must be 3-by-2 and transform raster row and column indices to/from geographic coordinates according to:
[lon lat] = [row col 1] * R
If R is a referencing matrix, it must define a (non-rotational, non-skewed) relationship in which each column of the data grid falls along a meridian and each row falls along a parallel. Points falling outside the grid are ignored in row and col. All input angles are in degrees.

[lat, lon, indxPointOutsideGrid] = setltln(Z, R, row, col) returns the indices of the elements of the row and col vectors that lie outside the input grid. The outputs lat and lon always ignore these points; the third output accounts for them.

latlon = setltln(Z, R, row, col) returns the coordinates in a single two-column matrix of the form [latitude longitude].

Examples

Load elevation raster data and a geographic cells reference object. Then, find the coordinates of row 45 and column 65.

load topo60c
[lat,lon,indxPointOutsideGrid] = setltln(topo60c,topo60cR,45,65)
lat =

  -45.5000


lon =

   64.5000


indxPointOutsideGrid =

     []

The third output argument is empty because the point is valid.

Version History

Introduced before R2006a

expand all