网上以讹传讹的说法比较多,大多说称Spatialite Geometry为标准WKB格式,实际上按照官方文档解释并非如此
SpatiaLite internally stores geometry values...using ordinary SQLite's BLOB columns in a format
that is very closely related to WKB format but
not...112,90,64,83,-57,-24,13,-10,97,92,64,41,61,2,-29,60,97,65,64,112,-47,63,0,107,-111,90,64,-2
对比二进制内容
分析WKB...111,90,64
LAST(最后一位,固定值) -2
结论
如果不想或者无法使用spatialite插件,直接截取sql3 Blob字节数组的[39- 倒数第二位],首位增加byteOrder,即为标准WKB...输出jts geometery
参考文档
SpatiaLite internal BLOB-Geometry format (gaia-gis.it):
Well-Known Binary (WKB