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 −1
s 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:
R
is a geographic raster, since longitude depends only on intrinsic x and latitude depends only on intrinsic yR
is a map raster andR.TransformationType
is'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.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- 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)