Main Content

matlab.io.hdfeos.gd.defOrigin

Namespace: matlab.io.hdfeos.gd

Define origin of pixels in grid

Syntax

defOrigin(gridID,originCode)

Description

defOrigin(gridID,originCode) defines the origin of pixels in a grid. gridID is the identifier of the grid, and originCode can be one of the following four values.

'ul'Upper-left
'ur'Upper-right
'll'Lower-left
'lr'Lower-right

You can select any corner of the grid pixel as the origin. If this routine is not invoked, the grid defaults to using the upper-left corner for the origin.

This function corresponds to the GDdeforigin function in the HDF-EOS library C API.

Examples

Create a polar stereographic grid with the origin of the grid pixel in the lower right corner.

import matlab.io.hdfeos.*
gfid = gd.open('myfile.hdf','create');
gridID = gd.create(gfid,'PolarGrid',100,100,[],[]);
projparm = zeros(1,13);
projparm(6) = 90000000;
gd.defProj(gridID,'ps',[],'WGS 84',projparm);
gd.defOrigin(gridID,'lr');
gd.detach(gridID);
gd.close(gfid);