Mapping Toolbox | ![]() ![]() |
Low Resolution Data
Vector political and coastline data for the United States are provided in a number of useful formats in the usalo
workspace.
load usalo whos
There are several types of data here. The double arrays are vectors of latitude and longitude points. The pair uslat
and uslon
form the outline of the coast and political borders of the continental United States. The polygon closes on itself, so it may be filled as a patch. Next, the statelat
and statelon
form the borders between the states for display as lines. Finally, gtlakelat
and gtlakelon
are patchable outlines of the Great Lakes. The commands suitable for displaying vector data of this type are plotm
, linem
, fillm
, patchm
, and patchesm
.
Display the data vectors as patches and lines:
axesm('MapProjection','eqaconic','MapParallels',[29.5 49.5],... 'MapLatLimit',[24 50],'MapLonLimit',[-130 -65],... 'MLabelLocation',15,'MLineLocation',15,... 'PLabelLocation',15,'PLineLocation',15,... 'GColor',.5*[1 1 1],'GLineStyle','-',... 'MLabelparallel','south') framem; gridm; mlabel; plabel patchm(uslat,uslon,[0 .75 0]) patchm(gtlakelat,gtlakelon,1,[0 0 .75]) plotm(statelat,statelon,'k')
The structure arrays are Mapping Toolbox geographic data structures and can be displayed using mlayers
or displaym
. The data in stateborder
is identical to that in statelat
and statelon
. Similarly, conus
contains the same outline of the continental United States as uslat
and uslon
but is defined to be displayed as a patch. The 50 state and District of Columbia patches are located in the state
structure.
Display the state
structure using displaym
. Notice the only one command is needed to plot 51 different patches.
figure axesm('MapProjection','eqaconic','MapParallels',[],... 'MapLatLimit',[15 75],'MapLonLimit',[-175 -60],... 'MLabelLocation',15,'MLineLocation',15,... 'PLabelLocation',15,'PLineLocation',15,... 'GColor',.5*[1 1 1],'GLineStyle','-',... 'MLabelParallel','south') framem; gridm; mlabel; plabel displaym(state); polcmap
The states are all tagged, allowing them to be manipulated or to be extracted by name. You can see the available state names by entering the following:
The state of Massachusetts can be displayed by itself:
Or with its neighboring southern states, Connecticut and Rhode Island:
Look at the region around Cape Cod again, to get an impression of the detail of the data:
figure axesm('MapProjection','mercator','Frame','on',... 'MapLatLimit',[41 44],'MapLonLimit',[-72 -69]) gridm('MLineLocation',1,'PLineLocation',1,... 'GLineStyle','-') mlabel('MLabelLocation',1) plabel('PLabelLocation',1) displaym(state); polcmap
There is an obvious compromise between the size of a dataset and its accuracy and detail. This data can be displayed relatively quickly for displays of all the United States, but it is not suitable for mapping smaller regions. Note the generalized character of the coastline and the absence of small islands. More detailed and accurate data is available in the usahi
workspace and through the Mapping Toolbox External Data Interface functions.
An easy way to display the usalo
data is with the usamap
function. The usamap
function takes care of the cartographic details. The inset maps of the entire United States are made with the usalo
data. Here are the fifty states displayed at the same scale.
![]() | Geoid | Medium Resolution State Outlines | ![]() |