Well done! You've come a long way. It's time to wrap things up.
In this part of the course, we learned how to compare geometries with one another. We learned about the following useful functions:
ST_Equals(geomA,geomB) checks if two geometries have the same coordinates.
ST_Overlaps(geomA,geomB) checks if two objects have some (but not all) space in common.
ST_Touches(geomA,geomB) checks if two objects touch at a common border (but don't overlap).
ST_Within(geomA,geomB) checks if
geomA is entirely contained within
ST_Contains(geomA, geomB) - checks if
geomB is entirely contained within
ST_Intersects(geomA,geomB) - checks whether two objects have any space or borders in common.
ST_Distance(geomA,geomB) returns the shortest distance between two geometries.
ST_DWithin(geomA,geomB,distanceX) checks whether
geomB are within distance X of each other.
- Spatial joins use spatial functions in the
ON clause. Most of the time, these are
- You can also add further elements to spatial joins, such as aggregate functions with
GROUP BY clauses.
- You can also use a spatial function like
ST_Length inside an aggregate function.
Alright, it's now time to practice all you've learned!