worldFileMatrix
Return world file parameters for transformation
Syntax
Description
Examples
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
Geographic or map raster, specified as a GeographicCellsReference,
GeographicPostingsReference,
MapCellsReference, or MapPostingsReference
object.
Output Arguments
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
A world file matrix maps points in intrinsic coordinates to points in geographic or planar world coordinates.
Given a world file matrix W of the form:
W = [A B C;
D E F]xw = A × ( xi - 1 ) + B × ( yi - 1 ) + C
yw = D × ( xi - 1 ) + E × ( yi - 1 ) + F.
More compactly:
[ xw yw ]′ = W × [ ( xi - 1 ) ( yi - 1 ) ].
Note
Similar equations hold true for points ( lat, lon ) in geographic coordinates. However, the geographic coordinate ordering is switched. That is, xw is substituted by lon, and yw is substituted by lat.
The −1s are needed to maintain the Mapping Toolbox™ convention for intrinsic coordinates, which is consistent with the
1-based indexing used throughout MATLAB®.
W is stored in a world file with one term per line in column-major order: A, D, B, E, C, F. That is, a world file contains the elements of W in this order:
W(1,1) W(2,1) W(1,2) W(2,2) W(1,3) W(2,3)
The previous expressions hold for both affine and rectilinear transformations of rasters. The values B, D, W(2,1) and W(1,2) are identically 0 whenever:
Ris a geographic raster, since longitude depends only on intrinsic x and latitude depends only on intrinsic yRis a map raster andR.TransformationTypeis'rectilinear'
Version History
Introduced in R2013b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Seleziona un sito web
Seleziona un sito web per visualizzare contenuto tradotto dove disponibile e vedere eventi e offerte locali. In base alla tua area geografica, ti consigliamo di selezionare: .
Puoi anche selezionare un sito web dal seguente elenco:
Come ottenere le migliori prestazioni del sito
Per ottenere le migliori prestazioni del sito, seleziona il sito cinese (in cinese o in inglese). I siti MathWorks per gli altri paesi non sono ottimizzati per essere visitati dalla tua area geografica.
Americhe
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)