Raster Data

Georeference, analyze and transform gridded data

Raster data, also known as data grids, stores map data as matrices. Regular data grids require a referencing object, vector, or matrix that describes the sampling and location of the data points. Geolocated data grids explicitly identify the latitude and longitude coordinates of all rows and columns.


georefcellsReference raster cells to geographic coordinates
georefpostingsReference raster postings to geographic coordinates
refmatToGeoRasterReferenceReferencing matrix to geographic raster reference object
refvecToGeoRasterReferenceReferencing vector to geographic raster reference object
makerefmatConstruct affine spatial-referencing matrix
georesizeResize geographic raster
geointerpGeographic raster interpolation
latlon2pixConvert latitude-longitude coordinates to pixel coordinates
pix2latlonConvert pixel coordinates to latitude-longitude coordinates
setpostnConvert latitude-longitude to data grid rows and columns
setltlnConvert data grid rows and columns to latitude-longitude
limitmDetermine latitude and longitude limits of regular data grid
filtermFilter latitudes and longitudes based on underlying data grid
findmLatitudes and longitudes of nonzero data grid elements
geocontourxyContour grid in local system with latitude-longitude results
geoloc2gridConvert geolocated data array to regular data grid
ltln2valExtract data grid values for specified locations
changemSubstitute values in data array
imbedmEncode data points into regular data grid
encodemFill in regular data grid from seed values and locations
meshgratConstruct map graticule for surface object display
geopeaksGenerate synthetic data set on sphere
maprefcellsReference raster cells to map coordinates
maprefpostingsReference raster postings to map coordinates
refmatToMapRasterReferenceReferencing matrix to map raster reference object
mapresizeResize projected raster
mapinterpMap raster interpolation
map2pixConvert map coordinates to pixel coordinates
pix2mapConvert pixel coordinates to map coordinates
pixcentersCompute pixel centers for georeferenced image or data grid
mapoutlineCompute outline of georeferenced image or data grid
mapbboxCompute bounding box of georeferenced image or data grid
georasterrefConstruct geographic raster reference object
maprasterrefConstruct map raster reference object
refmatToWorldFileMatrixConvert referencing matrix to world file matrix
worldFileMatrixToRefmatConvert world file matrix to referencing matrix


GeographicCellsReferenceReference raster cells to geographic coordinates
GeographicPostingsReferenceReference raster postings to geographic coordinates
MapCellsReference Reference raster cells to map coordinates
MapPostingsReference Reference raster postings to map coordinates


Introduction to Geodata in Raster Format

Raster Geodata

Raster geodata represents map data in matrix format.

Georeferenced Raster Data

Each element of georeferenced raster data corresponds to a defined quadrangle of territory on a planet.

Types of Data Grids and Raster Display Functions

You can display regular and geolocated data grids in many ways, such as a 2-D indexed image where color represents the data value, or as a 3-D surface with light shading.

Regular Data Grids

Construct a Global Data Grid

This example shows how to store a matrix in a geographic referencing object. Display the matrix on a map, and specify display properties such as the projection, axes labels, and color map.

Compute Map Limits for Regular Data Grids

This example shows how to find the maximum and minimum latitude and longitude of a regular data grid that has a referencing vector.

Convert Between Geographic and Intrinsic Coordinates

You can work with gridded geodata using either geographic coordinates, which specify latitude and longitude, or intrinsic raster coordinates, which specify matrix indices.

Precompute the Size of a Data Grid

This example shows how to compute the expected size of a large data grid, before creating the grid, to confirm that the grid will be manageable and will fit in memory.

Compute Gradient, Slope, and Aspect from Regular Data Grid

This example shows how to compute relationships between neighboring cells in a regular data grid.

Geolocated Data Grids

Geolocated Data Grids

A geolocated data grid is defined by three matrices giving latitude and longitude coordinates and indices associated with the mapped region.

Geographic Interpretations of Geolocated Grids

The dimensions of a map matrix and associated latitude and longitude matrices determines the interpretation of the geographic map data.

Applications of Gridded Geodata

Creating a Half-Resolution Georeferenced Image

This example shows how to create a half-resolution version of a georeferenced TIFF image, using spatial referencing objects (requires Image Processing Toolbox™).

Compute Elevation Profile Along Straight Line

This example shows how to compute an elevation profile along a straight line by defining waypoints.

Generate Shaded Relief Map using Raster Data

This example shows how to generate a shaded relief map using geographic data in an array. You can change the displayed projection of the map without modifying the raster data.

Data Grids as Logical Variables

You can perform logic tests on data grid variables to create a binary logical grid.

Determine Area Occupied by Logical Grid Variable

This example shows how to use a logical grid to analyze regions with certain constraints. For example, find the area of a region that belongs both to a specified country and to a specified state.

Featured Examples