[GIS] Geometry column naming convention – ‘geom’ or ‘the_geom’

geonamespostgisschema-architecture

I'm starting my first PostGIS project, and in various books and tutorials I've seen the geometry column labelled either 'geom' or 'the_geom'. Is one more conventional than the other?

Furthermore, is there a good reason to use 'geom'/'the_geom' instead of a more descriptive name for the geometry column? (E.g. 'centre_point' for the central point of a feature.) We don't label conventional db columns 'the_int' or 'the_string', so why label geometry columns this way?

Best Answer

As of PostGIS version 2.0, "geom" is the common column name. (At least I see it documentation, etc.) Prior to that it was "the_geom", and I can only speculate as to why.

You may safely use either, but I am happily using "geom" in PostGIS and SpatiaLite.

Edit: Because I completely missed the second part of the question.
In general, a common name is convenient because it is common for GIS software to require that geometries in a table be constrained to a single specific type, SRID, etc. Therefore, table names tend to be more descriptive than the geometry column name. For example, you would expect to find tables named "school_zone_polygons", "school_zone_centroids" each with a "geom" column; not a "school_zones" table with "geom_polygon", "geom_centroid" columns.

Having a common name means you don't have to check the schema every time you want to reference a geometry column.

Related Question