Main Content

matlab.io.hdfeos.gd.defProj

Namespace: matlab.io.hdfeos.gd

Define grid projection

Syntax

defProj(gridID,projCode,zoneCode,sphereCode,projParm)

Description

defProj(gridID,projCode,zoneCode,sphereCode,projParm) defines a GCTP projection on the grid specified by gridID. The projCode argument can be one of these values.

'geo'Geographic
'utm'Universal Transverse Mercator
'albers'Albers Conical Equal Area
'lamcc'Lambert Conformal Conic
'ps'Polar Stereographic
'polyc'Polyconic
'tm'Transverse Mercator
'lamaz'Lambert Azimuthal Equal Area
'snsoid'Sinusoidal
'hom'Hotine Oblique Mercator
'som'Space Oblique Mercator
'good'Interrupted Goode Homolosine
'cea'Cylindrical Equal Area
'bcea'Behrmann Cylindrical Equal Area
'isinus'Integerized Sinusoidal

If projCode is 'geo', then zoneCode, sphereCode, and projParm should be specified as []. Any other values for these parameters are ignored.

zoneCode is the Universal Transverse Mercator zone code. It should be specified as -1 for other projections.

sphereCode is the name of the GCTP spheroid or the corresponding numeric code.

projParm is a vector of up to 13 elements containing projection-specific parameters. For more details about projCode, zoneCode, sphereCode, and projParm, see Chapter 6 of the HDF-EOS Library User's Guide, Volume 1: Overview and Examples.

This function corresponds to the GDdefproj function in the HDF library C API.

Examples

Create a UTM grid bounded by 54 E to 60 E longitude and 20 N to 30 N latitude (zone 40). 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.defProj(gridID,'utm',40,'Clarke 1866',[]);
gd.detach(gridID);
gd.close(gfid);

Add a polar stereographic projection of the northern hemisphere with true scale at 90 N, 0 longitude below the pole using the WGS 84 spheroid.

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.detach(gridID);
gd.close(gfid);