## Documentation Center |

**Package: **map.rasterref

Reference raster to map coordinates

A map raster reference object encapsulates the relationship
between a planar map coordinate system and a system of *intrinsic
coordinates* anchored to the columns and rows of
a 2-D spatially referenced raster grid or image.

Typically, the raster is sampled regularly in the planar world *x* and
world *y* coordinates of the map system, such that
the intrinsic *x* and world *x* axes
align and the intrinsic *y* and world *y* axes
align. When this is true, the relationship between the two systems
is rectilinear.

More generally, and much more rarely, their relationship is affine. The affine relationship allows for a possible rotation (and skew).

In either case, rectilinear or affine, the sample spacing from row to row need not equal the sample spacing from column to column. If the raster data set is interpreted as comprising a grid of cells or pixels, the cells or pixels need not be square. In the most general case, they could conceivably be parallelograms, but in practice they are always rectangular.

You can use either of the following functions to construct a map raster reference object:

`maprasterref`function`refmatToMapRasterReference`conversion function used to convert an existing referencing matrix

By default, `maprasterref` creates a map raster
reference object with the raster interpretation of cells (`map.rasterref.MapCellsReference`).
To create a map raster reference object with a raster interpretation
of postings (`map.rasterref.MapPostingsReference`),
call `maprasterref` specifying the `rasterInterpretation` input
argument.

For example, this syntax constructs a `MapRasterReference` object
with default property settings:

R = maprasterref()

R = MapCellsReference with properties: XWorldLimits: [0.5 2.5] YWorldLimits: [0.5 2.5] RasterSize: [2 2] RasterInterpretation: 'cells' ColumnsStartFrom: 'south' RowsStartFrom: 'west' CellExtentInWorldX: 1 CellExtentInWorldY: 1 RasterExtentInWorldX: 2 RasterExtentInWorldY: 2 XIntrinsicLimits: [0.5 2.5] YIntrinsicLimits: [0.5 2.5] TransformationType: 'rectilinear' CoordinateSystemType: 'planar'

contains | True if raster contains points in world coordinate system |

firstCornerX | World x coordinate of the (1,1) corner
of the raster |

firstCornerY | World y coordinate of the (1,1) corner
of the raster |

intrinsicToWorld | Convert from intrinsic to world coordinates |

sizesMatch | True if object and raster or image are size compatible |

worldFileMatrix | World file parameters for transformation |

worldToDiscrete | Transform map to discrete coordinates |

worldToIntrinsic | Convert from world to intrinsic coordinates |

A 2-D Cartesian system with its *x*-axis running
parallel to the rows of a raster or image and its *y*-axis
running parallel to the columns. *x* increases by
1 from column to column, and *y* increases by 1 from
row to row.

The Mapping Toolbox™ and Image Processing Toolbox™ use
the convention for the location of the origin relative to the raster
cells or sampling points such that, at a sample location or at the
center of a cell, *x* has an integer value equal
to the column index. Likewise, at a sample location or at the center
of a cell, *y* has an integer value equal to the
row index. For details, see Image Coordinate Systems in
the Image Processing Toolbox documentation.

`map.rasterref.GeographicRasterReference` | `maprasterref` | `refmatToMapRasterReference`

Was this topic helpful?