[GIS] What are the considerations for choosing between WKT and WKB geometries

geometryqgisspatialitesqlite

There are many questions & answers here addressing how to convert between WKT and WKB geometries, and about the specifications or implementation details. But what are the considerations for choosing between them in general, when there are no external requirements? For example, is WKB faster?

Or for my specific use case: I want to convert a shapefile to SQLite in QGIS, and have to choose between WKT and WKB. When should I choose one over the other?

Best Answer

The comments cover this pretty well, but I'll summarize them in an answer.

WKT is text and human readable. So use this if you want a human to read them (eg. for quick verification that the data is reasonable), or if you might want to work the data using text tools (eg. regex).

WKB takes up less space - so good for bulk storage. Also it is in theory at least, a little quicker to read/process for two reasons. First there is less data to load/transfer/cache, and second there is no text to parse. In most applications the potential speed difference is probably immaterial unless you are processing large amounts of data.