Initialize or reset map projection structure
mstruct = defaultm(projid)
mstruct = defaultm(mstruct)
mstruct = defaultm(projid)
initializes a map
projection structure, where projid
is a string scalar or character vector
that matches one of the entries in the last column of the table displayed by the maps
function. The output mstruct
is a map projection
structure. It is a scalar structure whose fields correspond to Map Axes Properties.
mstruct = defaultm(mstruct)
checks
an existing map projection structure, sets empty properties, and adjusts
dependent properties. The Origin
, FLatLimit
, FLonLimit
, MapLatLimit
,
and MapLonLimit
properties may be adjusted for
compatibility with each other and with the MapProjection
property
and (in the case of UTM or UPS) the Zone
property.
With defaultm
, you can construct a map projection structure
(mstruct
) that contains all the information needed to project and
unproject geographic coordinates using , projinv
, projfwd
, vfwdtran
, or vinvtran
without creating a map axes or making
any use at all of MATLAB® graphics. Relevant parameters in the mstruct
include the
projection name, angle units, zone (for UTM or UPS), origin, aspect, false easting, false
northing, and (for conic projections) the standard parallel or parallels. In very rare cases
you might also need to adjust the frame limit (FLatLimit
and
FLonLimit
) or map limit (MapLatLimit
and
MapLonLimit
) properties.
You should make exactly two calls to defaultm
to set up your
mstruct
, using the following sequence:
Construct a provisional version containing default values for the projection you've
selected: mstruct = defaultm(projection);
Assign appropriate values to mstruct.angleunits
, mstruct.zone
, mstruct.origin
,
etc.
Set empty properties and adjust interdependent properties
as needed to finalize your map projection structure: mstruct
= defaultm(mstruct)
;
If you've set field prop1
of mstruct
to
value1
, field prop2
to value2
, and
so forth, then the following sequence
mstruct = defaultm(projection); mstruct.prop1 = value1; mstruct.prop2 = value2; ... mstruct = defaultm(mstruct);
produces exactly the same result as the following:
f = figure; ax = axesm(projection, prop1, value1, prop2, value2, ...); mstruct = getm(ax); close(f)
Note
Angle-valued properties are in degrees by default. If you want
to work in radians instead, you can make the following assignment
in between your two calls to defaultm
:
mstruct.angleunits = 'radians';
You must also use values in radians when assigning any angle-valued
properties (such as mstruct.origin
, mstruct.parallels
, mstruct.maplatlimit
, mstruct.maplonlimit
,
etc.).
See the Mapping Toolbox™ User's Guide section on Work in UTM Without a Displayed Map for
information and an example showing the use of defaultm
in
combination with UTM.