GIS in the Sciences ERTH 4750 (38031) MapInfo Professional: Viewing and analyzing data Xiaogang (Marshall) Ma School of Science Rensselaer Polytechnic Institute Friday, February 01, 2013

Download Report

Transcript GIS in the Sciences ERTH 4750 (38031) MapInfo Professional: Viewing and analyzing data Xiaogang (Marshall) Ma School of Science Rensselaer Polytechnic Institute Friday, February 01, 2013

GIS in the Sciences
ERTH 4750 (38031)
MapInfo Professional:
Viewing and analyzing data
Xiaogang (Marshall) Ma
School of Science
Rensselaer Polytechnic Institute
Friday, February 01, 2013
Acknowledgements
• This lecture is partly based on:
– MapInfo Professional 11.0 User Guide
– The online learning course of MapInfo Professional
• Session 1: Viewing data
• Note: at the end of this session the student is
requested to show the result of ‘Dynamic link
among multiple map and browser windows’
Contents of session 1
• 1 Map objects
• 2 Layer control
• 3 Make selections
1 Map objects
• Maps, layers and map objects
– Maps are made up of map objects which are organized
into layers
– Four types of map objects in MapInfo: Text, Points,
Lines and Polygons
– Generally, a layer contains only one type of map object
– Maps are often built with layers of those four object
types in descending order: with text on the top and
polygons on the bottom
– Each layer is related to a table
• Text
– Can be used to illustrates what a point, line or polygon
represents
– Text can come from the table related to a layer or can
be custom made
• Points
– Refer to one specific location and represent one set of
X/Y coordinates.
• Lines
– Have a start point and an end point, each representing
a set of X/Y coordinates.
– Lines may change direction at a point which also
represents a set of X/Y coordinates
• Polygons
– Are enclosed areas made up of lines and points, with
each node represents a set of X/Y coordinates
– The start point will be the same as the end point to
ensure that the polygon is closed
2 Layer control
• The Layer Control dialog box
– Controls how layers are
displayed and how they
function
– Can change the order of
layers, their appearance and
their labeling options
– It’s recommended to save a
workspace if make changes
through Layer Control
A label differs slightly from a text object. A label is placed with the label tool or the Auto Label in
Layer Control and always remains the same size, regardless of zoom level. It is always data
from the browser. A text object is written manually on an editable layer and increases in size
when zoom in.
• Practice with Canada dataset
–
–
–
–
–
Menu: File -> Open, or click the toolbar button
Goto \Training_Data\Canada folder
Choose CANADA.tab and open it in a map window
Goto \Training_Data\Canada folder
Choose CANHIWAY.tab, CANCTY223.tab and
CAN_CAPS.tab, and change the Preferred View dropdown list to No View, click Open
– These three layers are opened but not added to the
map window yet – we will do that using Layer Control
– Menu: Map -> Layer Control, or
click toolbar button
– The Layer Control dialog box
displays
– Click the Add Layers button to
open the Add Layers dialog box
– Add layers: Select CANHIWAY,
CANCTY223 and CAN_CAPS,
click OK to add them into the map
– Remove layers: In Layer Control dialog box, select
CANCTY223
– Click the Remove Layers button
– Confirm the removal
– We can also move a layer up or down in the order of a
map, by selecting it in Layer Control and using the Up
and Down buttons. We can also click and drag a layer
• Change the appearance of a layer
– It is possible to do this without permanently changing
the table
– Menu: Map -> Layer Control, the dialog box opens
– Select the CANADA layer
– Click Layer Properties, the dialog box opens
– Check the Style Override check box to override the
default style of a layer
– Click the Region Style button and the Region Style
dialog box displays
– Under Fill, click the Foreground list
– From the color palette, choose a new color, click OK
– You can click Preview to see what your map looks like
with the chosen settings
– Click OK to accept the Display Options. The display
changes are reflected in the Map window.
3 Select map objects
• We may be working with large datasets and wish
to work with only a smaller number of records.
– We can select certain map objects to create a subset of
the data
– Records in a Browser are dynamically linked to objects
in the Map (and vice-versa) by the .ID file of the
MapInfo Professional file structure. This means that by
selecting an object on a Map, you also select a record
in the Browser, and if you select records in a Browser,
you also select an object on the Map
• We mentioned this diagram in our last lab, now
let’s see how it works
– Menu: File -> Close All
– Open the CANADA.tab in folder \Training_Data\Canada
– Window -> New Map Window to open the Map window
for CANADA
– Window -> New Browser Window to open the Browser
window for CANADA
– Map -> Layer Control, in the Layer Control dialog box,
make sure that objects in layer CANADA are selectable
– Close the Layer Control dialog box
– Window -> Tile Windows
– Now we can do selecting
• A few buttons in the toolbar for the Select function
– The Info tool can help you get information about a
single map object
– There are also some other tools that affect selections
• View a table of selected objects
– Use the Select tools to select multiple objects
– Menu: Window -> New Browser Window, the Browser
Table dialog box opens
– Choose Query1 (or Selection) and click OK
– This opens a new Browser showing the currently
selected records (i.e., a subset) and names it Query#.
Notice that the dynamic link is still maintained
– Window -> New Map Window, choose Query1 and
open a new map window for it
– Window -> Tile Windows
– Use the Selection function to select objects and records
in the two map windows and two browser windows to
see the dynamic link among them
GRADING ITEM: Student should
present a result after Session 1
• Result should be similar to this window
Dynamic link among multiple
map and browser windows
Hints: save you results to a workspace
for a backup, and you can continue with
other works
• Session 2: Analyzing data
– In previous sessions we know how layers and map
objects work, we now start turning data into information
– Note: at the end of this session the student is requested
to show the results of ‘Selection’ and ‘Thematic maps’
Contents of session 2
•
•
•
•
•
Analyze data with a selection based on criteria
Save a query
Analyze data with thematic maps
Change thematic map settings
View the thematic maps in layer control
1 Selection based on criteria
• Select based on numeric data
– We can choose specific records from data based on criteria. This
type of selection is called a Query
– We will query the US_CUSTOMER data based on the order
amount, to find out which customers have spent more than
$10,000.
– Menu: File -> Close All
– File -> Open, go to \Training_Data\Exercise_Data\ folder, choose
Us_Customer.tab
– In the Preferred View drop-down list, choose Browser, and click
Open. The Us_Customer table is opened in a Browser window
– Menu: Query -> Select, the Select dialog box opens
– Choose Us_Customer in the Select Records from Table drop-down
list
– The query expression is entered in ‘that Satisfy’ text box. You can
type the query directly, or click the Assist button to open the
Expression dialog box, which helps us in creating the scripts of a
query
– Use the combination of the Columns, Operations and Functions
drop-down lists to create the criteria. In this example, we make a
expression Order_amt > 10000
– Click Verify button to check your syntax and make changes if
necessary
– Click OK to return to the Select dialog box. The query expression is
now in the ‘that Satisfy’ box
– Ensure that Browse Results is checked so that a browser displays
the selected data
– Click OK when finished and a new Browser appears. Read the
results (i.e., records in the column ‘Order_amt’) and ensure that
they fulfill the query expression. The result is named Query#
– Now you can also use Window ->
New Map Window to open a map
window for Us_Customer to see
the highlighted query results
on a map
• Select based on character data
– We can also create a query with criteria based on text information
in the table (e.g., name of the company)
– The process is almost the same as the selection based on numeric
data. And again we use the Us_Customer.tab as an example
– Menu: Query -> Select
– Choose Us_Customer from the Select Records from Table list
– Click the Assist button, make a expression Lname = “Williams”
– Using Verify to check the syntax and make corrections if
necessary, click OK
– Leave the defaults in the Select dialog box and click OK to run the
query
– Now you can also open a map
window to see the query
results
– For instance, here I have the query results in a browser window
‘Query 3’, and I open a map window ‘Query 3’ for it (Your result
may not necessarily have the same name)
– And you can load other map layers into the current map window
to make the view nicer
– Menu: File -> Open, choose the STATES.tab in folder
\Training_Data\US\, choose Current Mapper from Preferred View,
click OK
GRADING ITEM: Student should
present a similar result
– Menu: Map -> View Entire Layer, you will see a window like the
one below. This show the query results with the states map in the
background
Hints: save you results to a workspace
for a backup, and you can continue with
other works
2 Save a query
• The query result is still a temporary table. It can be saved
as a copy of the table, or be saved in a workspace
• Save a copy of the table
– Menu: File -> Save Copy As, choose appropriate Query# (i.e.,
query result name) and click Save As. The Save Copy As dialog
box displays
– Go to the location you wish to save the file, give a name and click
Save
• Save a workspace
– Menu: File -> Save Workspace. The Save Workspace dialog box
displays
– Go to the location you wish to save the workspace and lick Save
• What’s the difference between the above two operations?
3 Analyze data with thematic maps
• Thematic maps are an excellent way to view trends in
spatial data
– Graphically present the information hidden in a table
– Shade the map based an attribute in the data
– Can be created using point, line or polygon
– You can also present information in the form of a pie graph or bar
chart, a graduated symbol (i.e., the size gets bigger as the numeric
data it represents gets larger), dots on a map (i.e., one dot
represents fifty people) or as a grid (i.e., a surface interpolated from
a series of points which might have elevation information)
• There are three major steps in the process of creating a
thematic map:
– Select the type of thematic map, select the table, specify the setting
• (1) Select the type of thematic map. There are seven types
–
–
–
–
Ranges: Each color represents a range of numeric values
Bar charts: A bar graph is placed over each object being shaded
Pie charts: A pie chart is placed over each object being shaded
Graduated symbol: Symbols of different sizes are used to
represent the magnitude of the data
– Dot density: Dots are placed in a boundary map so that the total
number of dots represent that region’s data value
– Individual: Each unique value is given its own color or symbol
– Grid: A surface thematic interpolating point data over a region
– With each type of thematic map, MapInfo presents a number of
templates. You can also create your own by adapting existing ones
• (2) Select the table to create the thematic map. Select the
column in the table that contains the information you wish
to use for the thematic map
• (3) Specify the settings for the map. These include settings
specific to the type of thematic map and settings for the
thematic legend that will be created
• Create thematic maps based on numeric data
– We use the world population 1994 data for an example study. The
population is numeric data and can be grouped into Ranges
– Menu: File -> Close All
– File -> Open, Go to folder \Training_Data\World, choose
OCEAN.tab, WORLD.tab and WORLDCAP.tab
– Choose Automatic in Preferred View list, and click Open
– Map -> Layer Control, make sure the three layers are in the correct
order (i.e., don’t let the ocean layer cover the world layer), then
close the Layer Control
– Map -> Create Thematic Map, the dialog box displays
– We now can choose types of thematic map and templates for the
chosen type. We should choose one that is appropriate for the
thematic map we are creating
– Ensure the Ranges button is selected under Type
– From the Template Name list, choose Region Ranges Default. This
template will assign dark reds to countries with higher populations
– Click Next. The Create Thematic Map – Step 2 of 3 dialog box
opens
– Select World in the Table list, and Pop_1994 in the Field list
– Check Ignore Zeroes or Blanks to ensure that any countries with
missing population information is not counted in this thematic map
– Click Next, the Create Thematic Map – Step 3 of 3 dialog box
displays
– This dialog box actions as a preview window. It show what the
ranges will look like, how large the ranges are, and how many
records are in each range. Here you can also specify the settings
for the ranges, styles and legend
– Click OK to accept the default settings. The map displays
4 Change thematic map settings
• There are up to three groups of settings that can be
changed:
– Ranges, styles and legend
• There are three ways to return to a thematic map to
change its settings:
– Double click on the thematic layer in Layer Control
– Double click the thematic legend
– From the Map menu, choose Modify Thematic Map
• Ranges control how the numeric data is organized into
groups. There are six range methods:
– Equal count: the same number of records are in each range
– Equal range: each range is the same size
– Natural break: each range has data values that are fairly close
together (The average of each range is as close as possible to
each of the values in that range)
– Standard deviation: ranges meet at the mean and at standard
deviation intervals from the mean
– Quantile: ranges are distributed across another segment of your
data by a percentage
– Custom ranges: you define your own ranges
• Some experimentation may be necessary to find the
method that works best with a certain thematic map
– With the map window active
– Menu: Map -> Modify Thematic Map, the dialog box opens
– Click the Customize: Ranges button. The Customize Ranges
dialog box opens with the default settings from the chose template
– From the Method drop-down list, choose Equal Count
– From the # of Ranges drop-down list, choose 5
– From the Round By drop-down list, choose 10,000,000
– Both the number of ranges and the rounding number should be
based on the underlying data, and may take some experimentation
to make them suitable for your needs
– Once changes are made, a message ‘Press <Recalc> button to
recalculate ranges.’ appears, and the OK button changes to the
Recalc button. This step allows MapInfo to recalculate how the
data falls within the new range settings.
– Click Recalc
– Click OK to return to the Modify Thematic Map dialog box. The
preview window now reflects the changes made to the ranges
– Click OK to redraw the map
• The result is like the window below
• The style setting controls how the thematic map is
displayed
– Normally we only change the colors of the top and bottom ranges
– The Auto Spread function will not work if a color in the middle is
changed
–
–
–
–
–
Make the map active
Menu: Map -> Modify Thematic Map, the dialog box opens
Click the Styles button, a dialog box opens
Ensure that the Color option is chosen in the Auto Spread group
Click on the top button in the column (corresponding to the highest
population), the Region Styles dialog box displays
– In the Fill group, click on the Foreground list to open the color
palette
– Select a new color and click OK when complete
– Repeat as necessary to change another range (i.e., the bottom
range) from the Customize Range Styles dialog box
– Click OK to return to the Modify Thematic Map dialog box
– Click OK to redraw the map
• The legend conveys information about what is contained in
a thematic map to the map viewer
– You can make any changes to the text that appears in the legend.
You can create a more meaningful title, add a subtitle, change the
font style, add a border, edit the labels for each range, and choose
to show the number of records in each range
–
–
–
–
Menu: Map -> Modify Thematic Map
Click the Legend button, the Customize Legend dialog box displays
Make necessary changes
Click OK in all dialog boxes to
redraw the map
• We can also create thematic maps based on category data
– The type of thematic map that is used to illustrate category data is
Individual (i.e., Each unique value is given its own color or symbol)
– We will create an Individual thematic map for the WORLD table,
that will shade the map such that no two countries that share a
border will have the same color
– This thematic will be placed over the previous thematic, ranges
based on population
–
–
–
–
Ensure the map window is active
Menu: Map -> Create Thematic Map
Click the Individual button under Type
From the Template Name list, choose Region IndValue Default.
This template will assign different colors to each category
– Click Next, the Create Thematic Map – Step 2 of 3 dialog box
opens
– From the Table list, choose WORLD
– From the Field list, choose ColorCode
– Click Next, the Create Thematic Map – Step 3 of 3 dialog box
opens
– Accept the default settings and click OK to go back to the map
window
5 View the thematic maps in layer
control
• Layer Control can give you some understanding of how
thematic maps work with the underlying data
– Menu: Map -> Layer Control
– Note that the thematic maps that were just created sit above the
layer on which they are based
– A thematic map is a temporary view of your data, and it can be
saved in a workspace
GRADING ITEM: Student should
present a result after Session 2
• The student is requested to show a result similar
to the window below
Hints: save you results to a workspace
for a backup, and you can continue with
other works