Taller 2
Taller 2
What You’ll Produce: Two maps, 1) of three different statewide projections, and 2) reprojected
county boundaries and lakes in central Minnesota, and 3) a worksheet that records areas and
coordinates under various projections.
Observing How Shapes and Distances Changes with the Map Projection
Start QGIS.
This should display a drop-down list. Left click on Properties in the dropdown list and click on
CRS in the left-most panel (red arrow, figure on the following page).
A pane near the top lists recently used coordinate systems, the middle one lists those
suggested from among pre-defined coordinatesystems, and below it, details for the currently
selected coordinate system (WGS 1984, here, indicated in grey in the window). The current
data transformation, if any, is listed below (noneused here).
Although it depends on your settings, a new project will often default to a commonly used
coordinate system before you’ve added any data.
1
QGIS 3 Exercises Map Projections
Click to select the first WGS 84, with EPSG of 4326, as the default coordinate system for this
project.
2
QGIS 3 Exercises Map Projections
Any data layer that has a properly recorded, “standard” coordinate system is converted to the
Project’s default coordinate system “on the fly”. This means a coordinate projection is applied to
the data read from the disk, but before it is displayed, so that features align, within the limits of
the data’s inherent accuracy, with any other layers also displayed, even if they have different
coordinate system. This projection is “temporary” in that it doesn’t affect the data stored on the
disk – it only reprojects the data temporarily, for display. This allows us to display many data
sets even if the data sets are stored in different map projections, without having to go to the
trouble of manually reprojecting each data set and saving a new version of the data set. We can
mix data stored in different coordinate systems, e.g., a state plane system and a UTM system,
without the data misaligned.
You should remember from the course that coordinates for any location on Earth are specified
both by:
1) the projection defined for a layer’s coordinate reference system, and
2) by the geodetic datum.
3
QGIS 3 Exercises Map Projections
You may have the same coordinate reference system, but different datums, and QGIS or any
other software may balk at displaying them unless you specify which of the datums to use. Let’s
observe this.
4
QGIS 3 Exercises Map Projections
original NAD83(1986) geographic coordinate system. Select it by clicking, then Apply it.
The data don’t appear to change much, but note that they should still overlay. QGIS has
projected the Minnesota_dd data from WGS 84 to NAD 83 (1986) coordinates.
Click on Project-Properties,
select CRS, and type “albers” in
the filter option:
Select the
USA_Contiguous_Albers Equal
Area Conic, EPSG:102003 that
displays, then Apply-OK.
Automatic, “on-the-fly” reprojection can sometimes complicate analysis because some spatial
operations may not work properly, often when combining multiple data layers in different
coordinate systems. Some operations automatically reproject the data into the same coordinate
system before applying the operation, some don’t. You may get the impression the data are in
the same coordinate system when you display them together because “on-the-fly” reprojection
ensures they line up. However, they may not be in compatible projections, and your spatial
operation won’t work, and you’ll wonder why.
5
QGIS 3 Exercises Map Projections
Find and left click on the measure tool, to measure distance. It looks like a ruler and is
often by default near the upper right of the row of icons across the top of the QGIS map
pane, although as with most tools, it is dockable, so you may find it somewhere else.
Hover over Los Angeles and left click once. Move the cursor
toward New York City, you should see a line trailing back to
Los Angeles, and the distance increment in the Measure
window.
Left click on New York. The distance between the two cities
should be about 3,940 kilometers.
6
QGIS 3 Exercises Map Projections
7
QGIS 3 Exercises Map Projections
Place the minn_county.shp file in your data frame. You should see a
county map of Minnesota displayed in your screen, similar to the
figure to the right.
Note in the lower right corner of the main window frame, the EPSG
is set to 26915. If you look at the minn_county.shp coordinate
system (right click on layer in TOC, then Properties→ Information,
CRS), you see that this is the NAD83 (original), UTM zone 15N
coordinate system.
Move your cursor around the screen and notice the coordinate
values in the narrow window below the main data pane, at the
lower-center (see right).
Note how the coordinates change when you move the cursor. The program displays the map
projected coordinate values corresponding to the cursor position. These data in the
minn_county shapefile are in UTM NAD83 projection. Each coordinate value is measured in
meters, so a value X = 512,349 indicates an X value of 512,349 meters to the east of the origin.
I might have another data set of roads, or cities, which is stored in geographic coordinates
(latitude/longitude), or in state plane Minnesota South Zone coordinates, and more data in
another coordinate system, e.g., and Albers conformal conic projection. We already learned that
when we load these data to the QGIS map canvas, they are converted on-the-fly to the current
canvas coordinate system, in this case the NAD83 zone 15N coordinates. Let’s verify this.
Add the data file minn_count_dd.shp. Note it has the same shape as the
previous data set. Look at the layer’s Properties->Information, and note
that it is in the WGS84 – Geographic coordinate system. It doesn’t change
shape because it is projected on the fly.
Notice how the Minnesota’s shape changes, becoming shorter and wider?
This is because the geographic system, plotted on a Cartesian grid,
represents the state differently than the UTM projection system. Shapes,
areas, distances, and directions usually change when you change a
coordinate system.
8
QGIS 3 Exercises Map Projections
When successful, a
window pops up that
allows us to specify,
among other things, the
output coordinate
system:
When you click OK, the new data layer named MinnCounts2UTM.shp (see File name in
figure above) should be created and displayed over the existing layer. Note that the new
data doesn’t change shape, as the input data (in the UTM 15N coordinates) are
changed on-the-fly to the coordinate system we have currently specified for this QGIS
Project, still set as WGS84 geographic coordinates. Check the new data layers TOC-
>properties->Information to make sure the CRS has been set to NAD83/UTM 15
coordinates.
Create two new versions of the Minnesota county data layer, using the “Export->Save Features
As” method shown above,
9
QGIS 3 Exercises Map Projections
10
QGIS 3 Exercises Map Projections
This should display an attribute table, with a row for each county, and a column for each
variable reflecting data values for that county. The county name is a column near the center of
the table:
Notice the row of icons at the top of the attribute table. We will be using two in this exercise:
Toggle edit (left arrow), and column abacus/calculator (right arrow below).
2) Click the calculator (abacus icon in figure) to open a window, and use that window create a
new column and compute the area for each county polygon.
The area calculation defaults to the units (meters, feet) used in your data layer. If the
coordinates are specified in meters for your projection, the calculator will default to square
meters in the calculated column. If you want to calculate hectares, square kilometers, or acres,
will have to add suitable conversion factors to your calculation.
11
QGIS 3 Exercises Map Projections
You can change the default output units, and change the kind of area calculated, via a Project
setting.
Open the Project properties, then select the general tab. About half-way down the menu there is
a measurements section, expand it if need be, and then look at the Ellipsoid setting:
Click on the caret to open the ellipsoid list, and scroll to the very top, to None/Planametric:
Selecting this option will ask for area calculations using Cartesian equations .
12
QGIS 3 Exercises Map Projections
If you have set an ellipsoid, usually the GRS80 or WGS84, then a more complicated set of
ellipsoid-based calculations will be performed. Here we’ll use None / Planimetric. Select then
Apply this option, then close the Project-Properties windows.
Go back to the open table for your Minnesota UTM data layer, toggle for editing, click the
abacus/calculator icon and click on the menu option to create a new field. This will open a field
calculation window (figure below). You may create a new field, or update an existing one. We’ll
create a new one now. Here fill fields with AreaSqKm for name, type=Decimal, field width=14,
and precision=2.
There is a function list (lower right panel), and an expression window (lower left panel). You
create an expression by clicking and typing on operators, variables, and numbers.
13
QGIS 3 Exercises Map Projections
We will specify the same map scale across all three maps, so you can see how different
projections change the size, shape, and orientation of a data set.
Open a new print composer (as last week, Project - New Print Composer)
This should open a Layout window. Load any one of the three data sets you created
above into the data window, and modify the symbology to something you like. Then:
Add a new map to the layout, with the map box spanning about a third of your horizontal
width of your page.
If you activate the Item Properties tab, you’ll see that you
can alter the scale, coordinate system, rotation, and
other map characteristics.
Finally, check mark the Lock layers and Lock styles for
layers near the bottom of the layers section (arrow), and
then check the item at the top (blue arrow) to lock the
map. In theory, the lock layers/styles should keep the
symbols from changing, but at the time of this writing, the
map sometimes changed color when we modified other
maps.
Now activate Map 2 by clicking on it in the item list so that it has a grey colored bar through it.
Change the scale to 9000000 to match map one, and the CRS to EPSG:900913 – the Google
Maps Mercator. You may have to resize the map box by clicking on it, and dragging the handles
if your layer doesn’t fit. If you do that, note that the map scale will likely reset, and so you’ll have
to change it back to 9000000. Be sure to lock layers and styles when you’ve composed this
map.
14
QGIS 3 Exercises Map Projections
Add a third map, and this time give it a new coordinate system, EPSG: 102003 – the USA
Albers Equal Area Conic. Set the scale to 9000000.
You may have to reposition the layer within the map. You
can use the “interactively edit map extent” button to change
the location within the map. If you inadvertently change the
size, you can go back to the scale window and reset it to
9000000.
Label the three maps with text boxes to create a layout similar to that shown below.
Notice how the Mercator projection renders a state and counties that are much larger than the
other two projection.
Also note that although the U.S. Albers is about the same size as the UTM Zone 15N version of
Minnesota, it is slightly smaller, and slightly rotated counter-clockwise.
These are visual illustrations of the important observation that changing a map projection will
usually change the shape, size, and orientation of any feature.
15
QGIS 3 Exercises Map Projections
A more insidious problem arises when a data layer has an erroneously documented projection.
The data are in one projected system, but the metadata for the data say it is in another
coordinate system.
Also note that there is a question mark listed with the layer in the
Table of Contents, with an outlined globe and “hat” behind it:
16
QGIS 3 Exercises Map Projections
Right click on the vector layer in the TOC, and then select Properties -> Source.
This should display a window with a line that notes that there is an invalid projection, and our
familiar projection globe to its right:
-Click on the Choose button, then from the familiar list of possible coordinate systems, select
the EPSG:26792 - NAD27/Minnesota Central coordinate system.
-Click OK on the various menus to apply the change, until the menus are closed and the main
project window is displayed.
17
QGIS 3 Exercises Map Projections
Albers:
Google Mercator:
18