Computer

QGIS GDAL footprint.exe 사용법 (작성중)

Opti-Mr 2024. 10. 24. 20:00
반응형

QGIS 툴로 footprint 배치로 돌리는 방법

1. 영상 root 가서 cmd 열고 파일명 txt로 뽑기

#로컬
dir /s /b *.tif > list.txt

# 네트워크
Get-ChildItem -Path *8b_clip.tif > list.txt

2.  .bat으로 저장

Get-ChildItem -Filter *.tif | ForEach-Object {
    $name = $_.Name
    $geojson = [System.IO.Path]::ChangeExtension($name, '.geojson')
    $gdalPath = "C:\Program Files\QGIS 3.34.8\bin\gdal_footprint.exe"
    "$gdalPath -t_srs EPSG:5179 $name $geojson"
} | Out-File -Encoding ASCII -FilePath "output.bat"

 

안되네,,,

bat으로 안하려면 엑셀로해야하나??

 

2-1. 파일 예시
gdal_footprint.exe -t_srs EPSG:4326 1.tif 1.geojson
gdal_footprint.exe -t_srs EPSG:4326 2.tif 2.geojson
gdal_footprint.exe -t_srs EPSG:4326 input.tif output.geojson
gdal_footprint.exe -t_srs EPSG:4326 input.tif output.geojson
gdal_footprint.exe -t_srs EPSG:4326 input.tif output.geojson
gdal_footprint.exe -t_srs EPSG:4326 input.tif output.geojson
gdal_footprint.exe -t_srs EPSG:4326 input.tif output.geojson
gdal_footprint.exe -t_srs EPSG:4326 input.tif output.geojson

3. bat 파일 실행

 

기본 명령어

1. footprint
C:\Program Files\QGIS 3.34.8\bin\gdal_footprint.exe -t_srs EPSG:5179 input.tif output.geojson

2. geojson -> shp로 변환
ogr2ogr -f "ESRI Shapefile" xView_train.shp xView_train.geojson

 

반응형