In the previous chapter, we learned how to use ST_Collect function to compose Multi-geometries from components. This is computationally cheap, but sometimes, retaining the borders between components (for example, land parcels) is not desirable. This is where union functions come into play.
PostGIS has three unioning functions:
- ST_Union
- ST_MemUnion, which is memory optimized (that is, it will take more time but less memory)
- ST_UnaryUnion, which operates at geometry component-level (and hence is more suitable for Multi-geometries)