Mapping Toolbox | ![]() ![]() |
Initialize a default map projection structure
Syntax
mstruct = defaultm mstruct = defaultm(projection) mstruct = defaultm(mstruct) [mstruct,msg] = defaultm(...)
Description
The map projection structure contains all the information needed to project and display geographic data. It normally resides in the UserData
property of a map axes, but it can also be used directly to project data without display.
mstruct = defaultm creates an empty map projection structure.
mstruct = defaultm(projection
) initializes the map structure for the specified map projection. projection is any valid projection string, such as 'sinusoid'
.
mstruct = defaultm(mstruct) sets appropriate defaults based on existing parameter values in the map structure mstruct
.
[mstruct,msg] = defaultm(...) returns the string msg
, indicating any error encountered.
Examples
Create an empty map projection structure for a Mercator projection:
mstruct = defaultm('mercator') mstruct = mapprojection: 'mercator' zone: [] angleunits: 'degrees' aspect: 'normal' falseeasting: [] falsenorthing: [] fixedorient: [] geoid: [1 0] maplatlimit: [] maplonlimit: [] mapparallels: 0 nparallels: 1 origin: [] scalefactor: [] trimlat: [-86 86] trimlon: [-180 180] frame: [] ffill: 100 fedgecolor: [0 0 0] ffacecolor: 'none' flatlimit: [] flinewidth: 2 flonlimit: [] grid: [] galtitude: Inf gcolor: [0 0 0] glinestyle: ':' glinewidth: 0.5000 mlineexception: [] mlinefill: 100 mlinelimit: [] mlinelocation: [] mlinevisible: 'on' plineexception: [] plinefill: 100 plinelimit: [] plinelocation: [] plinevisible: 'on' fontangle: 'normal' fontcolor: [0 0 0] fontname: 'helvetica' fontsize: 9 fontunits: 'points' fontweight: 'normal' labelformat: 'compass' labelrotation: 'off' labelunits: [] meridianlabel: [] mlabellocation: [] mlabelparallel: [] mlabelround: 0 parallellabel: [] plabellocation: [] plabelmeridian: [] plabelround: 0
Now change the map origin to [0 90 0]
, and fill in default projection parameters accordingly:
mstruct.origin = [0 90 0]; mstruct = defaultm(mstruct) mstruct = mapprojection: 'mercator' zone: [] angleunits: 'degrees' aspect: 'normal' falseeasting: 0 falsenorthing: 0 fixedorient: [] geoid: [1 0] maplatlimit: [-86 86] maplonlimit: [-180 180] mapparallels: 0 nparallels: 1 origin: [0 0 0] scalefactor: 1 trimlat: [-86 86] trimlon: [-180 180] frame: 'off' ffill: 100 fedgecolor: [0 0 0] ffacecolor: 'none' flatlimit: [-86 86] flinewidth: 2 flonlimit: [-180 180] grid: 'off' galtitude: Inf gcolor: [0 0 0] glinestyle: ':' glinewidth: 0.50000000000000 mlineexception: [] mlinefill: 100 mlinelimit: [] mlinelocation: 30 mlinevisible: 'on' plineexception: [] plinefill: 100 plinelimit: [] plinelocation: 15 plinevisible: 'on' fontangle: 'normal' fontcolor: [0 0 0] fontname: 'helvetica' fontsize: 9 fontunits: 'points' fontweight: 'normal' labelformat: 'compass' labelrotation: 'off' labelunits: 'degrees' meridianlabel: 'off' mlabellocation: 30 mlabelparallel: 86 mlabelround: 0 parallellabel: 'off' plabellocation: 15 plabelmeridian: -180 plabelround: 0
See Also
axesm |
Define map axes and set map properties |
gcm |
Get current map data structure |
mfwdtran |
Map forward transformation |
minvtran |
Map inverse transformation |
setm |
Set and modify map properties |
![]() | daspectm | deg2dms, deg2dm | ![]() |