下載地址
- 項(xiàng)目地址: https://github.com/scially/cgt
簡介
傾斜常用工具集
- 支持投影坐標(biāo)系以及WGS84之間坐標(biāo)轉(zhuǎn)換瞎惫。
- 支持根據(jù)矢量范圍線導(dǎo)出對應(yīng)瓦片残拐。
用法說明
命令行參數(shù)說明
基本命令
Usage: cgt [OPTIONS] SUBCOMMAND
Options:
-h,--help Print this help message and exit
-v,--version Display program version information and exit
-i,--in TEXT:DIR REQUIRED osg Data path
-o,--out TEXT:DIR REQUIRED output location
--source-srs TEXT source srs
--source-origin TEXT source srs origin (default: 0,0,0)
-t,--thread UINT thread
Subcommands:
transform coordinate transform
export export osgb data
如果沒有設(shè)置source-srs,source-origin選項(xiàng),cgt默認(rèn)會在輸入根目錄下尋找metadata.xml
支持中文路徑
transform
cgt [options] transform
Options:
--target-srs TEXT REQUIRED target srs
--target-origin TEXT target srs origin(default: 0,0,0)
export
cgt [options] export
Options:
--shapefile TEXT:FILE REQUIRED export extent
-c,--copy BOOLEAN copy tile(default: true)
默認(rèn)會在范圍線的Tile拷貝的out路徑下,通過設(shè)置 -c false 取消拷貝,只輸出符合要求的瓦片名
示例命令
# 坐標(biāo)轉(zhuǎn)換
cgt.exe -i {DATA} -o ${OUT_DIR} transform --target-srs EPSG:4547 --target-origin 435924,2390062,0
# 導(dǎo)出傾斜
cgt.exe -i {DATA} -o ${OUT_DIR} export -s {shp, geojson}
數(shù)據(jù)要求及說明
傾斜攝影數(shù)據(jù)
傾斜攝影數(shù)據(jù)僅支持 smart3d 格式的 osgb 組織方式:
- 根目錄下可以有多個(gè)Data文件夾芬失,比如Data1,Data2等
- 最多有一個(gè)metadata.xml文件,且必須放在根目錄下
- 每個(gè)瓦片目錄下,必須有個(gè)和目錄名同名的 osgb 文件剃斧,否則無法識別根節(jié)點(diǎn);
正確的目錄結(jié)構(gòu)示意:
- Your-data-folder
├ metadata.xml
└ Data/Tile_000_000/Tile_000_000.osgb
└ Data2/Tile_000_000/Tile_000_000.osgb
How To Build
- Windows下建議使用Vcpkg來管理C++依賴忽你,Ubuntu等Linux操作系統(tǒng)可直接使用apt,yum安裝幼东。
- 版本說明:
- GCC >= 8.0 OR MSVC 2019以上
- GDAL >= 3.0
- OSG >= 3.2
- Visual Studio 選擇CMakeLists.txt,導(dǎo)入工程科雳,編譯后根蟹,會自動將GDAL_DATA和PROJ_LIB拷貝到執(zhí)行目錄下
- 將OSGPlugins-${Version}文件夾復(fù)制到執(zhí)行目錄下