Main Content

worldFileMatrix

Return world file parameters for transformation

Description

W = worldFileMatrix(R) returns a 2-by-3 world file matrix from geographic or map raster R.

example

Examples

collapse all

Create a MapCellsReference raster reference object.

xWorldLimits = [207000 208000];
yWorldLimits = [912500 913000];
rasterSize = [10 20];
R = maprefcells(xWorldLimits,yWorldLimits,rasterSize,'ColumnsStartFrom','north')
R = 
  MapCellsReference with properties:

            XWorldLimits: [207000 208000]
            YWorldLimits: [912500 913000]
              RasterSize: [10 20]
    RasterInterpretation: 'cells'
        ColumnsStartFrom: 'north'
           RowsStartFrom: 'west'
      CellExtentInWorldX: 50
      CellExtentInWorldY: 50
    RasterExtentInWorldX: 1000
    RasterExtentInWorldY: 500
        XIntrinsicLimits: [0.5 20.5]
        YIntrinsicLimits: [0.5 10.5]
      TransformationType: 'rectilinear'
    CoordinateSystemType: 'planar'
            ProjectedCRS: []


Compute the world file matrix.

W = worldFileMatrix(R)
W = 2×3

          50           0      207025
           0         -50      912975

Observe that W(2,1) and W(1,2) are 0. This value is expected since R.TransformationType is 'rectilinear'.

Input Arguments

collapse all

Output Arguments

collapse all

World file matrix, returned as a 2-by-3 numeric array. Each of the six elements in W matches one of the lines in a world file corresponding to the transformation defined by raster referencing object R.

Data Types: double

More About

collapse all

Version History

Introduced in R2013b