2👍
Geometry Types are stored in WKB (Well-Known Binary) form within PostGIS.
WKB form is a string of bytes that encode the information about this geometry. It holds information such as what kind of geometry is described (point, line, polygon, etc) as well as the actual information needed to represent the geometry itself.
The first byte in the stream identifies how the binary values are represented, either: NDR (Network Data Representation or XDR (eXtended Data Representation). The difference between the two encodings is byte order. NDR is little endian, which means that an unsigned integer – a 32 bit data type that encodes a nonnegative integer – stores the least significant byte first, while a double – a 64 bit double precision data type that encodes a double precision number using the IEEE 54 double precision format – stores the sign bit as the last byte. XDR is big endian, so the byte order is reversed.
The next component in the stream indicates the geometry type. Values from 1 through 7 indicate Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection.
If a geometry consists of multiple geometries, additional bytes indicate how many geometries there are.The next byte component indicates the number of points in the first shape, followed by the X,Y coordinates of each of the points. For each additional shape, a byte indicates the number of points, followed by bytes defining each point’s coordinate values.
Alternatively, WKT (Well-Known Text) is a representation of geometry that would offer a better description for a human observer. WKT can be displayed by using the method ST_AsText in postGIS. There is a listing of examples of WKT representations for various geometry types in the postGIS documentation here.
If you would like more information about the WKB, see this helpful explanation of the representation.