maprefpostings

Reference raster postings to map coordinates

Description

R = maprefpostings() returns a default referencing object for a raster of regularly posted samples in planar (map) coordinates.

example

R = maprefpostings(xlimits,ylimits,rasterSize) constructs a referencing object for a raster spanning the specified limits in planar coordinates, with the numbers of rows and columns specified by rasterSize.

example

R = maprefpostings(xlimits,ylimits,xspacing,yspacing) allows the sample spacings to be set precisely. If necessary, maprefpostings adjusts the limits of the raster slightly to ensure an integer number of samples in each dimension.

R = maprefpostings(xlimits,ylimits,___, Name,Value) allows the directions of the columns and rows to be specified via name-value pairs.

Examples

collapse all

Define latitude and longitude limits and dimension of a grid. The example uses postings separated by 1/2 meter, referenced to a planar map coordinate system (the "world" system).

xlimits = [207000 208000];
ylimits = [912500 913000];
rasterSize = [1001 2001]
rasterSize = 1×2

        1001        2001

Create the referencing object specifying the raster size.

R = maprefpostings(xlimits,ylimits,rasterSize)
R = 
  MapPostingsReference with properties:

             XWorldLimits: [207000 208000]
             YWorldLimits: [912500 913000]
               RasterSize: [1001 2001]
     RasterInterpretation: 'postings'
         ColumnsStartFrom: 'south'
            RowsStartFrom: 'west'
    SampleSpacingInWorldX: 1/2
    SampleSpacingInWorldY: 1/2
     RasterExtentInWorldX: 1000
     RasterExtentInWorldY: 500
         XIntrinsicLimits: [1 2001]
         YIntrinsicLimits: [1 1001]
       TransformationType: 'rectilinear'
     CoordinateSystemType: 'planar'
             ProjectedCRS: []


Obtain the same result by specifying the sample spacing.

spacing = 1/2;

R = maprefpostings(xlimits,ylimits,spacing,spacing)
R = 
  MapPostingsReference with properties:

             XWorldLimits: [207000 208000]
             YWorldLimits: [912500 913000]
               RasterSize: [1001 2001]
     RasterInterpretation: 'postings'
         ColumnsStartFrom: 'south'
            RowsStartFrom: 'west'
    SampleSpacingInWorldX: 1/2
    SampleSpacingInWorldY: 1/2
     RasterExtentInWorldX: 1000
     RasterExtentInWorldY: 500
         XIntrinsicLimits: [1 2001]
         YIntrinsicLimits: [1 1001]
       TransformationType: 'rectilinear'
     CoordinateSystemType: 'planar'
             ProjectedCRS: []


Input Arguments

collapse all

Limits in the x direction, specified as a 1-by-2 numeric vector. The value of xlimits determines the XWorldLimits property of R.

Example: xlimits = [207000 208000];

Data Types: double

Limits in the y direction, specified as a 1-by-2 numeric vector. The value of ylimits determines the YWorldLimits property of R.

Example: ylimits = [912500 913000];

Data Types: double

Size of the raster, specified as a 1-by-2 numeric vector.

Example: rasterSize = [180 360];

Data Types: double

Horizontal spacing of posting, specified as a numeric scalar. The value of xspacing determines the SampleSpacingInWorldX property of R.

Example: xspacing = 1.5

Data Types: double

Vertical spacing of postings, specified as a numeric scalar. The value of yspacing determines the SampleSpacingInWorldY property of R.

Example: yspacing = 1.5

Data Types: double

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: R = maprefpostings(latlim,lonlim,rasterSize,'ColumnsStartFrom','north')

Edge from which column indexing starts, specified as 'north' or 'south'.

Example: R = maprefpostings(latlim,lonlim,rasterSize,'ColumnsStartFrom','north')

Data Types: char | string

Edge from which row indexing starts, specified as 'east' or 'west'.

Example: R = maprefpostings(latlim,lonlim,rasterSize,'RowsStartFrom','east')

Data Types: char | string

Output Arguments

collapse all

Object that references raster postings to map coordinates, returned as a MapPostingsReference raster reference object.

Tips

  • To construct a map raster reference object from a world file matrix, use the maprasterref function.

Introduced in R2015b