Objective. Students will perform attribute queries, spatial queries, and basic feature editing on vector data (points, lines, polygons) in QGIS, exporting results as a new shapefile or GeoJSON.
This lesson, its worked examples and its practice questions has not yet been verified by an industry-certified professional or by a certification or approval body. It is a study draft and may contain errors. Do not use it as instructions for work on a job site or on live equipment. Always follow your instructor, your supervising professional, and current official references and regulations.
VoTechWorks program approval and accreditation are still in progress. Credentials are issued only by the certifying bodies named in each program, after their own exams.
Vector data represents geographic features as discrete geometric shapes. A point marks a single location (latitude/longitude pair), such as a school or fire hydrant. A line (or polyline) connects two or more points to represent features like roads or rivers. A polygon is a closed shape used to represent areas such as census tracts, city limits, or parcels. Every vector feature carries an attribute table — a spreadsheet-like structure where each row is one feature and each column is a field (name, population, category, and so on). Understanding this geometry-plus-attribute structure is the foundation of all GIS analysis.
QGIS 3.x is a free, open-source desktop GIS application that reads dozens of vector formats including shapefiles (.shp and companion files) and GeoJSON (.geojson). Shapefiles are the legacy standard from Esri and remain extremely common in government open-data portals. GeoJSON is a text-based, web-friendly format that stores geometry and attributes in a single file, making it easy to share and use in web maps or Python scripts.
Open the attribute table in QGIS by right-clicking a layer and choosing Open Attribute Table, or pressing F6. The table shows every field for every feature. You can sort, scroll, and manually click rows to select individual features on the map canvas at the same time.
For systematic filtering, use Select by Expression (the epsilon icon, or Ctrl+F3). This tool accepts SQL-like syntax. For example, to select all census tracts with a population over 5,000:
```
"POP_2020" > 5000
```
Or to find features whose name contains a specific string:
```
"NAME" ILIKE '%downtown%'
```
The Query Builder (Layer Properties → Source → Query Builder) works similarly but hides non-matching features from the layer entirely, acting as a persistent display filter rather than a temporary selection. Both tools use field names enclosed in double quotes and string values in single quotes — standard SQL convention.
Attribute queries filter on what a feature is; spatial queries filter on where it is relative to other features. The Select by Location tool (Vector menu → Research Tools → Select by Location) lets you ask questions such as: "Which schools fall inside census tract 042.01?" You specify a source layer (schools, points) and a reference layer (a selected census tract, polygon), then choose a spatial relationship: intersects, within, touches, overlaps, and others. QGIS highlights the matching features and you can then export or analyze them further.
For this lesson, you will select a single census tract using Select by Expression, then run Select by Location to find all school points whose geometry falls within that polygon boundary.
After selecting features, right-click the layer → Export → Save Selected Features As. Choose GeoJSON as the format, set the coordinate reference system (CRS) — WGS 84 (EPSG:4326) is the most portable choice for GeoJSON — and name your output file. QGIS writes only the selected records to the new file, giving you a clean, filtered dataset. Open the new layer to confirm the record count matches your expectation.
Before editing, toggle editing mode by clicking the pencil icon in the toolbar or pressing Ctrl+E. A red pencil icon on the layer confirms it is editable. Use the Add Point Feature tool to click on the map canvas where you want to place a new point. QGIS will immediately prompt you to fill in attribute values — do not skip any required fields. After entering attributes, click OK. Repeat for each new feature.
When finished, click Save Layer Edits (the floppy disk icon next to the pencil), then toggle editing off. Saving and toggling editing off are two separate steps — forgetting to save is a common mistake that causes data loss.
Have a partner open the attribute table and check that every new feature has a populated name and category field. Empty (NULL) attributes are a data quality problem that will cause errors in later analysis steps.
US Census TIGER/Line shapefiles provide authoritative boundaries for census tracts, counties, ZIP codes, roads, and water features. They are free from the Census Bureau website. City and county open-data portals (common platforms include ArcGIS Hub and Socrata) publish point layers such as school locations, business permits, and crime incidents. Download these before the lab session because network speeds inside a classroom can be slow.
Shapefiles consist of at least four files (.shp, .shx, .dbf, .prj). Always keep them together in the same folder. Renaming only the .shp file without renaming the others breaks the link between geometry and attributes.
There are no physical hazards in a GIS lab. However, data integrity is the professional equivalent of safety in data science: always work on a copy of original data files, never the originals. Keep originals in a read-only folder. Before sharing or submitting any dataset containing individual-level information, verify that it contains no personally identifiable information (PII) — even publicly downloaded data sometimes includes fields that, combined, could identify individuals. When in doubt, consult your instructor before sharing files outside the classroom network.
Answer each question, then check it. Nothing is recorded; this is your own practice.
A free tech program — complimentary, as our commitment to get America working. Help us build VoTechWorks. Tell us what works, what doesn’t, and what you want to learn.