场景
对于一个地图平铺项目(想想谷歌地球(,我有一个.mbtile
文件,我对它一无所知,除了它有很多关于地球上城市的数据。我已经研究了几天,发现了以下内容:
- 文件是一个sqlite数据库
- 数据库有一个满是Blob的表
tiles
- Blob是带有gzip签名的二进制文件
- 解压缩后,结果是一个协议缓冲区
我没怎么和protobuf合作过,所以我正在上速成班。我取了解压缩的二进制文件,用protoc --decode_raw
收到了以下
$ echo 1a900178010a06706c6163657328802012121208000001010202030318012204095cd6341213120800040105020603071801220509e206b2361a047a6d696e1a046e616d651a0a706f70756c6174696f6e1a0773756274696c652202280322070a053f73616b61220528b0aab105220328c006220919333333333333fb3f22070a05546f6b796f220528e0be8111220328e306 | xxd -r -p | protoc --decode_raw
3 {
15: 1
1: "places"
5: 4096
2 {
2: "