- Learn
- Earth & Environmental Sciences
- Introduction to GIS
- Vector Spatial Analysis
Vector Spatial Analysis
BeginnerLesson 6 of 7 in Introduction to GIS Course
What you will learn
- Select the features that meet conditions on their attribute values, calculate the values a question needs, and bring in data from other tables through a shared key.
- Write attribute queries with expressionsBuild conditions with comparison and logical operators, lists, ranges, text patterns and NULL tests so that a query selects exactly the features a question asks for.
- Use selections, filters and calculated fieldsDecide whether to select, filter or export features, and calculate new fields such as densities, areas and lengths in the right units.
- Join tables to layers with a shared keyAttach attributes from another table to features through a common field, and check matches, cardinality and data types before using the joined values.
- Write attribute queries with expressions
- Describe how features relate in space, select features by their location relative to other layers, and transfer and summarize attributes through spatial joins.
- Describe the spatial relationships between featuresUse the standard spatial relationships, such as intersects, touches, within, contains, overlaps and crosses, to say exactly how two features relate, including the cases on boundaries.
- Select features by locationSelect or extract features by their relationship to another layer or by distance, and combine location queries with attribute queries.
- Join and summarize attributes by locationTransfer attributes between layers through their spatial relationship, count and summarize what falls inside each area, and join features to their nearest neighbors.
- Describe the spatial relationships between features
- Create buffer zones in true ground distances and use buffers, distance selections, nearest-feature tools and distance tables to answer questions about nearness.
- Create buffers with correct distances and optionsCreate buffers around points, lines and polygons with distances in ground units and the right settings for curve accuracy, line ends, inward buffers, dissolving and rings.
- Answer proximity questions with distancesChoose between buffers, distance selections, nearest-feature tools, distance tables and Voronoi polygons to answer "how near" and "how many nearby" questions.
- Create buffers with correct distances and options
- Combine layers with overlay operations, aggregate and split features, and measure and allocate values for the new pieces an overlay creates.
- Choose and run the right overlay operationCombine an input layer with an overlay layer by intersection, union, difference, symmetrical difference, clip or identity, and predict the geometry and attributes of each result.
- Dissolve, merge and split featuresAggregate features that share a value, combine layers into one, and break multipart features into parts, knowing which tools change geometry and which only stack data.
- Measure and allocate values after overlayMeasure the pieces an overlay creates, state percentages with the right denominator, estimate counts for partial areas by areal weighting, and find and handle slivers.
- Choose and run the right overlay operation
- Explain how topology records shared boundaries and connections, find and fix geometry and topology errors, and solve basic routing and service-area problems on a network.
- Check and fix topology and geometry errorsExplain adjacency, connectivity and containment, recognize gaps, overlaps, dangles and invalid geometries, and use rules, snapping and repair tools to fix them before analysis.
- Find routes and service areas on a networkModel streets as edges and nodes with travel costs, and find shortest and fastest routes, service areas and closest facilities, with the data checks routing needs.
- Check and fix topology and geometry errors
- Turn a spatial question into a planned sequence of operations, prepare and check the data at every step, and make the workflow repeatable with batch processing, models and scripts.
- Plan an analysis from question to resultBreak a spatial question into measurable criteria, data and operations, and carry out a site-selection analysis step by step with vector tools.
- Prepare data and check resultsGet every layer ready for analysis and check each intermediate result, so that errors in coordinates, geometry, fields or scale do not travel through a workflow.
- Automate and repeat workflowsRepeat a tool with batch processing, build a reusable model with parameters, and recognize when a short script is the better tool.
- Plan an analysis from question to result
Vector Spatial Analysis study guide
1Query features by their attributes
Attribute tables let you find features by recorded facts, calculate values for an analysis and connect outside tables to mapped features. A useful result depends on the condition you write, the fields you measure and the way matching records are joined. Work from a plain-language question to an expression, inspect the selected rows and choose whether the result should remain a temporary subset or become a saved dataset.
1.1 Write attribute queries with expressions
An attribute query asks a question of each row in a layer's table. A row is selected when its condition is true. The shape and position of the feature do not enter the test: selecting towns by population is an attribute query, even when you view the answer on a map.
Build a condition
In QGIS, open Select by Expression. Write field names in double quotes, text values in single quotes, and numbers without quotes or thousands separators: "region" = 'North' or "population" > 20000. Writing 'region' = 'North' compares two fixed text values, so it selects nothing. ArcGIS Pro calls the tool Select Layer By Attribute.
Use = for equal, <> for unequal, and <, <=, > or >= for numerical limits. Check the field type first. Text is compared character by character: text '9800' sorts above '52000'. Convert a numeric text field with to_int("pop_text") or calculate a new numeric field before testing population size.
Combine conditions without changing the question
AND requires both tests; OR requires at least one; NOT reverses a condition. AND is evaluated before OR. Parentheses make the intended grouping clear.
Suppose the question is "Which towns in North or South have more than 20,000 people?" Alder has 52,000 people in North; Birch 18,500 in North; Cedar 31,200 in South; Dunmore 9,800 in South; Elm 24,000 in North; and Fenwick 12,300 in East.
"region" = 'North' OR "region" = 'South' AND "population" > 20000 selects every North town, including Birch. Group the region choices first: ("region" = 'North' OR "region" = 'South') AND "population" > 20000. Now only Alder, Cedar and Elm pass.
Lists, ranges and text patterns
The shorter expression "region" IN ('North', 'South') AND "population" > 20000 gives the same result. IN tests membership of a list. "population" BETWEEN 10000 AND 25000 includes both endpoints and selects Birch, Elm and Fenwick.
With LIKE, % matches any number of characters, including none, and _ matches exactly one. "name" LIKE 'B%' matches Birch; "code" LIKE 'A_1' matches 'AB1', but not 'ABC1'. QGIS LIKE is case-sensitive; ILIKE ignores case. Equality still distinguishes 'North', 'north' and 'North ' with a trailing space. Inspect the actual values before writing the query.
Treat missing values separately
NULL means no value was recorded. It is different from zero and empty text. A missing coastal value passes neither "coastal" = 1 nor "coastal" <> 1: an ordinary comparison with NULL does not produce true. Use "coastal" IS NULL to find missing values and IS NOT NULL to require a recorded value.
Read the selected count, inspect selected and unselected rows, and test values exactly at the limits. An empty answer may be correct. If it surprises you, check quotes, field types, spelling, spaces and NULLs before changing the condition.
Key Takeaways
- Group OR alternatives before combining them with AND.
- Use the field type, quoting and exact stored values to build a query.
- BETWEEN includes both limits; LIKE wildcards describe text patterns.
- Find missing data with IS NULL, not an ordinary comparison.
- Check selected and unselected records, including limit values.
1.2 Use selections, filters and calculated fields
A selection, a filter and an export can display the same features while doing different jobs. Choose the one that fits the next step. A highlighted feature is still part of the original layer; a saved output is a separate dataset.
Decide what should stay available
| Action | What it does | Useful purpose |
|---|---|---|
| Selection | Highlights matching features | Inspect rows or pass a subset to a tool |
| Filter or definition query | Hides nonmatching features throughout the layer | Work with a continuing subset |
| Export | Writes matching features into a new dataset | Keep a result for later processing |
QGIS offers Save Selected Features As and Extract by expression. ArcGIS Pro offers Export Features. Filters leave the source data unchanged, but tools see the filtered layer as a smaller input.
Selection modes let you create, add to, remove from or filter the current selection. Filtering the current selection keeps features that meet the old and new tests. Inverting selects the unselected features that remain available in the layer. If you need nonresidential features only inside one district, make sure the district restriction is part of the available layer or the expression.
A forgotten selection can silently shrink an analysis. If 12 of 300 wells are selected, a run restricted to selected features produces 12 buffers. In QGIS, inspect Selected features only; ArcGIS Pro tools normally honor a layer selection. Clear selections and inspect filters before a whole-layer run.
Calculate a field with the right units
The field calculator creates or updates values from an expression. Use an integer for a count, a decimal field for a measurement or ratio, and text for a code. An integer density field loses its fractional part.
Population density divides population by area in square kilometers. If QGIS $area returns square meters, use "population" / ($area / 1000000). For a park, 420,000 m² becomes 42 ha or 0.42 km². Name the output area_ha or density_km2 so its unit remains visible in later steps.
Know how geometry is measured
QGIS $area, $length and $perimeter respect the project's ellipsoid and measurement-unit settings. With an ellipsoid set, they give ellipsoidal measurements. By contrast, area(@geometry) and length(@geometry) are planar: they use square coordinate units and coordinate units from the geometry's CRS. In a geographic CRS those are square degrees and degrees, not ground area and length.
For an explicit planar hectare calculation in a suitable meter-based layer, use area(@geometry) / 10000. With $area / 10000, first confirm that project area units are square meters. ArcGIS Pro's Calculate Geometry Attributes lets you choose units and planar or geodesic measurement.
A calculated value is a snapshot. Clipping, splitting or editing geometry leaves an ordinary area field unchanged, so recalculate it. ArcGIS Pro maintains its file-geodatabase Shape_Area and Shape_Length fields automatically in the feature class's CRS units. For totals, use QGIS Basic statistics for fields or ArcGIS Pro Summary Statistics; inspect whether the layer is selected or filtered before reading the sum.
Key Takeaways
- A selection highlights, a filter hides, and an export saves a separate dataset.
- Check selections and filters before running tools on a whole layer.
- Use decimal fields for measurements and ratios.
- Confirm measurement units before converting area or calculating density.
- Recalculate ordinary geometry fields after an edit, split or overlay.
1.3 Join tables to layers with a shared key
An attribute join brings values from another table into a layer by matching a shared key. The key might be a district code, parcel ID or land-use code. The target is the layer receiving the values; the join table supplies them.
Make the keys match
QGIS supports layer Properties > Joins and Join attributes by field value. ArcGIS Pro has Add Join and Join Field. Before using either, inspect the keys' type, length, spaces and uniqueness.
The code '0307' is text. The number 307 has lost its leading zero, and '0307 ' has an extra space. These formats are not identical keys. If codes are meant to have four digits, lpad(to_string("code"), 4, '0') converts 307 into '0307' in QGIS. Repair the table consistently, then check a few matches manually. Treat identifiers as text when leading zeros matter.
Check how many records match
Cardinality describes how many records on one side match records on the other.
| Relationship | Example | What to check |
|---|---|---|
| One-to-one | One census record per district | A unique key in each table |
| Many-to-one | Many parcels use one lookup code | Each lookup code has one description |
| One-to-many | Many schools share a district code | Whether to summarize or retain every school |
A many-to-one lookup gives each parcel a description without multiplying parcel rows. A one-to-many school join needs a decision. A first-match join keeps one school and loses the others from the result. That school is not a district total or a representative average.
If the question asks for schools per district, summarize the school table by district code first, then join the counts. If it asks for each school and its district, retain every match with a one-to-many output. The district geometry is repeated once for each matched school, so its row count increases.
Read unmatched records correctly
Suppose district codes are '0301', '0302', '0305' and '0307', while census codes are numeric 301, 302 and 305. The original formats produce no exact matches. Once the census keys become four-character text, three districts match; '0307' remains unmatched.
Keeping unmatched targets leaves NULL in their joined fields. For district '0307', a NULL population means no matched population record. Replacing it with zero would claim that no one lives there. QGIS can discard records that cannot be joined; ArcGIS Pro Add Join can disable Keep all input records. Choose deliberately, because discarding unmatched targets can hide missing data.
Save the result you need
A layer join is virtual: it reads the other table and depends on that table remaining available. Removing the join removes its visible fields. Export the layer or run a permanent join tool to store values in the output. A field prefix helps identify the supplying table.
After joining, compare row counts, count NULLs, inspect duplicate keys and check several matched values. For a one-to-many output, repeated target geometries are expected; when the question needs one row per target, that increase signals that the join has the wrong shape.
Key Takeaways
- Match key types and formats, including leading zeros and spaces.
- Check cardinality before choosing a first-match, summary or one-to-many join.
- An unmatched joined value is missing data, not zero.
- A virtual join depends on the source table; export to preserve its values.
2Query and join features by location
Location questions compare geometries: which buildings meet a zone, which parcels lie near stops and which district contains each school. The relationship and the direction of the comparison determine the answer. Learn to select whole features and attach or summarize matching attributes, with special care for points on borders and multiple matches that can change a count.
2.1 Describe the spatial relationships between features
Spatial relationships describe how two geometries meet. A geometry has an interior and a boundary: a polygon's outline is its boundary, and a line's endpoints form its boundary. The same pair can satisfy more than one relationship.
Start with shared space
Intersects means at least one point is shared, including a boundary point. Disjoint means no point is shared. Touches means some point is shared but the interiors do not meet. Two parcels sharing an edge therefore intersect and touch, even though they share no area.
Within means no part of the tested geometry lies outside the other and their interiors share a point. Contains reverses the direction: a school is within a district exactly when the district contains the school. A point exactly on the district outline touches and intersects it, but is not within it under the standard definition used by QGIS.
Distinguish overlap from crossing
| Relationship | Required geometry relationship | Example |
|---|---|---|
| Overlaps | Same dimension, shared interior of that dimension, each extends beyond the other | Two partly shared fields |
| Crosses | A line has interior both inside and outside a polygon, or line interiors meet at points | A river entering and leaving a park |
| Equals | Both occupy exactly the same space | Two copies of a boundary with reversed vertex order |
A pond wholly inside a park is within it, but does not overlap it: the pond does not extend beyond the park. Two streets crossing at one point do not overlap because they share no stretch of line. Two line features overlap when they share a segment and each continues beyond the other.
For a line and polygon, crossing requires both an inside and an outside part. A path staying entirely in a park is within it. Two polygons do not cross in this sense. Equality concerns occupied space, so a different storage order of vertices does not make equal geometries unequal.
Apply the test in the right direction
Read a query as a sentence: "Select school points within district polygons." The schools are the tested features. Swapping the layers asks which districts contain schools; it returns district features. Symmetric tests such as intersects give the same relationship either way, but the output layer still changes.
Consider three cases. Parcels sharing an edge touch and intersect, but do not overlap. A river running through a park crosses and intersects it, but is not within it. A school on an outline touches and intersects the district; its boundary position prevents a standard within match.
Check software variants and precision
QGIS offers the standard predicates. ArcGIS Pro also offers variants such as Completely within, Have their center in and Within Clementini. Its ordinary Within includes a point on the polygon boundary; Within Clementini excludes that point, matching the standard case above. Choose from the tool's actual definition, especially when counting border points.
Tiny coordinate differences can turn an intended touch into a narrow overlap or a gap. Inspect these cases at a useful scale and check topology. A visually shared border may consist of two slightly different stored lines.
Key Takeaways
- A boundary contact counts as intersects.
- Touches excludes shared interiors; overlaps requires shared interior of the same dimension.
- Within and contains reverse the tested direction.
- Standard within excludes a point lying exactly on a polygon outline.
- A line crossing a polygon has both inside and outside parts.
- Check software variants and tiny boundary errors before trusting counts.
2.2 Select features by location
A location query selects whole features by comparing their geometries with another layer. It answers questions such as "Which buildings intersect a flood zone?" The selected buildings keep their original shapes, including any part outside the zone.
Name the input, relationship and comparison
Use QGIS Select by location or ArcGIS Pro Select Layer By Location. Say the operation aloud: "Select buildings that intersect flood zones." Buildings are the input; flood zones are the comparison. Reversing these layers selects flood zones, even when the same intersections are present.
Choose the predicate from the question. Intersects includes a building with only one corner in the zone. Within requires the whole building to satisfy containment. A building cut by the zone boundary passes intersects and fails within. QGIS Extract by location writes the matched whole features into a new layer when you need a saved result.
Select by distance without drawing a zone
QGIS Select within distance tests nearness directly. ArcGIS Pro provides Within a distance in its location selection tool. For planar distance work, confirm the evaluation CRS and use a suitable projected CRS in meters. A number entered in a degree-based calculation is not a distance in meters.
A distance selection gives the same practical selection as intersecting a buffer of that radius, except for tiny differences from the buffer's segmented curves. Use a buffer when you need the zone polygon itself. A direct selection avoids creating a layer that the question does not need.
Combine location and attribute conditions
For "Residential parcels within 300 m of a bus stop":
- Select
"landuse" = 'residential'in the parcel layer. - Run the distance test against stops at 300 m.
- Choose the mode that keeps matches within the current selection.
This is an AND combination: each final parcel meets both conditions. QGIS calls the attribute mode Filter current selection; ArcGIS Pro uses Select subset from the current selection. Starting a new selection at step 3 would lose the residential restriction. You can reverse the two tests and get the same final set because both keep only features satisfying both conditions.
The comparison layer can also be restricted. To use stops from one route, select those stops first and pass only selected stops to the distance tool. Check the restriction on both sides of the operation.
Find what is outside a distance
A district has 1,200 parcels, of which 450 are residential. Of the residential parcels, 310 are within 300 m of a stop. Removing those 310 from the residential selection leaves 140. Inverting a selection on the unrestricted parcel layer would also bring in nonresidential parcels. Keep the residential subset explicit when taking its complement.
Before accepting the result, check the selected layer, its count and several parcels at the distance limit. Ensure each layer has its correct CRS assigned. Some tools transform coordinates during processing; ArcGIS Pro normally evaluates the relationship in the input features' coordinate system. Reproject explicitly when the tool requires it, and use the same evaluation basis when comparing runs.
Key Takeaways
- Write the tested layer first so the output answers the intended question.
- A location selection keeps whole features; it does not cut their geometry.
- Keep matches within the current selection to combine criteria with AND.
- Take a complement inside the intended subset, not an unrestricted layer.
2.3 Join and summarize attributes by location
A spatial join attaches information because features meet in space, without needing a shared code. Joining school points to districts can add a district name to each school. Turning the direction around can produce school counts for each district.
Choose what one output row represents
In QGIS use Join attributes by location; in ArcGIS Pro use Spatial Join. The target determines the output's basic records. Schools as target give school records with district fields. Districts as target give district records with school information summarized or repeated.
When several features match, choose how to retain them. A one-to-many output creates a record for every match. A first-match output keeps one matching feature's attributes, not a total. QGIS also offers the feature with the largest overlap, useful when assigning a parcel to the zone covering most of it. ArcGIS Pro's one-to-one join can combine matches with field merge rules such as Sum, Mean or First and records a Join_Count.
Count and summarize
For school counts by district, use QGIS Count points in polygon or Join attributes by location (summary). The latter can calculate count, sum, mean, minimum, maximum and median. ArcGIS Pro offers Summarize Within or Spatial Join with suitable merge rules. A count of schools and a sum of enrollment answer different questions, so choose the field and statistic together.
Resolve points on borders
Suppose four schools lie inside North, two inside South and one exactly on their shared boundary. With intersects, North counts five and South three: eight matches for seven schools. The border school matches twice. With standard within in QGIS, the border point matches neither district, so the counts sum to six. ArcGIS Pro Within Clementini follows that rule; ordinary Within includes the boundary point.
If each school must count once, first assign each school to exactly one district under a stated border rule. Review boundary cases and then summarize the assignments. Choosing one-to-one with districts as target does not solve the double count: the same school can still contribute to two separate district records.
Keep missing matches visible
A count tool can return zero schools for an empty district. A plain join can return NULL joined values for an unmatched target. Keep unmatched targets if the question includes every district; discarding them hides places with no match. Check the output count against the target count: one-to-many output may grow, while a keep-all one-to-one output should preserve it.
Join what is nearest
When features do not intersect, QGIS Join attributes by nearest attaches the nearest feature's fields and distance, with options for several neighbors and a maximum distance. ArcGIS Pro has Near and the Closest match option in Spatial Join. This is straight-line proximity. A clinic across a river may be nearest on the map but slower to reach by road.
A saved spatial join is a snapshot. Rerun it after points move or boundaries change, and compare unmatched records, match counts and several known locations before using its fields in another calculation.
Key Takeaways
- The target determines what each output row represents.
- A first match is not a count or total of all matches.
- Border points can be counted twice or omitted, depending on the predicate.
- Assign each point once before summarizing when unique totals are required.
- Rerun spatial joins after the underlying features change.
3Build buffers and measure proximity
Distance can produce a zone, a selected set, a nearest destination or a table of pairs. Choose the output that answers the question, then check how the tool measures distance. Buffers need suitable units and shape settings, while nearest-feature analysis needs enough surrounding data to include nearby destinations. Travel access introduces a further choice because roads and barriers can change which destination is easiest to reach.
3.1 Create buffers with correct distances and options
A buffer turns a distance into a polygon. Around a point it forms a disk; around a line, a corridor; around a polygon, an expanded outline. The distance is a radius: a 500 m point buffer is 1,000 m across.
Confirm ground distance before running Buffer
QGIS Buffer is planar and uses the layer's coordinate units. A value of 500 in a meter-based projected CRS means 500 m. In WGS 84 geographic coordinates it means 500 degrees, producing an unusable shape. Reproject the layer into a suitable local projected CRS before buffering, and read the unit next to the distance box.
A degree is not a fixed ground distance. Latitude changes by about 111 km per degree, while longitude spans about 111.32 km times the cosine of latitude. At 50° latitude, one longitude degree is about 71.6 km. A 0.01° buffer therefore has different ground reach east–west and north–south.
ArcGIS Pro's Buffer with Planar method creates geodesic buffers from geographic inputs when you specify a linear unit such as meters. Its Geodesic method supports shape-true buffers across coordinate systems. Check the method as well as the unit.
Set the curve and end shapes
A true disk of radius 500 m has area , or about 78.5 ha. Software approximates curves with straight segments. QGIS's default five segments per quarter circle produces a 20-sided polygon, about 772,542 m²: roughly 1.6% smaller. Increase segments when area precision matters.
For a straight 2,000 m road buffered 50 m on each side, flat ends produce . Round caps add two semicircles, together about 7,854 m², giving about 207,854 m². QGIS offers round, flat and square caps. ArcGIS Pro offers Round and Flat and can choose Full, Left or Right side buffers for lines.
Grow, shrink or vary a zone
A positive polygon distance expands it; a negative distance shrinks it. A 100 m by 80 m rectangle buffered inward by 10 m becomes 80 m by 60 m, or 4,800 m². Narrow parts can disappear when the inward distance leaves no interior.
A field can supply different distances for different features, such as 30 m for streams and 100 m for rivers. Use a distance field or data-defined distance and keep the unit consistent for every row.
Decide whether overlaps remain separate
Two 500 m well buffers whose centers are 600 m apart overlap. Their separate disk areas total about 1,570,796 m², but about 223,648 m² is shared. The area near either well is about 1,347,149 m². Dissolve combines shared coverage so it is counted once; separate buffers preserve each well's identity.
Multi-ring buffers create distance bands. For a point, the 0–100 m, 100–200 m and 200–300 m bands have areas about 31,416, 94,248 and 157,080 m². Each band's area is . Check whether the tool returns nonoverlapping bands or full overlapping disks before adding their areas.
Key Takeaways
- Check a buffer tool’s distance units and planar or geodesic method.
- Buffer distance is a radius, not a diameter.
- Curve segments and line caps change the measured output area.
- Negative polygon distances shrink the usable interior.
- Dissolve overlapping buffers when measuring combined coverage.
- Inspect whether multi-ring outputs overlap before adding their areas.
3.2 Answer proximity questions with distances
Start a proximity analysis by deciding what "near" needs to mean. A threshold, a nearest destination and every pair of distances are different outputs. Straight-line distance is useful for physical proximity; road travel needs a network.
Match the question to the output
| Question | Suitable approach | Result |
|---|---|---|
| What lies within 500 m? | Select within distance | Whole matching features |
| What is the 500 m zone? | Buffer | Zone polygons |
| Which destination is nearest? | Join attributes by nearest or Near | Destination and distance |
| How far is each origin from each destination? | Distance matrix | Origin–destination pairs |
| Which point is closest throughout the area? | Voronoi polygons | Straight-line nearest zones |
For a field partly inside a buffer, intersects includes it while within requires containment. State whether any part or the whole feature must satisfy the distance rule. A distance from a polygon is normally the shortest distance from its geometry; it is not automatically a distance from its center.
Compare nearest destinations
In a projected CRS in meters, a house is at (2000, 3000), clinic A at (2600, 3800), and clinic B at (1100, 2400). The offsets to A are 600 m and 800 m, giving . The offsets to B are 900 m and 600 m, giving . Clinic A is nearest in straight-line terms.
QGIS Distance to nearest hub can draw lines to destinations; Join attributes by nearest attaches their fields and distance. ArcGIS Pro Near writes NEAR_FID and NEAR_DIST, and Generate Near Table can retain several matches. A maximum search distance can leave some origins unmatched, so inspect those records.
Control the size of a distance table
A full distance matrix has one pair for every origin and destination. Two hundred origins and 50 destinations create 10,000 pairs. Limit the number of neighbors or maximum distance if the question needs only nearby destinations. This changes the scope of the table, so record the limit.
Voronoi polygons, called Thiessen polygons in ArcGIS Pro, divide space among point sites by nearest straight-line distance. They are a quick first estimate of service zones. They do not follow roads or model a river barrier. A house 1.2 km from a clinic across a river might require 2.9 km of road travel to cross a bridge.
Check measurement and edge coverage
A suitable local projected CRS supports practical planar distance work. For continental distances, use a tool explicitly supporting geodesic or ellipsoidal measurement. In QGIS, setting the project ellipsoid changes functions and tools that honor it, such as $length and the measure tool; it does not change planar nearest joins into geodesic tools.
Include nearby destinations outside the reporting boundary. If the nearest clinic is just outside a clipped dataset, the nearest remaining clinic will appear too far away. A data margin at least as wide as the search distance prevents this edge effect for threshold analyses; for unrestricted nearest searches, verify that the available extent includes the true nearest candidates.
Key Takeaways
- Choose threshold, nearest, all-pairs or zone outputs from the question.
- A full distance matrix contains origins multiplied by destinations pairs.
- Voronoi zones describe straight-line nearness, not travel access.
- Use a tool’s actual measurement method, not just project display settings.
- Keep enough data beyond the study boundary to include nearby destinations.
4Combine layers with overlay
Combining layers can split features, join coverage or stack records. These changes affect both the geometry on the map and the meaning of values in the table. Predict the pieces an operation should retain, choose the attributes the result needs and update measurements after cutting. Percentages and estimates for partial polygons then require a clearly identified whole and a method suited to the kind of value being allocated.
4.1 Choose and run the right overlay operation
Overlay creates new geometry where layers meet. A location selection keeps or drops a whole forest; an overlay can cut out only the protected part. The operation decides both which pieces survive and which attributes they receive.
Predict the pieces before choosing a tool
Let forest A cover 10 ha and protected area B cover 6 ha, with 2 ha shared. A-only is 8 ha and B-only is 4 ha.
| Operation | Pieces kept | Area | Attributes |
|---|---|---|---|
| Intersection | Shared part | 2 ha | A and B |
| Union | A-only, shared, B-only | 14 ha | A and B; NULL where absent |
| Difference, A minus B | A-only | 8 ha | A |
| Symmetrical difference | A-only and B-only | 12 ha | A and B; NULL where absent |
| Clip A by B | Shared part | 2 ha | A |
| Identity, A with B | All A, split by B | 10 ha | A, plus B where matched |
Intersection answers "Where are both true?" QGIS calls it Intersection; ArcGIS Pro uses Intersect or Pairwise Intersect. Union retains all coverage from both polygon layers and splits their overlap. Its total is , not 16 ha, because the shared ground counts once in this two-polygon example.
Difference, called Erase in ArcGIS Pro, removes overlay coverage from the input. Symmetrical difference removes the shared area from both, leaving the exclusive parts. Clip uses the overlay as a cutting outline and keeps input attributes. Clip and intersection have the same shape here, but intersection also carries the protected area's fields.
Identity keeps all the input, splitting and tagging it with overlay information. ArcGIS Pro has an Identity tool. In QGIS, a union followed by removing pieces outside A gives the corresponding result. Keep a reliable A identifier so the B-only pieces can be recognized.
Keep the layer order deliberate
Clipping A by B and clipping B by A retain different attributes. Difference also changes shape when reversed: B minus A is 4 ha, while A minus B is 8 ha. Union and intersection produce the same spatial pieces when reversed in this example, though field order changes.
Overlay is useful beyond polygons. Intersecting a 3.4 km road with zoning polygons can produce a 1.9 km segment in one zone and a 1.5 km segment in another, each with zone attributes. QGIS Line intersections finds crossing points between line layers; Split with lines cuts lines or polygons along lines.
Prepare geometry and update measurements
Use a suitable shared projected CRS and inspect validity before overlay. QGIS Fix geometries and ArcGIS Pro Repair Geometry address invalid shapes such as self-crossing outlines that can break processing. ArcGIS Pro's Pairwise tools provide alternatives for large datasets.
After overlay, the geometry is new but ordinary attribute values are copied. A forest's area_ha value of 10 can remain 10 on its 2 ha clipped piece. Recalculate the piece's area with a verified measurement method and units before summing.
Key Takeaways
- Choose overlay from the pieces and attributes the result needs.
- Clip retains input attributes; intersection carries both layers’ attributes.
- Difference removes overlay coverage from the input, so layer order matters.
- Union keeps all coverage; symmetrical difference drops the shared part.
- Repair geometry before overlay and recalculate measurements afterward.
4.2 Dissolve, merge and split features
Combining layers, combining coverage and separating parts are different jobs. A road layer can contain many records even when it looks like one continuous line on the map. Think about the output table as well as the drawing.
Dissolve boundaries by a category
Dissolve removes boundaries between features sharing a field value. Twelve parcels with residential, commercial and industrial zoning can become three features. With no dissolve field, all features are combined. Separate pieces of one category can form a single multipart record unless you request separate disjoint features.
Dissolve does not imply that every numerical field is totaled. QGIS Dissolve copies remaining field values from one contributing feature. If census tracts hold 1,200, 3,400 and 2,150 people, a copied tract value is not the county total. Use QGIS Aggregate with a sum, or ArcGIS Pro Dissolve with statistics fields, to obtain people.
Merge records into one layer
QGIS Merge vector layers and ArcGIS Pro Merge stack features from layers of the same geometry type into a new layer. Roads from two municipalities become one road dataset, but adjacent segments stay separate and overlaps remain. Matching field names align; different names create separate columns, with NULL where an input lacks that field. Check field names and types before merging. ArcGIS Pro Append adds records to an existing dataset.
| Tool | Main change | Overlapping input features |
|---|---|---|
| Merge | Stacks records into one layer | Remain overlapping |
| Union | Splits coverage and keeps attributes | Can leave stacked pieces from multiple matches |
| Dissolve | Combines coverage and removes chosen boundaries | Shared coverage is combined |
A union is not a general duplicate-removal tool. Where multiple features overlap, the result can contain identical geometry for different input matches. If the question asks for total covered ground, dissolve the coverage before measuring it. If it asks which sources cover each place, keep their identities and inspect repeated pieces.
Split a multipart feature safely
A multipart feature has one record but several separate geometry parts, such as a mainland and islands. QGIS Multipart to singleparts and ArcGIS Pro Multipart To Singlepart create a row for each part. Each row receives the original attributes.
A three-island feature with population 90,000 becomes three rows each carrying 90,000. Their apparent sum of 270,000 repeats the original total three times. Recalculate each part's area and keep the population's original meaning; separate geometry does not provide a separate population count.
Review small leftover pieces
Thin pieces after overlay may be boundary artifacts called slivers. Select and inspect them using an area criterion supported by the data's positional accuracy. QGIS Eliminate selected polygons or ArcGIS Pro Eliminate can join selected pieces to a neighbor by area or shared boundary. Preserve real small features, such as narrow parcels, even when they resemble an artifact on screen.
Key Takeaways
- Dissolve combines coverage by category; merge stacks feature records.
- Calculate sums explicitly when aggregating attribute values.
- Union can preserve stacked pieces from multiple overlapping features.
- Splitting multipart geometry copies attributes, including whole-feature totals.
4.3 Measure and allocate values after overlay
Overlay gives you new pieces to measure, but it does not decide what their copied values mean. Recalculate the piece areas first. Then choose the denominator or allocation method that answers the question.
Measure pieces and define the percentage
For land use inside a flood zone, intersect land-use polygons with the zone, calculate each piece's area, then summarize by land-use class. QGIS offers Statistics by categories; ArcGIS Pro uses Summary Statistics with a case field.
The same overlap supports different percentages. Two hectares of protected forest out of a 10 ha forest is 20% of the forest. The same 2 ha out of a 6 ha protected area is about 33% of the protected area. State which whole is the denominator: "20% of the forest is protected" answers a different question from "What share of the protected area is forest?"
Estimate counts for partial areas
Areal weighting allocates a whole-polygon count according to its share of area:
A tract contains 4,000 people on 2.0 km². A flood zone covers 0.5 km² of it, so the estimate is people. A second tract contains 2,500 people on 1.25 km², with 0.25 km² flooded: . Together the estimate is about 1,500 people.
Store the original area before intersecting. In the output, calculate the new area, divide it by the stored original area, multiply by the original count, and sum by zone. If you overwrite the original area, dividing the new area by itself allocates the whole count to every piece.
Areal weighting assumes an even spread within each source polygon. It estimates counts such as people or households; it does not locate them. If everyone lives in one corner of a tract, the area fraction may be a poor population fraction. Refining the estimate with residential-land information is called dasymetric mapping.
Keep counts separate from rates
Do not multiply a density, percentage or median by an area share as if it were a count. Copying a tract median income onto a clipped piece preserves the tract statistic; finding the piece's own median needs income-distribution data or an explicit model. Round estimated people sensibly at the end instead of reporting false precision such as 1,000.47 people.
Investigate thin pieces and area distortion
A sliver forms where boundaries intended to coincide are slightly offset. A strip 0.3 m wide along 400 m has area 120 m². Look for many small pieces with large perimeter relative to area. Inspect the source boundaries and choose snapping, shared boundaries or elimination based on positional accuracy; a large arbitrary threshold can remove real land.
Choose an area method suited to the study. Equal-area projections preserve area, while Web Mercator enlarges area away from the equator by about , a factor of 4 at 60°. Ellipsoidal measurement, such as QGIS $area with the project ellipsoid set, avoids that planar distortion. Verify the output unit before converting to hectares or summing.
Key Takeaways
- Recalculate piece areas before summarizing overlay results.
- Name the whole used as a percentage’s denominator.
- Store original areas before areal weighting.
- Area fractions allocate counts under an even-spread assumption, not rates or medians.
- Review slivers and use a suitable area measurement method.
5Use topology and network analysis
A tiny gap between streets can prevent a route, while two roads crossing on a map may have no junction on the ground. Topology turns these spatial relationships into checks, and network analysis turns valid connections into routes and reachable areas. Build the model around real junctions, directions and travel costs, then distinguish a short trip from a fast trip and a circular proximity zone from a network service area.
5.1 Check and fix topology and geometry errors
Topology describes which features share boundaries, connect or lie inside one another. These relationships should survive a correct reprojection even though coordinates change. Small geometry errors can change an analysis long before they become obvious on a map.
Separate feature validity from relationships
Adjacency describes neighboring polygons sharing a boundary. Connectivity describes lines meeting at nodes. Containment describes one geometry lying within another. A topological model stores nodes, edges and faces, recording a shared edge once with a face on each side. The Census Bureau's MAF/TIGER database is an example.
Shapefiles and GeoPackages usually store simple features, each with its own complete geometry. Two neighboring polygons therefore store separate copies of their border. Those copies can drift apart, leaving a gap, or cross into one another, creating an overlap.
A valid geometry follows the rules for its shape. Polygon rings close without crossing themselves, holes lie inside the outer ring and multipart polygon interiors do not overlap. A self-crossing "bow-tie" outline is invalid. Two individually valid parcels can still overlap each other, so a geometry validity check and a layer topology check answer different questions.
Recognize the error before fixing it
| Error | What to look for | Possible effect |
|---|---|---|
| Gap | Empty strip between intended neighbors | Missing coverage |
| Overlap | Two polygons covering the same intended parcel space | Double-counted area |
| Undershoot | A line ending short of its junction | Disconnected route |
| Overshoot | A line extending past its junction | Extra line part |
| Dangle | A line end with no connection | Real dead end or connection error |
| Duplicate | Repeated feature | Repeated counts or costs |
Rules depend on purpose. Parcels should not overlap; a complete municipality coverage should not have unintended gaps. A street rule can flag dangles, but a real dead-end street is a legitimate exception. Inspect a flag against the actual geography before changing it.
Check, repair and prevent
QGIS Check validity separates valid and invalid features and marks errors. Fix geometries repairs invalid shapes. ArcGIS Pro provides Check Geometry and Repair Geometry. QGIS's Topology Checker plugin and ArcGIS Pro geodatabase topology rules inspect relationships such as Must Not Overlap or Must Not Have Dangles.
Suppose a street ends 0.8 m short of a cross street. A route may fail or detour even though the map looks connected. Snap the endpoint onto the cross street and split that street at the real junction so they share a network node. A repair of polygon validity alone would not establish this connection.
Snapping places an edited vertex on a nearby vertex or segment within a tolerance. QGIS topological editing moves a shared vertex across affected features, and avoid-overlap editing trims new polygons against neighbors. Choose tolerances from positional accuracy: 5 m could collapse lane lines 3 m apart, while a very small tolerance could leave the 0.8 m undershoot untouched. Recheck relationships after any repair.
Key Takeaways
- Check both individual geometry validity and relationships between features.
- A flagged dangle may be a real dead end.
- Real network junctions need shared nodes and correctly split edges.
- Snapping tolerances must fit positional accuracy and real feature spacing.
5.2 Find routes and service areas on a network
A road network represents travel through connected edges and nodes. Each edge has a cost, such as distance or time. The least-cost route depends on which cost you choose, not on how direct the line looks on the map.
Build a network that matches travel
Edges are road segments and nodes are junctions. Lines must meet exactly and be split at real junctions. A bridge crossing above another road needs no turn connection there. A false node would let a route leave the bridge onto the road below.
Add direction information for one-way streets and speeds for time-based routing. QGIS Shortest path offers shortest and fastest strategies; Service area finds reachable edges or edge parts. Its direction field can specify forward, backward or both ways. Empty direction information defaults to both ways, and absent speeds default to 50 km/h. Inspect these defaults so they do not silently replace the intended travel model. ArcGIS Pro Network Analyst uses network datasets with costs and restrictions.
Compare shortest and fastest
Time in hours is length in kilometers divided by speed in km/h. A 1.2 km segment at 30 km/h takes .
Three routes from A to F illustrate the choice:
| Route | Segments | Distance | Time |
|---|---|---|---|
| A–B–F | 2.0 km and 1.5 km, both at 30 km/h | 3.5 km | 7.0 min |
| A–E–F | 1.8 km at 50, then 2.2 km at 30 km/h | 4.0 km | 6.56 min |
| A–C–D–F | 1.0 km at 50, 3.0 km at 90, 1.0 km at 50 km/h | 5.0 km | 4.4 min |
For the third route, the segment times are 1.2, 2.0 and 1.2 minutes. The shortest route is A–B–F, but the fastest is A–C–D–F. Comparing total distance alone would miss the speed advantage.
Understand the least-cost search
Dijkstra's algorithm repeatedly settles the unsettled node with the lowest known total cost from the origin, then updates its neighbors. With distance cost in the example, it settles A at 0, C at 1.0 km, E at 1.8 km, B at 2.0 km, then F at 3.5 km. It can stop when F is settled. With nonnegative costs, the settled destination has a least-cost path.
Find reachable areas and facilities
A service area is the network reachable within a limit, such as 10 minutes. It follows roads and restrictions. If every road has a speed of 50 km/h, the maximum travel distance in 10 minutes is about 8.3 km; the reachable network still does not fill a circular disk. With varying speeds, reach depends on the route's sequence of costs.
For QGIS's fastest service area, enter hours: 10 minutes is about 0.167 hours. Entering 10 means 10 hours. A closest facility analysis finds the facility with lowest network cost; an OD cost matrix gives costs for all origin–destination pairs. Vehicle routing and location-allocation extend these ideas to larger planning tasks.
Check how starts and destinations snap to the network. A point moved to the wrong street, an undershoot or a missing speed can cause a detour or "no route found." A fastest result describes the specified speeds and restrictions; include traffic or delays only when the network model contains them.
Key Takeaways
- Edge costs determine whether the least-cost route is shortest or fastest.
- Check real junctions, bridge crossings, directions and speed fields.
- Add segment times to compare complete routes.
- Dijkstra’s algorithm settles the lowest accumulated nonnegative cost.
- QGIS fastest service-area limits are in hours.
- Service areas follow the network; circular buffers measure direct proximity.
6Design and run geoprocessing workflows
A spatial analysis begins with a question and ends with a result that someone else can inspect and repeat. Translate each criterion into data and an operation, decide whether whole features or usable parts should survive, and check every intermediate output. Suitable input accuracy, saved results and a record of parameters make the work traceable. Batch runs, models and short scripts then repeat a workflow that has already been tested.
6.1 Plan an analysis from question to result
A geoprocessing workflow turns a question into a sequence of data operations. Plan the criteria before opening tools. Each step should have a clear input, parameter, output and check.
Translate the question into tests
A site-selection question might ask for agricultural parcels of at least 2 ha, within 1 km of a main road, outside protected land and away from rivers. "Near a road" is too vague to run: define the road classes and distance. An inclusion criterion keeps qualifying land; an exclusion criterion removes prohibited land.
| Criterion | Data | Operation |
|---|---|---|
| Agricultural use | Parcel land-use field | Attribute query |
| At least 2 ha | Parcel geometry | Area calculation and query |
| Within 1 km of a main road | Selected road classes | Distance selection or buffer |
| Outside a 200 m river zone | Rivers | Buffer and exclusion |
| Outside protected land | Protected-area polygons | Location exclusion or difference |
If every criterion must be met, combine them with AND: keep matches within the current selection or intersect allowed areas. Combining with OR would accept land meeting only one condition.
Follow a whole-parcel selection
Start with 1,240 parcels. Selecting agricultural use leaves 412. Requiring at least 2 ha leaves 157; in QGIS, $area / 10000 >= 2 works when $area returns square meters. Keeping those within 1 km of a main road leaves 61. Removing those that intersect a 200 m river buffer leaves 38. Removing those that intersect protected areas leaves 35 candidates to export.
Each narrowing step can only keep or reduce the count. If a later selection increases it, check whether you created a new selection or added features instead of narrowing it. Cheap attribute conditions can run first so slower location tests process fewer features. Reordering these whole-feature AND tests preserves the final set.
Decide whether to retain whole parcels or usable pieces
A 6 ha parcel may have one corner inside the river buffer. Excluding every intersecting parcel removes all 6 ha. Using Difference to remove the buffer keeps the remaining land. Those are different decisions, not interchangeable tool sequences.
If parts are retained, recalculate their areas and reapply the minimum-area test afterward. A parcel that originally passed 2 ha may leave a smaller or disconnected remnant. Geometry-changing operations can change later tests, so their order matters even when simple selection filters commute.
Make the choices visible
Record threshold values and their sources. Rerun with plausible alternatives, such as a 1.5 km road distance, to see whether the candidate list is stable. The selected features are candidates under those criteria; the result does not add missing criteria on its own.
Draw a flowchart linking input layers, tools, parameters and outputs. QGIS Model Designer and ArcGIS Pro ModelBuilder can turn that diagram into an executable model. ModelBuilder depicts inputs as blue ovals, tools as yellow rectangles and derived data as green ovals. Sharp vector boundaries work well for parcel and exclusion tests; continuous weighted suitability is commonly handled with raster methods.
Key Takeaways
- Translate every criterion into a measurable test and an input dataset.
- Combine required criteria with AND.
- A narrowing whole-feature selection cannot increase its count.
- Keeping parcel remnants requires geometry changes and a new area test.
- Record thresholds and compare plausible alternatives.
6.2 Prepare data and check results
A clear workflow can still fail if its inputs are mislabeled, incomplete or too coarse. Prepare the data and check intermediate results so an early error does not travel through every later step.
Prepare geometry, fields and extent
Use a projected CRS suited to the study area and meter distances. Check geometry validity and repair invalid features. Inspect field types: measurements need numbers, while codes may need text to preserve zeros. Count NULLs, inspect dates and sources, and include data beyond the reporting boundary wherever distance tests reach outside it.
Assigning a CRS changes how software interprets stored coordinates. Reprojecting recalculates the coordinates in another system. If a layer already has the correct source CRS, assigning the target CRS does not convert it. Use QGIS Reproject layer or ArcGIS Pro Project for conversion. If the source label is wrong, identify the actual source system and repair that label before transforming.
Layers can look aligned because the map transforms them on the fly. Read each layer's stored CRS in its properties; a matching display does not tell you which units a processing tool uses.
Match accuracy to the decision
A river drawn 0.5 mm off on a 1:250,000 map can be 125 m from its ground position. That uncertainty is large compared with a narrow setback or detailed 1:1,000 parcel boundary. Combining the layers may create slivers and false near/far classifications. Choose compatible scale, positional accuracy and dates for the analysis question.
Do not trim distance inputs to the reporting boundary too early. Keep a margin at least as wide as the largest threshold distance so sources just outside the area remain available. After analysis, restrict the reported result to the intended area.
Check what each operation can produce
A selection cannot select more features than its available input. A clip cannot cover more ground than the input coverage. A one-to-many join can increase rows, while a keep-all one-to-one join should preserve targets. Use the operation's logic to judge the count or area, not a blanket expectation that every step reduces rows.
Inspect the map and table together. Count unmatched keys after joins. Measure several distances or areas independently and inspect features near a cutoff. For two simple polygon inputs of 10 ha and 6 ha sharing 2 ha, a union covers 14 ha. An output that reports 16 ha may be summing overlapping coverage or stale fields.
Common silent failures include a forgotten selection, a misspelled query value, swapped input and overlay layers, a degree-based buffer and copied area values. An empty output is a signal to inspect these inputs; it may also be the correct answer.
Save results and their history
Save useful QGIS temporary layers to a GeoPackage or another durable format before closing the project. Name intermediate outputs by their role so they can be checked later. Keep the input datasets and dates, tool names, parameter values, step order and output CRS as the result's lineage. QGIS Processing History and ArcGIS Pro geoprocessing History help recover the exact runs.
Add the analysis purpose and required source credits to metadata. Follow each dataset's license; OpenStreetMap data, for example, require attribution. A saved output and its lineage allow another person to inspect how the result was produced.
Key Takeaways
- Assign a CRS to label coordinates; reproject to convert them.
- Choose input accuracy and dates that fit the analysis distance.
- Check output counts and areas using the operation’s actual behavior.
- Save needed temporary layers and record sources, parameters and step order.
6.3 Automate and repeat workflows
Automation makes a tested workflow easier to rerun on updated data or different criteria. Choose the simplest method that repeats the required work: one tool across many inputs, a chain of tools, or a program with loops and conditions.
Run one tool as a batch
Batch processing runs one tool several times from a table of inputs and parameters. To buffer five water-source layers by 250 m, enter five rows, each with an input, distance and output path. In QGIS, right-click a Processing Toolbox tool and choose Execute as Batch Process. ArcGIS Pro offers Batch from a tool's context menu.
Each row is a separate run. A different value in one row changes that run, so review the whole table before starting. Batch processing saves repeated setup; it does not create a multi-tool dependency chain by itself.
Build a parameterized model
A model connects the output of one tool to the next. QGIS Model Designer saves models as .model3 files; ArcGIS Pro ModelBuilder stores them in a toolbox. Publish useful inputs as parameters, such as the parcel layer, road distance, river distance and minimum area. The person rerunning the model can change those values without editing the tool sequence.
For the solar-site workflow, expose road distance 1,000 m, river distance 200 m and minimum area 2 ha. A second run with road distance 1,500 m changes one criterion while preserving the rest. Save its output separately and compare candidates to the original run.
Iteration repeats a step over individual features or files. A national road layer can be clipped once for each of 40 regions. QGIS offers an iterate button beside a vector input; ArcGIS Pro ModelBuilder provides iterators such as Iterate Feature Classes. Check whether the repetition is per file or per feature so it creates the expected outputs.
Read a short tool call
Python can handle loops, conditions and scheduled runs. QGIS uses PyQGIS and Processing; ArcGIS Pro uses ArcPy. This ArcPy call names an input, output, distance and dissolve option:
arcpy.analysis.Buffer("wells", "wells_500m", "500 Meters", dissolve_option="ALL")
The distance includes its unit, and ALL combines overlapping buffer coverage. In QGIS, a Processing call identifies the algorithm and supplies a parameter dictionary, for example:
processing.run("native:buffer", {
"INPUT": "wells.gpkg", "DISTANCE": 500,
"SEGMENTS": 12, "END_CAP_STYLE": 0,
"JOIN_STYLE": 0, "MITER_LIMIT": 2,
"DISSOLVE": True, "OUTPUT": "wells_500m.gpkg"
})
Here 500 uses the input layer's units, so the well layer must be in a suitable meter-based CRS for a 500 m buffer. Processing or geoprocessing history can supply a starting command with the parameters of a run you have already checked.
Test repeatability
Test the model or script on a small subset with known cases. Inspect distance units, outputs, missing records and active subsets before scaling up. Keep the same input versions, software settings and documented parameters when checking reproducibility. Someone using the same data and recorded workflow should be able to obtain the same result; automation faithfully repeats mistakes as well as correct steps.
Key Takeaways
- Batch processing repeats one tool; a model chains tools.
- Expose changing inputs and thresholds as model parameters.
- Iteration repeats work per feature or file.
- Read units and options in a tool call before running it.
- Test a small subset and retain input versions and settings.
Vector Spatial Analysis examples
1From a table question to a joined result
14 steps
- 1IntroductionChoose towns and add useful data
A town layer already has names, regions and population. A separate table contains more district information. The aim is to identify the right towns, calculate a usable measure and attach data without losing or repeating records.
Begin with a condition on the existing table. Each row passes only when the expression evaluates to true; its position on the map does not decide an attribute query.
- 2ExplanationRead fields and values differently
In QGIS, write field names in double quotes and text values in single quotes:
"region" = 'North'. Numbers have no quotes:"population" > 20000. ArcGIS Pro uses Select Layer By Attribute for this kind of test.The expression
'region' = 'North'compares two fixed text strings. It never reads the region field, so every town fails that expression. - 3ExampleGroup the two region choices
The question is "Which towns in North or South have more than 20,000 people?" Start with the two region alternatives in parentheses, then add the population requirement:
("region" = 'North' OR "region" = 'South') AND "population" > 20000Without the parentheses, AND runs first. The query would accept every North town, including those below the population limit.
- 4ExampleCheck selected and unselected towns
Alder has 52,000 people in North, Birch 18,500 in North, Cedar 31,200 in South, Dunmore 9,800 in South, Elm 24,000 in North and Fenwick 12,300 in East.
The grouped query selects Alder, Cedar and Elm. Birch fails the population test despite being in North. Fenwick fails the region test. Inspecting both rejected rows reveals whether both conditions are doing their intended work.
- 5ChallengeInclude the exact upper limit
A village has population 25,000. Does
"population" BETWEEN 10000 AND 25000select it? Would"population" < 25000also select it?---reveal---
BETWEEN selects it because both limits are included. The strict less-than test does not: 25,000 is equal to the limit. Use
<= 25000when the upper endpoint must pass. Test these borderline rows before accepting a query result. - 6ConnectionKeep the result in the right form
A selection highlights the three towns while leaving other rows available. A layer filter hides nonmatching towns from the table, map and tools. Exporting the selection writes a separate dataset for later work.
Choose export when you need a durable analysis stage. Before a later whole-layer tool run, inspect selections and filters; a forgotten restriction can silently shrink its input.
- 7ExampleConvert a stored area
A park covers 420,000 m². For a hectare field, divide by 10,000:
For square kilometers, divide by 1,000,000 to get 0.42 km². A density calculation must divide population by square kilometers, not hectares. Use field names that show units and a decimal field for measurements or ratios so fractional values are retained.
- 8TipConfirm which area function you use
QGIS
$areafollows project area units and ellipsoid settings.area(@geometry)is planar and follows the geometry’s CRS units. In a meter-based layer, the latter returns square meters; in geographic coordinates, it returns square degrees.Check these settings before dividing by 10,000. ArcGIS Pro Calculate Geometry Attributes lets you choose measurement units and a planar or geodesic method.
- 9ChallengeDiagnose an unchanged area value
A parcel originally has
area_haequal to 8. Clipping removes half its ground, but the output still shows 8. What should be updated?---reveal---
Recalculate the ordinary area field from the new geometry using verified units. Clipping copies stored attributes, so 8 still describes the original parcel. Editing that number by a guessed fraction would be less reliable than measuring the actual clipped geometry.
- 10ExplanationRepair the shared identifier
The district layer stores text codes such as '0301'. A census table stores numeric codes such as 301. They are not exact matching keys.
For a four-character identifier, QGIS
lpad(to_string("code"), 4, '0')restores the text format. Check spaces, types and duplicate keys as well. A consistent key is needed before a joined NULL can be interpreted as truly missing source data. - 11ExampleChoose the number of output records
One district may match many school records. A first-match join attaches one school’s values. A one-to-many join repeats the district once per school. Neither is a one-row district school total.
For that total, count or sum the school records by district code first, then join the summary. This makes each matching key supply one summary record and keeps the district-based output easy to check.
- 12ChallengeRead a missing joined value
The district codes now match in format. District '0307' has no row in the census table, and a keep-all join gives it NULL population. Does this mean the district is empty?
---reveal---
No. It means no matching population record was supplied. Zero would claim a measured absence of residents. Keep the district visible and investigate the missing source record before including it in a population total.
- 13ChallengeKeep a joined analysis for later
You built a virtual district join, calculated a density field and need to send the result to another analyst without the linked table. What should be saved, and what must be checked first?
---reveal---
Export a dataset containing the joined values and calculated density. First check matching keys, NULL populations and area units. The export preserves values, but it also preserves any errors already present in the join or calculation.
- 14RecapUse three checks before saving
Before saving a table-based result, read the expression as the original question, inspect the selected and rejected rows, and check the join’s record counts and missing values. Confirm that calculated fields use the intended units.
These checks answer different questions: the query identifies the features, the calculation supplies a measure, and the join supplies outside information. A plausible selected count alone cannot verify all three.
2Select and count features by location
13 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionDecide what spatial contact counts
- 2ExplanationDistinguish touching and overlapping
- 3ExamplePlace a school on an outline
- 4ChallengeTest a stream through a reserve
- 5ExplanationWrite the input first
- 6ExampleNarrow a residential subset
- 7ChallengeFind the residential parcels far from stops
- 8ConnectionLet the target define the records
- 9ExampleWatch one border school create two matches
- 10ChallengeChoose a unique assignment
- 11TipKeep zero and missing separate
- 12ChallengeInvestigate a count that changed
- 13RecapCheck direction, contact and multiplicity
3Build distance zones and compare nearby sites
13 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionChoose a zone or a distance result
- 2ExplanationRead the coordinate unit
- 3ExampleCheck the intended circle area
- 4Key InsightA drawn circle is segmented
- 5ChallengeShrink a rectangular site
- 6ExampleCount overlapping coverage once
- 7ChallengeMeasure a distance band
- 8ConnectionUse a direct threshold when no zone is needed
- 9ExampleCalculate the first clinic distance
- 10ExampleCompare the second clinic
- 11TipChoose all pairs only when they are needed
- 12ChallengeRestore a missing nearby destination
- 13RecapCheck units, shape and available destinations
4Predict overlay pieces and measure them
16 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionPredict what should remain
- 2ExampleBreak the two polygons into three pieces
- 3ExplanationKeep all coverage or only exclusive coverage
- 4ExplanationRemove or cut by the second layer
- 5ChallengeKeep the whole forest and label protection
- 6ConnectionStacking records does not combine coverage
- 7ExampleTotal attributes deliberately
- 8ChallengeSplit islands without creating people
- 9ExampleChoose the denominator
- 10ExplanationStore the whole area before cutting
- 11ExampleAllocate the first tract count
- 12ExampleAdd the second tract contribution
- 13ChallengeDecide which value can be allocated
- 14TipInspect narrow pieces before eliminating them
- 15ChallengeDiagnose a clipped feature’s report
- 16RecapCheck the output geometry and its values
5Repair connections and choose a route cost
14 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionMake the road model match real connections
- 2ExplanationCheck shapes and relationships separately
- 3ExampleRepair an invisible street gap
- 4TipChoose tolerance from the data
- 5ChallengeKeep a real dead end
- 6ConnectionAttach a cost to each edge
- 7ExampleCalculate the short route
- 8ExampleCalculate the middle route
- 9ExampleCalculate the fast route
- 10Key InsightSettle the lowest total cost
- 11ChallengeEnter a minute limit in QGIS
- 12ExplanationFind the right reachable destination
- 13ChallengeInvestigate a surprising detour
- 14RecapInspect connections before trusting costs
6Plan and rerun a candidate-site workflow
14 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionMake every criterion executable
- 2ExplanationChoose inclusion and exclusion tests
- 3ExampleApply the first three criteria
- 4ExampleRemove prohibited whole parcels
- 5ChallengeChange from whole parcels to usable parts
- 6ExplanationPrepare data that fit the thresholds
- 7ExampleTranslate map scale into ground uncertainty
- 8ChallengeDistinguish a smaller input from a tool error
- 9TipSave a result with its lineage
- 10ConnectionChoose one repeated tool or a chain
- 11ExampleExpose a road-distance parameter
- 12ChallengeRead the buffer call
- 13ChallengeMake a changed run comparable
- 14RecapTest once, then repeat the checked chain
Vector Spatial Analysis practice questions
Set 1: Choose features and analysis tools10 Practice Questions
Question 1 of 10
Show answerHide answer
"inspection_date" = NULL will not find the missing dates. Zero would be a recorded value, with a meaning different from a missing date.Question 2 of 10
Show answerHide answer
>= includes exactly 8,000 residents. Without grouping in the longer OR expression, every East village would pass regardless of population.Question 3 of 10
Show answerHide answer
Question 4 of 10
Show answerHide answer
Question 5 of 10
Show answerHide answer
Question 6 of 10
Show answerHide answer
Question 7 of 10
Show answerHide answer
Question 8 of 10
Show answerHide answer
Question 9 of 10
Show answerHide answer
Question 10 of 10
Show answerHide answer
Set 2: Join records and measure results10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Set 3: Check selections, joins and travel costs10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
"code" LIKE 'M_3'?Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Set 4: Diagnose geometry and workflow errors10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
area(@geometry) returns 96,000 for a polygon. Project area units are hectares. What does area(@geometry) / 10000 return?Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Set 5: Choose and defend a complete analysis10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Stuck on your own question? Homework Help
Key Terms
A
Adjacency
Areal weighting
Attribute join
Attribute query
B
Batch processing
BETWEEN
Boundary
Buffer
C
Calculated field
Cardinality
Clip
Closest facility
Comparison layer
Connectivity
Contains
Crosses
CRS assignment
Curve segments
D
Dangle
Dasymetric mapping
Denominator
Difference
Dijkstra's algorithm
Disjoint
Dissolve
Distance matrix
Distance selection
E
Edge effect
Eliminate
End cap
Equal-area projection
Equals
Euclidean distance
Exclusion criterion
Export
Expression
"landuse" = 'orchard' tests a parcel's recorded land use, while an area expression calculates its size.F
Field type
Filter
First-match join
G
Geodesic buffer
Geodesic distance
Geoprocessing workflow
I
Identity
Impedance
IN
"class" IN ('primary', 'secondary') to retain the two classes chosen for an access analysis.Inclusion criterion
Intermediate output
Intersection
Intersects
Iteration
K
Key field
L
LIKE
Lineage
Location selection
Logical operator
M
Merge
Model
Model parameter
Multi-ring buffer
Multipart feature
N
Nearest join
Negative buffer
Network edge
Node
NULL
IS NULL; it is not the same as a date field containing recorded text.O
OD cost matrix
One-to-many output
Overlaps
Overlay
P
Planar measurement
area(@geometry) gives square meters that can be converted to hectares.Point-in-polygon count
Population density
Positional accuracy
R
Reproducibility
Reprojection
S
Selection
Selection complement
Sensitivity check
Service area
Sliver
Snapping tolerance
Spatial join
Summary statistic
Symmetrical difference
T
Target layer
Threshold
Topology
Touches
U
Undershoot
Union
Unmatched target
V
Valid geometry
Variable-distance buffer
Virtual join
Voronoi polygon
W
Within
About this lesson
Make your own Study Materials
Turn your notes, slides and documents into Study Guides, Practice Questions, Flashcards and 6 more tools.