Main Content

georefpostings

Reference raster postings to geographic coordinates

Description

R = georefpostings() returns a default referencing object for a raster of regularly posted samples in geographic coordinates.

example

R = georefpostings(latlim,lonlim,rasterSize) constructs a referencing object for a raster spanning the specified limits in latitude and longitude, with the numbers of rows and columns specified by rasterSize.

example

R = georefpostings(latlim,lonlim,latspacing,lonspacing) allows the geographic sample spacings to be set precisely. The geographic limits will be adjusted slightly, if necessary, to ensure an integer number of samples in each dimension.

example

R = georefpostings(latlim,lonlim,___,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 the dimensions of the raster.

latlim = [-90 90];
lonlim = [-180 180];
rasterSize = [181 361];

Create the referencing object specifying the raster size.

R = georefpostings(latlim,lonlim,rasterSize,'ColumnsStartFrom','north')
R = 
  GeographicPostingsReference with properties:

              LatitudeLimits: [-90 90]
             LongitudeLimits: [-180 180]
                  RasterSize: [181 361]
        RasterInterpretation: 'postings'
            ColumnsStartFrom: 'north'
               RowsStartFrom: 'west'
     SampleSpacingInLatitude: 1
    SampleSpacingInLongitude: 1
      RasterExtentInLatitude: 180
     RasterExtentInLongitude: 360
            XIntrinsicLimits: [1 361]
            YIntrinsicLimits: [1 181]
        CoordinateSystemType: 'geographic'
               GeographicCRS: []
                   AngleUnit: 'degree'


Obtain the same result by specifying the sample spacing.

spacing = 1;

R = georefpostings(latlim,lonlim,spacing,spacing,'ColumnsStartFrom','north')
R = 
  GeographicPostingsReference with properties:

              LatitudeLimits: [-90 90]
             LongitudeLimits: [-180 180]
                  RasterSize: [181 361]
        RasterInterpretation: 'postings'
            ColumnsStartFrom: 'north'
               RowsStartFrom: 'west'
     SampleSpacingInLatitude: 1
    SampleSpacingInLongitude: 1
      RasterExtentInLatitude: 180
     RasterExtentInLongitude: 360
            XIntrinsicLimits: [1 361]
            YIntrinsicLimits: [1 181]
        CoordinateSystemType: 'geographic'
               GeographicCRS: []
                   AngleUnit: 'degree'


Input Arguments

collapse all

Latitude limits in degrees, specified as a 1-by-2 numeric vector. The number of rows in the resulting raster is specified by rasterSize.

Example: latlim = [-90 90];

Longitude limits in degrees, specified as a 1-by-2 numeric vector. The number of columns in the resulting raster is specified by rasterSize.

Example: lonlim = [-180 180];

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

Example: rasterSize = [180 360];

Vertical spacing of posting, specified as a numeric scalar. The value of latspacing determines the SampleSpacingInLatitude property of R.

Example: latspacing = 1.5

Horizontal spacing of postings, specified as a numeric scalar. The value of lonspacing determines the SampleSpacingInLongitude property of R.

Example: lonspacing = 1.5

Name-Value Arguments

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.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

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

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

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

Data Types: char | string

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

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

Data Types: char | string

Output Arguments

collapse all

Object that references raster postings to geographic coordinates, returned as a GeographicPostingsReference raster reference object.

Tips

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

Version History

Introduced in R2015b