Mapping Toolbox | ![]() ![]() |
Encoding a Regular Surface Map
Encoding is the process of filling in specific values in regions of a matrix map up to specified boundaries. For example, you can fill in the interior of an island, bounded by its coastline, with the value six. Encoding entire regions at one time allows indexed maps to be created quickly. Some parts of this process are automated in the vec2mtx
and country2mtx
commands.
A regular matrix map can be encoded using the seedm
tool. To encode the map of Japan just created, activate the seedm
tool by typing the following:
A new figure window displays the surface map of Japan.
Currently, your map consists of 1's where there is a coastline and 0's elsewhere. Suppose you would like different values for four types of data: coastlines = 1, Japan = 2, water = 3, and other countries = 4. Enter the values 0
and 2
in the From/To boxes and press Change. This will change all values of 0 to 2.
To encode the regions of water, enter a 1 in the # of Seeds box and a 3 in the Value box. Press Get, and a cross hair will appear on the map. Position the cross hair over a region of water and click.
Press Fill In, and all values corresponding to water will be changed to 3.
Encode the other countries, there are three regions that will need to be filled with the value 4. Encode the large region of Russia, China, North Korea, and South Korea in the upper left of the map and the Russian Island of Sakhalin at the top of the map in a single step by using two seeds. Enter a 2 in the # of Seeds box, and a 4
in the Value box.
Press Get and the cross hair appears. Click in the first region at the upper left of the map.
For the second seed, click inside Sakhalin Island.
Press Fill In, and the values corresponding to those two regions will be changed to 4. The last region you need to encode is the small Kuril island that appears to the east of Hokkaido in the upper right corner of the map.
Drag the zoom box over the island and double-click to zoom in.
Because the island is so small, and much of its shape consists of coastline, this zoomed-in view will make it much easier to select the interior of the island, rather than its coast.
From this view, you can also see that you missed a spot on Sakhalin Island (see mouse pointer in the picture above), so you will need two seeds for this step. Enter a 2
in the # of Seeds box and a 4
in the Value box. Press Get and click inside the missed region of Sakhalin Island and inside the Kuril island.
Press Fill In and the values corresponding to those two regions will be changed to 4. The final map appears as follows:
Press the Save button and enter the variable name map
to replace the old matrix map of Japan with this new encoded map. The Seed Map dialog box can now be closed.
![]() | Constructing Personalized Map Data with GUIs | Creating a Personalized Colormap | ![]() |