The Relational Model
In a GIS, geometry is only half the story. The Attribute Table contains the actual information about those features. These tables are organized using a Relational Database Management System (RDBMS).
Table Joins: Linking Information
One of the most powerful tasks in GIS is a Join. By matching a common field (the "foreign key") in two different tables, we can temporarily append information from a standalone table to our spatial features. This is how we map things like Census data or health statistics.
The "Data Trap": Managing Legacy Files
In the professional world, you will inevitably encounter the "Shapefile." It is the dinosaur of GIS formats—ancient, clumsy, but somehow still alive.
A "Shapefile" is not a single file. It is a mandatory collection of at least three files (.shp, .shx, .dbf) and often many more (.prj, .xml).
The Trap: New analysts often email just the .shp file to a client. The client tries to open it, and it fails. This is the fastest way to look like an amateur. Always zip the entire folder!
The Future is Text
While Shapefiles dominated the massive desktop computers of the 90s, the modern web (and AI!) runs on text. Formats like GeoJSON and CSV are just simple text files that can be read by any computer, phone, or website. They don't require specialized drivers; they just need to be read.
- Shapefile: Binary blobs, 10-character limit on column names (from 1980s dBASE standards!), easy to corrupt.
- GeoJSON: Human-readable text, web-native, flexible structure. "Just add 'Geo' to JSON."
Available Table: `Cities` (City, State, Population)
| City | State | Population |
|---|
Regional Decision: The Hospital Database
You are designing a database for Alachua County health inspectors. You have three datasets: 1) Hospital Locations (Point Data), 2) Staff Directories (Excel), and 3) Patient Satisfaction Surveys (PDFs).
The Task: You need to create a map showing which hospitals have a "High" satisfaction rating but "Low" staff-to-patient ratios.
The Dilemma: The survey data is currently in a text-based PDF. Do you:
- A) Manually type the ratings into the Hospital Attribute table?
- B) OCR the PDF, clean it into a CSV, and perform a Relational Join using the Hospital ID?
- C) Just label the map manually in the cartographic view?
In a database, NULL means "unknown." It is NOT the same as 0. If you average a column where half the values are NULL, the computer ignores them. If you treat them as 0, you drag the average down artificially.
Example: If a neighborhood doesn't report crime data (NULL), a heatmap might show it as "Safe" (0 crimes). This is a common source of algorithmic bias.
Summary of Big Ideas
- Attribute Tables store the "what" for every "where."
- Primary Keys ensure every feature is unique and provides a reliable anchor for joins.
- Table Joins are temporary, dynamic links between spatial data and standalone tables.
- SQL (Structured Query Language) is the universal standard for interacting with geographic databases.
Chapter 07 Checkpoint
1. To successfully join an Excel spreadsheet to a spatial layer, both must contain:
2. In SQL, what command is used to filter records based on a specific condition?