Contenido principal

maprefpostings

R2026b

Reference raster postings to map coordinates

Description

R = maprefpostings(xlimits,ylimits,rasterSize) creates a reference object for a raster of regularly posted samples in planar coordinates. Specify the xy-limits of the raster using xlimits and ylimits. Specify the number of rows and columns in the raster using rasterSize.

example

R = maprefpostings(xlimits,ylimits,xspacing,yspacing) specifies the distance between adjacent postings using xspacing and yspacing. If necessary, the maprefpostings function adjusts the xy-limits to ensure that each dimension of the raster has an integer number of samples.

example

R = maprefpostings(___,Name=Value) specifies properties of the reference object using one or more name-value arguments, in addition to the input arguments in the previous syntaxes.

example

Examples

collapse all

Create a reference object for a raster of posting point samples, where the first posting is in the northwest corner. Specify the xy-limits using world coordinates. Specify the projected CRS as NAD83 / Massachusetts Mainland, which has the EPSG authority code 26986.

xlimits = [207000 208000];
ylimits = [912500 913000];
rasterSize = [1001 2001];
pcrs = projcrs(26986);

R1 = maprefpostings(xlimits,ylimits,rasterSize, ...
    ColumnsStartFrom="north",ProjectedCRS=pcrs)
R1 = 
  MapPostingsReference with properties:

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


Alternatively, specify the spacing between postings instead of the raster size.

spacing = 1/2;
R2 = maprefpostings(xlimits,ylimits,spacing,spacing, ...
    ColumnsStartFrom="north",ProjectedCRS=pcrs)
R2 = 
  MapPostingsReference with properties:

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


Input Arguments

collapse all

x-limits of the rectangle that bounds the raster, in world coordinates, specified as a two-element vector of the form [xmin xmax], where xmax is greater than xmin.

y-limits of the rectangle that bounds the raster, in world coordinates, specified as a two-element vector of the form [ymin ymax], where ymax is greater than ymin.

Number of rows and columns in the raster, specified as a two-element vector of the form [m n], where m is the number of rows and n is the number of columns. This argument sets the RasterSize property of R.

Horizontal distance between adjacent postings, in world coordinates, specified as a positive scalar. This argument sets the SampleSpacingInWorldX property of R.

Vertical distance between adjacent postings, in world coordinates, specified as a positive scalar. This argument sets the SampleSpacingInWorldY property of R.

Name-Value Arguments

collapse all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: R = maprefpostings(xlimits,ylimits,rasterSize,ColumnsStartFrom="north") creates a map postings reference object with columns that start from north.

Edge from which column indexing starts, specified as one of these options:

  • "south" — Column indexing starts from south.

  • "north" — Column indexing starts from north.

Edge from which row indexing starts, specified as one of these options:

  • "west" — Row indexing starts from west.

  • "east" — Row indexing starts from east.

Projected coordinate reference system (CRS), specified as a projcrs object.

Output Arguments

collapse all

Map postings reference object, returned as a MapPostingsReference object.

Tips

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

Version History

Introduced in R2015b

expand all