Geometry Storage Format

In the early days of database spatial, there was much discussion about the nature of the geometry storage format used by database spatial APIs.

Some claimed that the OGC and SQL/MM standards require storage using Well Known Binary (WKB) format they define. Those standards define WKB as an interchange format exported and imported by dedicated functions. The standards do not define WKB (or the related Well Known Text – WKT) as a database storage format.

However, an implementer of a database spatial storage format is free to choose WKB. They are just not required to.

The notable Relational Theory Guru, E.F Codd, stated that the internal storage format of a piece of data is irrelevant.

For nowhere in his Twelve Rules does he say the storage format must be known or published. What is important is encapsulated in Rule 8:

8. Physical Data Independence Rule
“The physical storage of the data should never matter to the system”.

So, for spatial, Codd points out that relational theory doesn’t care if you store geometry data in:

  • a compressed text format eg GML, WKT,
  • a proprietary binary format,
  • an “open” standardized exchange format such e.g., WKB,
  • arrays with ordinates stored as float, double or integer values.

All that is required is that the a set of methods (API) be publicly available to allow any client software to create, update or manipulate the data.