Geog 578 Exercise 1: Introduction to MapInfo Page: 1/27 Geog 578: GIS Applications Exercise 1: Introduction to MapInfo Assigned on January 25 th , 2006 Due on February 1 st , 2006 Total Points: 10 0. Convention Used: File -> Open : click the File menu and select the Open menu item. directory\subdirctory : italic specifies the directory path or the filename. Bold face alone : button labels or window titles. 1. Overview: This exercise helps you to understand the basics of manipulating spatial data in MapInfo. At the end of this exercise, you will produce a map showing the 1991 population of Canada by province, a bar graph comparing the population changes between the provinces, and a list of provinces whose population changes are greater than 10% of the population in 1981. You will then put these items (map, graph, list) onto one page as a report (Figure 1.1). 2. Basics of MapInfo: MapInfo is a desktop spatial data analysis and visualization package. Locations and attributes of spatial entities are stored in a file (database), called a table in MapInfo. A user can visualize the data in a table in three different ways (Figure 1.2): Mapper, Browser and Grapher. Mapper (the map window) presents information arranged as conventional maps, allowing you to visualize the geographic patterns of your data. Browser (the browser window) presents information as tabular lists (just as conventional databases do), allowing you to examine tabular data fully.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Geog 578 Exercise 1: Introduction to MapInfo Page: 1/22
Geog 578: GIS Applications
Exercise 1: Introduction to MapInfo
Assigned on January 25th, 2006
Due on February 1st, 2006
Total Points: 10
0. Convention Used:
File -> Open : click the File menu and select the Open menu item.
directory\subdirctory : italic specifies the directory path or the filename.
Bold face alone : button labels or window titles.
1. Overview:
This exercise helps you to understand the basics of manipulating spatial data in MapInfo. At the end
of this exercise, you will produce a map showing the 1991 population of Canada by province, a bar
graph comparing the population changes between the provinces, and a list of provinces whose
population changes are greater than 10% of the population in 1981. You will then put these items
(map, graph, list) onto one page as a report (Figure 1.1).
2. Basics of MapInfo:
MapInfo is a desktop spatial data analysis and visualization package. Locations and attributes of
spatial entities are stored in a file (database), called a table in MapInfo. A user can visualize the data
in a table in three different ways (Figure 1.2): Mapper, Browser and Grapher.
Mapper (the map window) presents information arranged as conventional maps, allowing you to visualize the geographic patterns of your data.
Browser (the browser window) presents information as tabular lists (just as conventional databases do), allowing you to examine tabular data fully.
Grapher (the graph window) presents information arranged as graphs or charts, allowing you to visualize the purely numerical patterns.
Any changes in one viewer will be reflected in other viewers (the Hot Views Technology). MapInfo
also provides users with a Layout utility for you to organize your data in the three viewers for
presentation. Most of the spatial data analysis operations in MapInfo are done via SQL Select...
from the Query menu.
3. Viewing Data in Mapper:
3.1 Display the Map of Canada:
Geog 578 Exercise 1: Introduction to MapInfo Page: 2/22
1) When you start MapInfo, a Quick Start Dialog Box pops up. Select Open Table from the list of options in this box and then click Open. You should then see the Open Table dialog Box. Navigate to the class data folder or you can copy the data from class folder to your own storage and navigate to the folder that holds your data. You should now see canada.tab in the list at the left.
Figure 1.1: Population of Canada
Geog 578 Exercise 1: Introduction to MapInfo Page: 3/22
Figure 1.2: The Three Ways of Data Visualization in MapInfo
2) Select canada.tab. You should see now that the File Name box contains canada.tab.
3) The list underneath Preferred View allows us to set the view for displaying the data. For now, we
just leave the selection as “automatic”.
Geog 578 Exercise 1: Introduction to MapInfo Page: 4/22
4) Click Open. The map of Canada displays (Figure 1.3).
Figure 3.3: The Map of Canada
5) Use the zoom icon ( ) to change the Zoom (window width). 4550 will be a reasonable value
allowing you to see the whole country.
3.2 Using the Mapper control center (Map->Layer Control):
A Mapper typically contains two layers (a cosmetic layer and a data layer). The cosmetic layer
contains the labels, text, and other temporarily added objects. The information in the cosmetic layer
will be lost after you quit from the Mapper. However, you can save the contents in the cosmetic
layer into a table using Save Cosmetic Objects... from the Map menu. We will learn how to use this
function in other labs later in this workshop. More than one data layer can be displayed in a Mapper.
The settings of the displayed layers (including the cosmetic layer) are controlled by Layer Control
from the Map menu.
Select Layer Control from the Map menu (Map->Layer Control), a Layer Control dialog window
shows up as shown in Figure 1.4. Since we only loaded one layer (canada.tab) into the Mapper,
there are only two layers in the Layer Control window: cosmetic layer and CANADA. We will be
using the Layer Control to change the display labels for the map of Canada. For now, simply click
the Cancel button to return to normal.
Geog 578 Exercise 1: Introduction to MapInfo Page: 5/22
Figure 1.4: The Layer Control Window (Map->Layer Control)
3.3 Using the MapInfo Tools:
MapInfo has a set of tools collected under the Main and Drawing palettes (Figure 1.5). The shaded
boxes show that the tools are not available under the current situation. The box with the light grey
background and black foreground means that the tool is currently selected. To change the tool
selection, simply move the mouse pointer to the desired tool box and click the leftmost button on the
mouse.
Figure 1.5: The Tools Palette
Geog 578 Exercise 1: Introduction to MapInfo Page: 6/22
Move a map image: Select the Grabber tool ( ) and move the cursor into the map window, a
hand cursor appears. Click and hold down the leftmost mouse button and drag the mouse. The map
moves in the direction that you drag.
Zoom in and out: Select the Zoom-in ( ) or Zoom-out ( ) tool and click the location on the
map at which to zoom-in (zoom-out). (You also zoom in and out on a map by changing the value in
the Change View box ( )). You can also use the click and drag technique to zoom in on a specific
area.
Get information about a feature: Select the Info Tool ( ) from the Main palette and then click
any region about which you would like to get some data. An Info Tool window containing the
information in the database will pop up. Now select the Info Tool and click anywhere in Ontario on
the Canada map. A window shown in Figure 1.6 should pop up. You can scroll down in the window
to see other parts of the data.
Figure 1.6: Information Window
Add or remove labels: To label the provinces, you select Layer Control from the Map menu.
Highlight CANADA data layer in the Layer Control window and click Label. Check the circle
beside Arrow in the Styles section of the CANADA Label Options window. Click Ok to save the
changes and to close the CANADA Label Options window and click Ok again to dismiss the Layer
Control window. Select the Label Tool ( ) from the Main palette. Move the cursor (it becomes
a small plus sign) to Province British Columbia and click anywhere in B.C. A label, “British
Columbia” appears. Click the Select Tool ( ) from the Main palette. Click on the label “British
Columbia” and hold down the mouse button and drag the label outside of the province and then
release the button. You should see an arrow pointing to Province British Columbia from the label
(Figure 1.7). If you do not see the arrow, drag the label a bit further away from the province.
Geog 578 Exercise 1: Introduction to MapInfo Page: 7/22
Figure 1.7: Labeling Province British Columbia
To change the character attributes of the label, double-click the label. You will see a window called
Label Style. Click the font box ( ) underneath Font:. A Text Style window pops up. Check if
the Size in the Text Style window is 8. If not, click the list bar ( ) to set the size to 8. Click Ok to
save the changes and to close the Text Style window. Click the Ok on the Label Style window to
save the changes and to close the Label Style window. To remove a label, select the Select Tool,
click the label to be removed and select Clear from the Edit menu (Edit->Clear). Now create a
couple of labels and then remove them. To remove all labels, use Map->Clear Custom Labels.
Now you know how to add and remove labels, label the province and territories of Canada as shown
in Figure 1.8.
Figure 1.8: Labeled Map of Canada
Geog 578 Exercise 1: Introduction to MapInfo Page: 8/22
Add or remove text strings: Since the cosmetic layer is for holding the text strings and drawings, it
is always a good idea to make the cosmetic layer editable. To do so, you select Layer Control from
the Map menu. Highlight cosmetic layer in the Layer Control window. Check the box underneath
the pen symbol and then click Ok to dismiss the Layer Control window. To add a text string onto
a map, select the Text Tool ( ) from the Drawing palette, click on the map and type the text. To
remove a text string, select the Select Tool, click the text to be removed and select Clear from the
Edit menu (Edit->Clear). Now create a couple of text strings and then remove them. To remove
text strings, use Map->Clear Cosmetic Layer. Now you know how to add and remove text strings,
add some annotation strings to the map. It is important to know that the text strings you have added
are temporarily stored in the cometic layer which will be lost once you quit MapInfo or close the
mapper window. If you want to save the editings (the contents in the cosmetic layer) into a database,
select Save Cosmetic Objects ... from the Map menu and the Save Cosmetic Objects dialog
window pops up. Select New... for Transfer cosmetic objects to layer: and a Save Objects to
Table dialog opens up. Type in can_txt.tab in the File Name box, and click the Save button. Notice
the change in the title bar from CANADA Map to CAN_TXT, CANADA Map. This change
indicates that the Mapper now contains the contents of two tables (databases): can_txt.tab and
canada.tab. Although these two databases are in the same Mapper, they are not physically linked.
In some other labs we will learn how to add a database into an existing Mapper and join the
databases together. For now, there are just two Mapper views (one about can_txt.tab and the other
about canada.tab). Use Map->Layer Control to see the order of these Mapper views (layers). The
Cosmetic Layer is always on the top of the stack. CAN_TXT is the second and CANADA is at the
bottom of the stack. The layers are not transparent so the order is very important. Now select
CANADA and click the Up button. CANADA has moved above CAN_TXT. Click the Ok button
and observe the changes in the Mapper. You may not be able to see any of the text strings since they
are obscured by the Provinces. This is because all of the text annotations you added earlier are on
CAN_TXT while the Provinces are on CANADA. Use Map->Layer Control to move CANADA
down and click the Ok button. This should return you to the previous ordering of the layers.
Saving the Workspace: Sometimes, you want to quit for a while and come back to continue
whatever you were doing. You can save the status of your work (workspace) into a file. To save a
workspace, select Save Workspace... from the File menu. Now save your current workspace (File-
>Save Workspace... , enter lab01.wor as the file name, and then click the Ok button) and quit
MapInfo (File->Exit). Start MapInfo again and restore the work you were doing by loading
lab01.wor. To load a workspace, File->Open Workspace... and select the name of the workspace
file. You should be able to get most of your work back.
3.4 Shading the provinces:
We have learned how to display a map, how to label the map, how to use the basic MapInfo tools. In
this section, you will learn how to shade the provinces using 1991 provincial population. Select
Create Thematic Map ... from the Map menu. A window (Create Thematic Map--Step 1 of 3) as
shown in Figure 1.9 pops up. Pick the Type of thematic map, in this case Ranges; also pick the
Template, in this case Region Ranges, Solid Purpleso, Dark-Light. Click the Next> button to bring
Geog 578 Exercise 1: Introduction to MapInfo Page: 9/22
up the next step as shown in Figure 1.10. Make sure that the Table is set to CANADA and the Field
is set to Pop_1991. Use the list bar ( ) to select these.
Figure 1.9: Creating a Thematic Map
Figure 1.10: Creating a Thematic Map
Geog 578 Exercise 1: Introduction to MapInfo Page: 10/22
Click the Next> button to move to the final step. You see the third step of Create A Thematic Map
pop up with a Customize Ranges button (similar to Figure 1.11). Click the Ranges button. The
Number of ranges is defaulted to 5, but you can change the number of ranges to whatever value you
want. For this demonstration, we just use the default value (5). Now we want to customize our
colors for the map. Since we want to be boring, we are going to change our colors to a greyscale.
Click Ok to go back to Step 3 of creating the thematic map. Now click the Styles button. A window
like Figure 1.12 pops up. You will see in the styles box an individual polygon for each of the
number of ranges that you have defined. You can change the individual color of a range or the base
color of all ranges. To change the color of an individual range you must first click the button beside
None in the Auto Spread box. However, we want to change the shades of all the ranges, so leave
the Auto Spread selected on Color. Then you must click on the top polygon from the list. A
Region Style window pops up where you can change the fill color of the ranges (Figure 1.13).
Clicking the box next to Foreground in the Fill box will present a color palette from which you can
choose an appropriate color. Click Ok and you can see that you have changed the color of the
polygons in the Customize Range Styles menu.
Figure 1.11: Customize Ranges Window
Geog 578 Exercise 1: Introduction to MapInfo Page: 11/22
Figure 1.12: Styles window
Figure 1.13: Region Style Window
Geog 578 Exercise 1: Introduction to MapInfo Page: 12/22
Once you have selected the correct shades, click the Ok button on the Customize Range Styles
window and click the Ok button of the Create Thematic Map - Step 3 of 3 window, now you see a
gray scale map of Canada showing the population distribution by province. You also see a little
window labeled as Legend. You may want to resize the Legend window so that you can see all of
the legends. Now your MapInfo window should look similar to Figure 1.14. You may want to save
the Workspace before you move on.
Now we have learned the basics how to use the Mapper to display map and annotate the map. There
is a lot more you can do in Mapper. You are encouraged to explore the potential in Mapper some
other time. We now have to turn our attention to the Browser.
4. Viewing Data in Browser:
Browser is for viewing the data in a tabular form. You can open a Browser by Window->New
Browser Window. Now let’s open canada.tab into a Browser this way. Pick CANADA from the
Browse Table list and click Ok. You see a table as in Figure 1.15 opened up. You can move this
table so you can still see your map. Now you are viewing the database in a tabular form. Now click
the record for Alberta in the Browser, you see Province Alberta on the population map in the Mapper
is also selected. Whenever you select or change something in one view, the information in the other
view also changes. This is what they call the Hot Views technology.
Figure 1.14: Contents in Mapper After Shading the Provinces
Geog 578 Exercise 1: Introduction to MapInfo Page: 13/22
Figure 1.15: Browsing Database CANADA.TAB
5. Calculating Population Change (Analytical Functions):
So far, we have seen Mapper and Browser in action. The logical way to see the Grapher is by using
it. However, it might be better for us to calculate some new data for Grapher to display. In this
section, we will focus on some of the analytical functions, in particular SQL Select, which seems to
handle most of the MapInfo analytical operations.
We want to express population change between 1981 and 1991 as a percentage of the 1981
population for each province. We can calculate the change based on the following equation:
Change = (Pop_1991 - Pop_1981) / Pop_1981
We also want to create a new database to contain both this information and the information in the
original database (canada.tab) so that we will not change the contents of the original database (we
could if we want to). In other words, we have two tasks here: to calculate the change and to create
the new database. We can accomplish both tasks using the SQL Select... from the Query menu.
After you select SQL Select..., an SQL Select window similar to the one in Figure 1.16 will pop up.
Selection columns: lists the columns to be included in the output (new) database. The ‘*’
means everything from the input (original) databases.
from tables: lists the databases (tables) to be used as input databases.
where condition: specifies what records (rows) from the input databases are included in the
output database.
group by columns: groups the rows in the output table so that all rows with the same values
for the specified columns are grouped together.
Geog 578 Exercise 1: Introduction to MapInfo Page: 14/22
Figure 1.16: The SQL Select Window
order by columns: specifies the order in which MapInfo lists the records (rows) in the
output table.
into table named: specifies the name of the output table (database).
The right hand part of the figure contains five lists. Each of them contains a list icon ( ) and is
labeled as Tables, Columns, Operators, Aggregates, and Functions, respectively. These are the
list boxes from which you can select tables, columns, functions, operators, etc. Now select table
CANADA from the Tables list box. Get rid of the ‘*’ in the Selection columns box and select
Province, Pop_1981, Pop_1991, and Capital from the Columns list box. You should note that the
commas between the names of these columns serve as separators of columns. Type a comma after
column Capital and type in (Pop_1991 - Pop_1981) / Pop_1981 “Change”. There is no comma