Main Content

matlab.io.hdfeos.gd.create

Namespace: matlab.io.hdfeos.gd

Create new grid structure

Syntax

gridID = create(gfID,gridName,xdim,ydim,upLeft,lowRight)

Description

gridID = create(gfID,gridName,xdim,ydim,upLeft,lowRight) creates a new grid structure where gfID is the grid file identifier. gridName is the name of the new grid. xdim and ydim define the size of the grid. upLeft is a two-element vector containing the location of the upper left pixel, and lowRight is a two-element vector containing the location of the lower right pixel.

Note

upLeft and lowRight are in units of meters for all GCTP projections other than the geographic and bcea projections, which should have units of packed degrees.

Note

For certain projections, upLeft and lowRight can be given as [].

  • Polar Stereographic projection of an entire hemisphere.

  • Goode Homolosine projection of the entire globe.

  • Lambert Azimuthal entire polar or equatorial projection.

Note

MATLAB® uses Fortran-style ordering, but the HDF-EOS library uses C-style ordering.

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

Examples

Create a polar stereographic grid of the northern hemisphere.

import matlab.io.hdfeos.*
gfid = gd.open('myfile.hdf','create');
gridID = gd.create(gfid,'PolarGrid',100,100,[],[]);
gd.detach(gridID);
gd.close(gfid);

Create a UTM grid bounded by 54 E to 60 E longitude and 20 N to 30 N latitude. Divide the grid into 120 bins along the x-axis and 200 bins along the y-axis.

import matlab.io.hdfeos.*
gfid = gd.open('myfile.hdf','create');
uplft = [210584.50041 3322395.95445];
lowrgt = [813931.10959 2214162.53278];
gridID = gd.create(gfid,'UTMGrid',120,200,uplft,lowrgt);
gd.detach(gridID);
gd.close(gfid);