Main Content

Reference raster cells to map coordinates

A map cells 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. 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. For more information about coordinate systems,
see Intrinsic Coordinate System.

You can use any of the following functions to create a
`MapCellsReference`

object to reference a regular raster of cells
to planar (map) coordinates.

`maprefcells`

— Create a map raster reference object.`maprasterref`

— Convert a world file to a map raster reference object.`refmatToMapRasterReference`

— Convert a referencing matrix to a map raster reference object.

For example, this syntax constructs a `MapCellsReference`

object with
default property settings:

R = maprefcells()

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` | Determine if geographic or map raster contains points |

`firstCornerX` | Return world x-coordinate of map raster index
(1,1) |

`firstCornerY` | Return world y-coordinate of map raster index
(1,1) |

`intrinsicToWorld` | Transform intrinsic to planar world coordinates |

`sizesMatch` | Determine if geographic or map raster object and image or raster are size-compatible |

`worldFileMatrix` | Return world file parameters for transformation |

`worldToDiscrete` | Transform planar world to discrete coordinates |

`worldToIntrinsic` | Transform planar world to intrinsic coordinates |