Add an import script for pre-sliced tile trees
DJI Terra already emits standard XYZ z/x/y trees, so a good capture does not need slicing again. scripts/import-tiles.ps1 validates the source, refuses a tile-extension mismatch, copies it into the scan root, writes the manifest and triggers a scan. The extension check is the point: detectTileFormat picks whichever tile it happens to see first and the published URL template uses that single extension, so a layer mixing .png and .webp silently 404s half its tiles. GUIDE.md gains the mixed workflow: import for the captures that are good as-is, slice the GeoTIFF when the layer needs to be rebuildable as a mosaic.
This commit is contained in:
@@ -157,6 +157,44 @@ curl.exe -H "Authorization: Bearer $TOKEN" http://127.0.0.1:8910/api/v1/slice/la
|
||||
|
||||
---
|
||||
|
||||
### 另一种做法:直接导入大疆智图的切片
|
||||
|
||||
大疆智图自己就会输出切片(`terra_dom\tile\` 下是标准的 `z/x/y.png`,
|
||||
坐标方案是 **XYZ**,和本服务一致)。如果你在智图里看过、效果满意、
|
||||
不需要重做镶嵌,那就**没必要再切一遍**——直接把它的切片并进来。
|
||||
|
||||
用 `scripts\import-tiles.ps1`:
|
||||
|
||||
```powershell
|
||||
.\scripts\import-tiles.ps1 `
|
||||
-Source "D:\Nie_WorkSpace\煤矿拍摄区域\lidars\terra_dom\tile" `
|
||||
-Code "coal-mine-dom" `
|
||||
-Name "煤矿拍摄区域 DOM"
|
||||
```
|
||||
|
||||
脚本做四件事:校验源目录 → 检查扩展名冲突 → 拷贝进扫描根 → 写好 manifest 并扫描。
|
||||
|
||||
**累加**:同一个 `-Code` 再来一次就是累加,和切片输出落在一起:
|
||||
|
||||
```powershell
|
||||
.\scripts\import-tiles.ps1 -Source "D:\...\第二个项目\terra_dom\tile" `
|
||||
-Code "uav-2026" -Name "2026无人机影像"
|
||||
```
|
||||
|
||||
**为什么要用脚本而不是手拷**:服务发布取图 URL 时,**瓦片扩展名是取"随便找到的第一个文件"**。
|
||||
同一个图层里如果混了 `.png` 和 `.webp`,模板只会发布其中一种,另一种**全部 404 且不报错**。
|
||||
脚本会在拷贝前拦住这种情况。级别范围不一致没关系(自动取并集),**扩展名必须统一**。
|
||||
|
||||
**两种做法怎么选**
|
||||
|
||||
| 情况 | 做法 |
|
||||
|---|---|
|
||||
| 智图里看着满意,不需要重做 | 导入切片(本节),快 |
|
||||
| 要累加、要能"一键重建为镶嵌" | 切片 `dom.tif`(上一节),有源清单 |
|
||||
| 同一次数据既想快又要可重建 | 导入切片发布 + 把 `dom.tif` 也提交一次切片登记为源 |
|
||||
|
||||
> 导入的切片是"成品",`layer_sources` 里不会记录它的原图,
|
||||
> 所以**这类图层用不了控制台的"重建为镶嵌"**。想要那个能力就得走切片。
|
||||
## 三、给下游系统对接
|
||||
|
||||
### 方式一:下游主动拉(推荐)
|
||||
|
||||
Reference in New Issue
Block a user