您當前的位置:首頁 > 繪畫

用exiftool批次匯出照片gps資訊並轉換為kml檔案

作者:由 starwalker 發表于 繪畫時間:2022-11-01

用exiftool批次匯出照片gps資訊並轉換為kml檔案

去官網下載exiftool,window版下載下來是一個exiftool(k)。exe,將其改名為exiftool。exe方便使用

將exiftool。exe檔案複製到照片資料夾內

複製以下內容到記事本,儲存為kml。fmt檔案,將其放到照片資料夾內

#————————————————————————————————————————

# File: kml。fmt

#

# Description: Example ExifTool print format file for generating a

# Google Earth KML file from a collection of geotagged images

#

# Usage: exiftool -p kml。fmt -r DIR [。。。] > out。kml

#

# Requires: ExifTool version 10。41 or later

#

# Revisions: 2010/02/05 - P。 Harvey created

# 2013/02/05 - PH Fixed camera icon to work with new Google Earth

# 2017/02/02 - PH Organize into folders based on file directory

# 2018/01/04 - PH Added IF to be sure position exists

# 2020/01/11 - F。 Kotov Limited image preview size to 500px

#

# Notes: 1) Input files must contain GPSLatitude and GPSLongitude。

# 2) Add the -ee option to extract the full track from video files。

# 3) For Google Earth to be able to find the images, the input

# images must be specified using relative paths, and “out。kml”

# must stay in the same directory as where the command was run。

# 4) Google Earth is picky about the case of the image file extension,

# and may not be able to display the image if an upper-case

# extension is used。

# 5) The -fileOrder option may be used to control the order of the

# generated placemarks when processing multiple files。

#————————————————————————————————————————

#[HEAD]<?xml version=“1。0” encoding=“UTF-8”?>

#[HEAD]

#[HEAD]

#[HEAD] My Photos

#[HEAD] 1

#[HEAD]

#[SECT]

#[SECT] $main:directory

#[SECT] 0

#[IF] $gpslatitude $gpslongitude

#[BODY]

#[BODY] <![CDATA[用exiftool批次匯出照片gps資訊並轉換為kml檔案

#[BODY] style=‘max-width:500px;max-height:500px;’> ]]>

#[BODY]

#[BODY]

#[BODY] $filename

#[BODY] #Photo

#[BODY]

#[BODY] clampedToGround

#[BODY] $gpslongitude#,$gpslatitude#,0

#[BODY]

#[BODY]

#[ENDS]

#[TAIL]

#[TAIL]

4。開啟cmd,進入照片資料夾,執行以下命令,其中的點。表示當前目錄

exiftool -p kml。fmt -r 。 >out。kml

用exiftool批次匯出照片gps資訊並轉換為kml檔案

如果想將kml檔案及照片一起分享給別人,可以修改kml檔案,將其中的照片絕對路徑修改為相對路徑,然後把kml檔案和照片一起打包為zip檔案,再將zip副檔名改為kmz即可。

標簽: head  kml  body  exiftool  ##