Main Content

worldFileMatrixToRefmat

(Removed) Convert world file matrix to referencing matrix

    worldFileMatrixToRefmat has been removed. Use the georasterref or maprasterref function instead. For more information, see Compatibility Considerations.

    Description

    refmat = worldFileMatrixToRefmat(W) converts the 2-by-3 world file matrix W to a 3-by-2 referencing matrix refmat.

    Input Arguments

    collapse all

    World file matrix, specified as a 2-by-3 numeric array. A world file matrix defines a transformation that maps intrinsic coordinates to geographic or world coordinates.

    Output Arguments

    collapse all

    Referencing matrix, returned as a 3-by-2 numeric array. A referencing matrix defines a transformation that maps intrinsic coordinates to geographic or world coordinates.

    • For world coordinates, the function returns refmat so that [xwyw]=[xiyi1]refmat, where (xi, yi) is a location in intrinsic coordinates and (xw, yw) is the same location in world coordinates.

    • For geographic coordinates, the function returns refmat so that [lonlat]=[xy1]refmat, where x and y specify a location in intrinsic coordinates and lat and lon specify the same location in geographic coordinates.

    Version History

    Introduced in R2011a

    expand all

    R2023b: Removed

    Some functions that return referencing matrices have been removed, including the worldFileMatrixToRefmat function. Instead of using this function, create a raster reference object using the georasterref or maprasterref function. Reference objects have several advantages over referencing matrices.

    • Unlike referencing matrices, reference objects have properties that document the size of the associated raster, its limits, and the direction of its rows and columns. For more information about reference object properties, see the GeographicCellsReference and MapPostingsReference functions.

    • You can manipulate the limits of rasters associated with reference objects using the geocrop or mapcrop function.

    • You can manipulate the size and resolution of rasters associated with reference objects using the georesize or mapresize function.

    • Most functions that accept referencing matrices as inputs also accept reference objects.

    To update your code, change instances of the worldFileMatrixToRefmat function to the georasterref or maprasterref function and specify the size of the raster A. Use the georasterref function for geographic coordinates and the maprasterref function for planar map coordinates.

    R = georasterref(W,size(A));

    You can also specify the raster interpretation as "cells" for a raster of cells or "postings" for a raster of regularly posted samples. By default, the georasterref and maprasterref functions use "cells".

    R = georasterref(W,size(A),"postings");