# Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materials including this page, select Japan from the country navigator on the bottom of this page.

# georefcells

Reference raster cells to geographic coordinates

## Syntax

``R = georefcells()``
``R = georefcells(latlim,lonlim,rasterSize)``
``R = georefcells(latlim,lonlim,cellExtentInLatitude,cellExtentInLongitude)``
``R = georefcells(latlim,lonlim,___,Name,Value)``

## Description

````R = georefcells()` returns a default referencing object for a regular raster of cells in geographic coordinates.```

example

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

example

````R = georefcells(latlim,lonlim,cellExtentInLatitude,cellExtentInLongitude)` allows the geographic cell extents to be set precisely. If necessary, `georefcells` adjusts the geographic limits slightly to ensure an integer number of cells in each dimension.```

example

````R = georefcells(latlim,lonlim,___,Name,Value)` allows the directions of the columns and rows to be specified via name-value pairs.```

## Examples

collapse all

Construct a referencing object for a global raster comprising a grid of 180-by-360 one-degree cells, with rows that start at longitude -180, and with the first cell located in the northwest corner.

```latlim = [-90 90]; lonlim = [-180 180]; rasterSize = [180 360];```

Create a raster referencing object by specifying the raster size.

`R = georefcells(latlim,lonlim,rasterSize,'ColumnsStartFrom','north')`
```R = GeographicCellsReference with properties: LatitudeLimits: [-90 90] LongitudeLimits: [-180 180] RasterSize: [180 360] RasterInterpretation: 'cells' ColumnsStartFrom: 'north' RowsStartFrom: 'west' CellExtentInLatitude: 1 CellExtentInLongitude: 1 RasterExtentInLatitude: 180 RasterExtentInLongitude: 360 XIntrinsicLimits: [0.5 360.5] YIntrinsicLimits: [0.5 180.5] CoordinateSystemType: 'geographic' AngleUnit: 'degree' ```

Obtain the same result by specifying cell extents.

```extent = 1; R = georefcells(latlim,lonlim,extent,extent,'ColumnsStartFrom','north')```
```R = GeographicCellsReference with properties: LatitudeLimits: [-90 90] LongitudeLimits: [-180 180] RasterSize: [180 360] RasterInterpretation: 'cells' ColumnsStartFrom: 'north' RowsStartFrom: 'west' CellExtentInLatitude: 1 CellExtentInLongitude: 1 RasterExtentInLatitude: 180 RasterExtentInLongitude: 360 XIntrinsicLimits: [0.5 360.5] YIntrinsicLimits: [0.5 180.5] CoordinateSystemType: 'geographic' 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]; `

Data Types: `double`

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];`

Data Types: `double`

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

Example: `rasterSize = [180 360];`

Data Types: `double`

Height of cells, specified as a numeric scalar.

Example: `extent = 1.5`

Data Types: `double`

Width of cells, specified as a numeric scalar.

Example: `extent = 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 single quotes (`' '`). You can specify several name and value pair arguments in any order as `Name1,Value1,...,NameN,ValueN`.

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

collapse all

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

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

Data Types: `char`

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

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

Data Types: `char`

## Output Arguments

collapse all

Object that references raster cells to geographic coordinates, returned as a `GeographicCellsReference` raster reference object.

## See Also

#### Introduced in R2015b

Was this topic helpful?

Get trial now