I read that in PostGIS, one can have different types of geometry, say, POINT and LINESTRING?? in the same column/field of a table.
I have used ESRI products a lot where each table can only contain one type of geometry. I am just curious what is benefit/motivation for allowing mixed geometry types in PostGIS columns?
To me, what PostGIS did is to have an array of Java
ObjectS, which is kind of pointless, since an
Object (or Geometry in the case of PostGIS) can be anything. We can't really reason much about the base class geometry (e.g. its dimension and inoperability with other entities etc.) because it's too abstract.
For example, polygons have no length, points have no meaningful lengths or areas (because points are often simplified representation of linear/areal objects). Naturally, one can't do statistics/aggregates such as finding out the average measure of a geometry field because a measure may not be defined for some rows, due to the lack of constraint on the specific type of the geometry.
Am I missing some beneficial aspects of the heterogeneous columns?
Also, are there any practical examples of hetergeneous columns for non-geometric types in Postgres? For example, a column that can be both
float-ing point numbers and
bytea, or is the mixed columns a PostGIS invention?