Tuesday concept lecture. Thursday is the hands-on session, where students build and edit these layers themselves in QGIS.
Set expectations. This is the concepts day; the hands-on work happens Thursday. Reading is Bolstad & Manson chapter 2, Data Models, which this lecture follows closely.
Set up the hour: we look before we name things. Have UtahCountyData.zip already unzipped on the presentation machine if you plan to show it live; otherwise the next six slides are the same walkthrough as screenshots.
Ask of the boundary: where does the county end? Roads have length but no area; a tower is a location and nothing more; the attribute table has one row per tower and one column per fact; every raster cell holds one elevation. Keep this to about five minutes as a look, not a tutorial; students do the full version Thursday in the Thursday hands-on session. Drag layers in one at a time and ask the same question after each: what did the computer have to store to draw that? The next six slides are backups of every step in case the projector or QGIS misbehaves.
One feature. The computer stored an ordered list of coordinate pairs that closes back on itself.
Ordered lists of coordinate pairs that do not close. Length, but no area.
One coordinate pair per tower. Ask what a point cannot tell you: size, shape, orientation.
One row per tower, one column per fact. Select a row and the tower lights up on the map: the geometry and the attributes are linked by that row.
A regular grid. Every cell holds a number, here elevation in meters. There are no features to click on, just cells.
This is the payoff view. Points, polylines, polygons, a table, and a raster in one project.
Leave this slide up while you move into the abstract material. Every later section, the airplane, the river, Colorado, can point back at these five panels.
Ask them to picture the cellular towers layer from the demo. What did QGIS actually have to store for each tower? Just a coordinate pair.
Introduce both ideas here, then take them one at a time on the next two slides. The demo file names make this concrete: UtahCountyMajorRoads.shp is the file format; "polyline" is the data model. The same roads could be stored as .gpkg or .geojson and still be polylines.
Roads = an ordered list of coordinate pairs. Boundary = the same, but the last pair repeats the first to close the ring. Point back at the demo screenshots if anyone needs to see it again. Nothing here says how the numbers are written to disk; that is the next slide.
Open the unzipped data folder in Finder or Explorer and count the files that make up one shapefile: .shp holds the geometry, .dbf the attribute table, .shx the index, .prj the coordinate system. Lose the .dbf and the roads still draw but the attribute table is gone. Contrast with the DEM: one .tif file (the .tfw and .aux.xml are optional helpers). GeoPackage is what Lab 4 uses later in the course.
Refer straight back to the demo: they have already seen a point, a polyline, a polygon, a table and a raster on screen. Now ask what those five things have in common: each is a simplification of Utah County, not Utah County itself.
The Vultee P-66 Vanguard was a United States Army Air Forces fighter aircraft. It was initially ordered by Sweden, but by the time the aircraft were ready for delivery in 1941, the United States would not allow them to be exported, designating them as P-66s and retaining them for defensive and training purposes. Eventually, a large number were sent to China where they were pressed into service as combat aircraft with indifferent results. But it is still a cool looking airplane that is interesting to consider from a "modeling" point of view.
Vultee airplane factory video. Click the thumbnail to open it in a new tab.
What information can you gain from each model of the Vanguard P-66? What is left out?
Answer is D. A flying model tells you about aerodynamics, the display model about proportions and paint, the toy about almost nothing. The best model depends on the question you are asking. Option A links to a video of a model airplane flying.
How is this a "model" of a Vanguard P-66 airplane? Is it an abstraction of reality? Could it be considered a model? What information can you gain from this model that the photos and toys cannot give you?
This is a rafting ride on the Lochsa River in Idaho during spring runoff 2024 (May 19, 2024). Is this video "reality" or a "model"? It is a video of reality, but it is actually a model: a representation of reality.
This is the Lochsa River in northern Idaho. A photo is a raster: a grid of pixels, each holding a color.
Watershed boundaries and stream lines: vector polygons and polylines.
Here is another representation of the streamflow in the Lochsa River at the same time: the USGS gage table and hydrograph. Which "model" gives you more information, the video or the plot? What kind of information is provided in both? What is not communicated in each?
Look at this state outline. Anyone know which state it is? Right, Colorado. How did you know? Spatial reasoning based on the shape and the location of Denver. How can we represent this state shape using the fewest bytes of memory possible? Let's digitize the corners. I have to measure them from some point of origin; for this example I measured distances from an origin at the exact center of the image. We also need to know the units. Here the units are inches, so we would need to scale them up to kilometers to make this "geolocatable".
Brigham Young proposed the state of Deseret in 1849, a few years after arriving in the Salt Lake Valley. On 4 May, 1896, Utah became the 45th state admitted to the Union.
Give students five minutes in pairs. Have a few groups show their encoding on the board before revealing the next slides.
Given just these coordinates, we can come up with a numeric representation of the shape. Why are there five rows in the table? Because we need to "close" the polygon. This is typical of spatial data representation in most data models. It takes 8 bytes (64 bits) of memory to hold a single double-precision real number, so how much memory is required to store this polygon? 80 bytes. How accurate is this representation of Colorado? Not very. The red lines are straight and the black lines are curved. But isn't Colorado a rectangle? The data are projected. We learn about projection systems and distortion in a later week.
Here is another way to represent the geometry of the state. What method is this? A polar (radial) coordinate system: we assume one point at an origin and measure the distance and angle to each of the other points in sequential order. L is the length and theta is the angle measured from due east.
Another way: triangles. In what case would this be a very efficient method for representing data? You can use triangles to represent 3D objects like an elevation surface really efficiently, because it uses fewer triangles in large flat areas and more triangles in rough, highly varying areas. For a video game, for example, it is most efficient to represent objects and terrain as triangles with textured images on the faces.
A mesh of triangles. Big triangles where the surface is flat, small ones where it curves.
The three hands are the same shape at 25,000, 5,000 and 500 vertices. Ask which one you would choose for a video game versus a surgical simulator.
Terrain as a TIN: exactly how game engines and many engineering surface models store elevation.
Another way to represent Colorado: a raster. A raster is a regularly spaced grid of values. The raster has to be completely filled in, so you need to specify which value means "no data". Here 0 means no data and 1 marks the state. What is good about it? Fast, easy to fill in. What is bad? Pixelated borders and a lot of memory. How many bytes? 360 here. Is this a "better" data model? Does the additional storage result in more accuracy? No.
What do you think of the higher-resolution raster? Does it make sense to represent a polygon with a raster data model? No? Then what kind of data would it make sense to represent with a raster?
Digital photos are raster images. Each pixel has a different value from the one next to it, representing a different color. Raster works really well for digital photos.
Raster. Each cell contains a temperature value; the colors are drawn by the GIS software based on the value. Temperature is continuous: it has a value everywhere, which is exactly what a raster stores.
Predicted wave heights and propagation times for the 2011 Fukushima earthquake, from NOAA. Another continuous surface: every cell of ocean has a value.
How about terrain? Ask students what they would need to store to describe this valley to a computer, then go to the next slide.
Raster: a regular grid of elevation values drawn as a wireframe surface. Compare with the TIN terrain slide: the grid here is regular, the TIN was not.
The summary slide. Discrete things you can count (towers, roads, parcels) are vector. Things that vary everywhere (elevation, temperature, imagery) are raster. TINs are a compact way to store surfaces for 3D work.
Preview of Thursday. The Thursday session students create and edit vector layers with the data from today's demo.
Fill in the quiz due date and the current lab before class.
Five minutes, in pairs, then a show of hands on the two worth arguing about: whether the raft video is a model, and whether the 360-byte raster of Colorado is better than the 80-byte polygon. If the room has no signal, put the URL on the board or read the items aloud. The page is linked from the Week 2 page too, so anyone who misses the scan can find it after class.