Mapping Toolbox | ![]() ![]() |
Low-Resolution World Atlas Data
The worldlo
global atlas data contains a set of very small-scale (approximately 1:30,000,000) data for use in global displays. The data is provided in the form of Mapping Toolbox geographic data structures containing national boundaries, rivers, lakes, and cities. Here is a list of the structures in the worldlo
workspace:
load worldlo whos
The data has been classified into Drainage (DN), Political/Ocean boundaries (PO), and Populated Places (PP). The data is further separated into structures containing patches, lines, points, or text.
In addition to containing more kinds of data than coast
, this dataset is also more detailed. The drainage data consists of about 7,000 points, while the political lines and patches each have about 30,000 points. There are more than 200 political units in the political data and more than 300 major cities in populated places. Because of the quantity of data, complicated displays may take longer to project and render. Displays of patches require the greatest memory and computing time.
The contents of the structures can be displayed from the command line using displaym
. For example, type the following:
The map displays the coastlines, international borders, and major cities of the world. We could also label the cities with data from the PPtext
structure, but at this scale, the result would be unreadable. When we restrict ourselves to a smaller geographic region, more information can be shown:
figure axesm('Mapprojection','eqaconic','MapParallels',[],... 'MapLatLimit',[30 60],'MapLonLimit',[-15 45],... 'MLabelLocation',15,'MLineLocation',15,... 'PLabelLocation',15,'PLineLocation',15,... 'GColor',.5*[1 1 1],'GLineStyle','-') framem; gridm; mlabel; plabel displaym(POline) displaym(PPpoint) h = displaym(PPtext); trimcart(h)
The zoomed-in region of Europe allows the names of the major cities to be read more easily:
Note
Unlike vector and matrix data, text objects are not automatically trimmed when they fall outside the map frame limits. You can remove them using the trimcart function or some other method (e.g., click-on-text and deletem(gco) , or use click-and-drag tools).
|
There are other ways to represent political data. We can display the countries as patches, label them with strings from the POtext
structure, and pick random colors for the patch faces. Clear the previous line map, and redraw the patch map:
Note how the separated parts of countries are filled with the same colors. Sardinia and Sicily, for example, are shaded the same color as the boot of Italy. This is accomplished automatically because each of the components is tagged as "Italy."
Every element in a worldlo
structure has a tag field. Drainage data has been tagged to distinguish between rivers and lakes. The political/ocean lines are tagged as coastlines or international boundaries, and the political patches have been tagged with the names of the country. Both of the functions displaym
and mlayers
use the same colors for similarly tagged objects if no otherproperty
is specified in the geographic data structure.
In the following example, it is evident that the many islands of Indonesia and Canada are similarly colored, as are all parts of the United States:
There is also a corresponding set of patches for the oceans. These can be used to blank out objects in ocean areas. The data is stored separately in the oceanlo.mat
file, but it can be accessed using the worldlo
atlas function. The patches are in large tiles with few points along the edges, which may result in visible seams for non-cylindrical projections. interpm
can be used to fill in points at a sufficiently fine spacing.
[lat,lon] = extractm(worldlo('oceanmask')); [lat,lon] = interpm(lat,lon,5); axesm('bries','GAlt',-1,'MLineLocation',5,'PLineLocation',5,... 'GLineStyle','-') framem; gridm patchesm(lat,lon,'c','EdgeColor','none')
You can use the tags to reduce the amount of data in the display by selectively deleting data. This can be done by displaying all of the data in a structure and then using the tags to get the handles of the displayed objects you wish to remove. The first European example made use of this technique, as does the next one. It shows rivers, lakes, and coastlines. International boundaries have been removed using their tags:
clma axesm mollweid; framem; gridm displaym(POline) delete(handlem('International Boundary')) displaym(DNline)
Here is the map of world coastlines and drainage:
There are a number of other ways to work with the tags associated with this data. We can view the tags in the workspace by working directly with the geographic data structure.
Or we can use mlayers
and mobjects
to plot the structures, view the tags, and manipulate similarly tagged objects as a group. See GUI Tools for some examples.
The tags can also be used to extract data from the structures. The following commands extract the patch data for Canada and plot it with the political line data:
figure axesm('MapProjection','eqaconic','MapParallels',[],... 'MapLatLimit',[40 90],'MapLonLimit',[-150 -45],... 'MLabelLocation',15,'MLineLocation',15,... 'PLabelLocation',15,'PLineLocation',15,... 'GColor',.5*[1 1 1],'GLinestyle','-',... 'MLabelParallel','south') framem; gridm; mlabel; plabel displaym(POline) [clat,clon] = extractm(POpatch,'canada'); patchesm(clat,clon,'g')
Note Extracting and displaying only the desired data can reduce the time and memory required to display a map. |
The Mapping Toolbox automatically trims and saves data outside the current map latitude and longitude limits. If you use displaym
to show a small part of the world, the rest of the world data is retained within the map axes structure. Every time the projection parameters are changed, all of the world data is restored, trimmed, and projected. This overhead can be significant for a dataset as large as worldlo
. It is best to finalize the projection parameters before plotting a lot of data.
Apply the extraction technique to generate a display of Cape Cod. As was shown in the earlier examples, this data contains somewhat generalized shapes for the countries and rivers. The level of detail is great enough for global and regional maps, but the distinct data points become noticeable when displayed for smaller regions. This data should be considered accurate to no better than 10 or 20 kilometers. For more accurate data, see the usahi
atlas data or the high resolution data accessible through the external interface described in External Data Interface.
figure axesm('MapProjection','mercator','Frame','on',... 'MapLatLimit',[41 44],'MapLonLimit',[-72 -69]) gridm('MLineLocation',1,'PLineLocation',1) mlabel('MLabelLocation',1); plabel('PLabelLocation',1) h = displaym(POpatch,'united states'); set(h,'FaceColor',.5*[1 1 1])
There are some more convenient ways of working with the worldlo
atlas data. The worldmap
function makes it easy to create map displays. Just specify the region or country you wish to map. This function will handle the cartographic details like selecting a projection, setting the map limits, and setting the origin and the grid and label spacings. You can also use the worldlo
interface function to load one of the atlas data structures as an argument to a function, or load just that structure into the workspace. Make a map of Africa with filled patches, and add the locations of major cities to the display.
The worldlo
atlas data can also be used to look up names and locations. All of the names mentioned in the POtext
and PPtext
structures are collected in a gazette structure, which can be queried using extractm
. For example, the location of the city of Antananarivo on the island of Madagascar can be found by using the following commands:
[lat,long,indx] = extractm(gazette,'antan'); gazette(indx) ans = type: 'line' otherproperty: [] tag: 'Antananarivo' string: 'Populated Place Name' altitude: [] lat: -18.9141 long: 47.5258
A much more extensive gazette feature can be found in the Digital Chart of the World (DCW), containing more than 10,000 names, compared to about 500 in the worldlo
MAT-file. See External Data Interface for more information on the DCW.
![]() | World Vector Data | High-Resolution World Atlas Data | ![]() |