Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Relationships Between Geometries
ST_Distance and ST_Dwithin
Spatial joins practice
23. Summary


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 geomB.
  • ST_Contains(geomA, geomB) - checks if geomB is entirely contained within geomA.
  • 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 geomA and geomB are within distance X of each other.
  • Spatial joins use spatial functions in the ON clause. Most of the time, these are ST_Intersects or ST_Contains.
  • 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!


Click Next exercise to start the quiz.