/**
* WKBReader引用 org.locationtech.jts包下
*/
@throws[org.locationtech.jts.io.ParseException]
def sqliteWkb2Wkt(geom: Array[Byte]): String = {
val bytes = new Array[Byte](geom.length - 39)
bytes(0) = geom(1)
for (i <- 1 until bytes.length) {
bytes(i) = geom(i + 38)
}
val wkb = new WKBReader().read(bytes)
// 输出三维, 若原始坐标为二维,则默认不转出z
new WKTWriter(3).write(wkb)
}
读取sqlite坐标数据BLOB-非动态链接库方式
于 2023-03-23 17:55:37 首次发布