Extract data grid values for specified locations
val = ltln2val(Z, R, lat, lon)
val = ltln2val(Z, R, lat, lon, method)
val = ltln2val(Z, R, lat, lon) interpolates
a regular data grid
Z with referencing vector
the points specified by vectors of latitude and longitude,
be a geographic raster reference object, a referencing vector, or
a referencing matrix.
R is a geographic raster reference object,
RasterSize property must be consistent with
R is a referencing vector, it must be
a 1-by-3 with elements:
[cells/degree northern_latitude_limit western_longitude_limit]
R is a referencing matrix, it must be
3-by-2 and transform raster row and column indices to or from geographic
coordinates according to:
[lon lat] = [row col 1] * R
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.
Nearest-neighbor interpolation is used by default. NaN is returned
for points outside the grid limits or for which
NaN. All angles are in units of degrees.
val = ltln2val(Z, R, lat, lon, method) accepts
method string to specify the type of interpolation:
'bicubic' for cubic interpolation,
'nearest' for nearest neighbor interpolation.
Find the elevations in
topo associated with
three European cities—Milan, Bern, and Prague (
are in meters):
load topo % The city locations, [Milan Bern Prague] lats = [45.45; 46.95; 50.1]; longs = [9.2; 7.4; 14.45]; elevations = ltln2val(topo,topolegend,lats,longs) elevations = 313 1660 297