Let's now move on to the second topic of this part: collections.
PostGIS makes it possible to organize spatial data into collections. This means you can throw multiple points, linestrings or polygons into a single row. For instance, this can be helpful if you want to store all hotels of a given chain in one place.
Generally speaking, there are four types of collections:
- Multipoint - collection type that stores one or more points.
- Multilinestring - collection type that stores one or more linestrings.
- Multipolygon - collection type that stores one or more polygons.
- GeometryCollection - a generic collection type that can store one or more geometry types (any mix of points, linestrings and polygons, essentialy).
Just like other geometry types, collections are stored in the internal PostGIS format, but can be converted to a human-readable format with
Let's find out what an example collection looks like.