Mapping Toolbox | ![]() ![]() |
The Geographic Data Structure
In the previous examples, all of the map data was in the form of individual variables and had to be displayed using different mapping commands according to the type of data at hand (i.e., line, patch, matrix, text, etc.). The Mapping Toolbox also provides an easy means of displaying, extracting, and manipulating collections of all types of map objects that have been organized in a specially defined and formatted geographic data structure. Note that this structure is different from the map projection structure, which defines a map projection along with its mapping properties. The geographic data structure contains the information required for the proper display of the graphic object. The following table lists the six object types along with their required fields of information:
fields |
light |
line |
patch |
regular |
surface |
text |
type |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
tag |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
lat |
![]() |
![]() |
![]() |
![]() |
![]() |
|
long |
![]() |
![]() |
![]() |
![]() |
![]() |
|
map |
![]() |
![]() |
||||
maplegend |
![]() |
|||||
meshgrat |
![]() |
|||||
string |
![]() |
|||||
altitude |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
otherproperty |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Some fields may contain empty entries, but the fields themselves must exist for the object to be displayed correctly. For instance, the altitude
field can be an empty matrix and otherproperty
can be an empty cell array. The tag
field must be a string not equal to the name of the object type (i.e., line, surface, text, etc.). For complete descriptions of these fields and the object types, consult the geographic data structure
reference page in the online Mapping Toolbox reference documentation.
The usalo
workspace contains several variables in the geographic data structure format:
load usalo conus conus = lat: [4392x1 double] long: [4392x1 double] type: 'patch' tag: 'ContinentalUnitedStates' otherproperty: [] altitude: [] stateborder stateborder = lat: [2345x1 double] long: [2345x1 double] type: 'line' tag: 'StateBorder' otherproperty: { 1x1 cell } altitude: [] greatlakes greatlakes = 1x3 struct array with fields: type tag lat long altitude otherproperty
The structure conus
contains a patch object of the continental U.S.; greatlakes
consists of three patches representing the Great Lakes, and the structure stateborder
contains line vector data for the state boundaries.
These can be displayed with the displaym
function:
axesm('MapProjection','lambert','MapParallels',[],... 'MapLatLimit',[23 52],'MapLonLimit',[-130 -62]) displaym(conus) displaym(greatlakes) displaym(stateborder)
The map shown here is virtually identical to that of a previous example in which the vector variables uslat
, uslon
, gtlakelat
, gtlakelon
, statelat
, and statelon
were used:
Now display all 50 states and the District of Columbia using the patches located in the geographic data structure variable state
:
Here is the map in a Trystan Edwards Cylindrical projection:
To view individual states that reside in the state
structure, you can either use the displaym
function:
Or you can extract and display the data from the formatted structure yourself:
![]() | Draping Data on Elevation Maps | Interacting with Displayed Maps | ![]() |