什么是 Martin
Martin 是一个高性能的地图切片服务器,使用Rust
编写,支持PostGIS
,MBTiles,PMTiles。
martin 下载:
https://gitee.com/libmaps/martin
有下载链接:https://github.com/maplibre/martin/releases/latest/download/martin-x86_64-pc-windows-msvc.zip FQ可以下载。
解压到某文件下,cmd , 启动:
martin.exe martin_demo/mbtiles4j-test.mbtiles --listen-addresses 0.0.0.0:7700
http://localhost:7700/catalog
{
"tiles": {
"mbtiles4j-test": {
"content_type": "image/png",
"name": "Control Room"
}
},
"sprites": {},
"fonts": {}
}
http://localhost:7700/mbtiles4j-test
{
"tilejson": "3.0.0",
"tiles": [
"http://localhost:7700/mbtiles4j-test/{z}/{x}/{y}"
],
"bounds": [
-10.2832,
35.7465,
2.7246,
44.1507
],
"maxzoom": 2,
"minzoom": 0,
"name": "Control Room",
"version": "1.0.0"
}
什么是 MBTiles
MBTiles 是个sqlite
文件,也就是说MBTiles
文件是个单文件数据库。截至本文写作时,最新标准是1.3.MBTIles
利用了数据库的索引机制,避免相同内容的切片重复占用空间,同时也有了 SQLITE
数据库单文件的优点,非常方便传输与利用。
为什么使用 MBTiles
- 单文件,就是爽(对比下 ArcGIS 生成的 Bundles中无数个小切片文件...🥶)
- 紧凑,配合索引机制,可以避免相同内容的切片重复出现,节省磁盘空间
MBTiles
本质上还是个SQLITE
数据库,解析利用都非常方便,生态良好,有大量的配套软件
MBTiles | PMTiles | ArcGIS Bundle(即 raster-tiles-compactcache) | COG(Cloud Optimized GeoTIFF) | |
---|---|---|---|---|
单文件 | 😄 | 😄 | 🥶 | 😄 |
支持无服务器(serverless )的方式使用 |
🥶 | 😄 | 🥶 | 😄 |
矢量 | 😄 | 😄 | 🥶 | 🥶 |
栅格 | 😄 | 😄 | 😄 | 😄 |
开源社区生态 | 😄 | 😄 | 🥶 | 😄 |
PS: 可以使用Navicat、DBeaver(有社区版,开源免费)等数据库管理软件打开 MBTiles 文件,直接查看其内部表结构,加深对 MBTiles 文件格式的理解。也可以试用QGIS加载切片数据,查看地图。
idea 里也可以查看表,记录,瓦片。
martin.exe martin_demo/bbb.mbtiles --listen-addresses 0.0.0.0:7700
http://localhost:7700/catalog
1 2 3 4 5 6 7 8 9 10 11 12 | { "tiles" : { "bbb" : { "content_type" : "application/x-protobuf" , "content_encoding" : "gzip" , "name" : "bbb.mbtiles" , "description" : "bbb.mbtiles" } }, "sprites" : {}, "fonts" : {} } |
npm start
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· 字符编码:从基础到乱码解决
· Open-Sora 2.0 重磅开源!
2021-07-27 高德javascript api使用 arcgis 发布的wmts服务