Contenu principal

georefpostings

R2026b

Reference raster postings to geographic coordinates

Description

R = georefpostings(latlim,lonlim,rasterSize) creates a reference object for a raster of regularly posted samples in geographic coordinates. Specify the latitude and longitude limits of the raster using latlim and lonlim. Specify the number of rows and columns in the raster using rasterSize.

example

R = georefpostings(latlim,lonlim,latspacing,lonspacing) specifies the distance between adjacent postings using latspacing and lonspacing. If necessary, the georefpostings function adjusts the geographic limits to ensure that each dimension of the raster has an integer number of samples.

example

R = georefpostings(___,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 global raster of posting point samples, where the first posting is in the northwest corner. Specify the geographic CRS as the World Geodetic System of 1984, which has the EPSG code 4326.

latlim = [-90 90];
lonlim = [-180 180];
rasterSize = [181 361];
gcrs = geocrs(4326);

R1 = georefpostings(latlim,lonlim,rasterSize, ...
    ColumnsStartFrom="north",GeographicCRS=gcrs)
R1 = 
  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: [1×1 geocrs]
                   AngleUnit: 'degree'


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

spacing = 1;
R2 = georefpostings(latlim,lonlim,spacing,spacing, ...
    ColumnsStartFrom="north",GeographicCRS=gcrs)
R2 = 
  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: [1×1 geocrs]
                   AngleUnit: 'degree'


Input Arguments

collapse all

Latitude limits of the quadrangle that bounds the raster, specified as a two-element vector with elements in the range [–90, 90]. Specify the latitude limits using the form [latmin latmax], where latmax is greater than latmin.

Longitude limits of the quadrangle that bounds the raster, specified as a two-element vector of the form [lonmin lonmax], where lonmax is greater than lonmin.

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.

Distance in latitude between adjacent postings, specified as a positive scalar. This argument sets the SampleSpacingInLatitude property of R.

Distance in longitude between adjacent postings, specified as a positive scalar. This argument sets the SampleSpacingInLongitude 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 = georefpostings(latlim,lonlim,rasterSize,ColumnsStartFrom="north") creates a geographic 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.

Geographic coordinate reference system (CRS), specified as a geocrs object.

Output Arguments

collapse all

Geographic postings reference object, returned as a GeographicPostingsReference object.

Tips

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

Version History

Introduced in R2015b

expand all