Instruction
Great! To sum things up, here is the difference between ST_Centroid and ST_PointOnSurface.
ST_Centroidis quick, but can potentially return a point outside the bounds of a given geometry.ST_PointOnSurfaceis much slower, but always finds a point that lie inside or on the bounds of a given geometry.
The difference is also illustrated in the picture below.

Exercise
Mark the cyclist strikes again! He wants to find the number of bicycle routes for which the centroid equals the point on surface.
Stuck? Here's a hint!
Use COUNT(*). In the WHERE clause, use ST_Centroid and ST_PointOnSurface passing in the same column as an argument.



