Main Content

geointerp

Geographic raster interpolation

Description

example

Vq = geointerp(V,R,latq,lonq) interpolates the geographically referenced raster V, using bilinear interpolation. The function returns a value in Vq for each of the query points in arrays latq and lonq. R is a geographic raster reference object that specifies the location and extent of data in V.

Vq = geointerp(___,method) specifies alternate interpolation methods.

Examples

collapse all

Load elevation raster data and a geographic cells reference object.

load topo60c

Specify the latitude and longitude values you want to interpolate. Then, interpolate the values.

latq = [-40 -20 20 40];
lonq = [42 54 38 62];
Vq = geointerp(topo60c,topo60cR,latq,lonq)
Vq = 1×4
103 ×

   -2.8327   -4.3855   -0.7125    0.1700

Input Arguments

collapse all

Georeferenced raster grid, specified as numeric or logical array.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical

Geographic raster, specified as a GeographicCellsReference or GeographicPostingsReference object.

To convert a referencing matrix to a geographic raster reference object, use refmatToGeoRasterReference.To convert a referencing vector to a geographic raster reference object, use refvecToGeoRasterReference.

Latitude of query point coordinates, specified as a numeric array.

Data Types: single | double

Longitude of query point coordinates, specified as a numeric array.

Data Types: single | double

Interpolation methods, specified as one of the following values.

MethodDescription
'nearest'Nearest neighbor interpolation
'linear'Bilinear interpolation
'cubic'Bicubic interpolation
'spline'Spline interpolation

Data Types: char | string

Output Arguments

collapse all

Interpolated values, returned as a numeric array.

Introduced in R2017a