Summary
Spatial analysis functions are a key feature for spatial databases, and PostGIS has a very rich set of them. One can compose geometries from raw coordinates, compose geometries into more complex shapes, break down complex shapes into elementary geometries, calculate spatial metrics, and query features based on their location. Spatial analysis functions require the geometries to conform to a specification, so validation and automated repair functions are also provided.
Most spatial analysis functions are easy to understand, but special attention must be paid to coordinate systems. When using latitude-longitude coordinate systems, it's best to use the geography data type to ensure the calculated measurements are correct.