참고자료 : https://www.osgeo.kr/17

1. Metadata Parsing

1.1.xml에서 위,경도 뽑기

from shapely.geometry import Point
import geopandas as gpd
from xml.etree.ElementTree import parse
import argparse

parser = argparse.ArgumentParser(description="find lat long from xml metadata")
parser.add_argument("--xml_path", required=True, type=str, help="Path for xml files")
args = parser.parse_args()

def xy_from_xml(xml_path):
    tree = parse(xml_path)
    root = tree.getroot()
    coordinate = root.findall('좌표계')
    starting_point = [axis.findtext("투영원점") for axis in coordinate][0]
    x = [axis.findtext("원점X좌표") for axis in coordinate][0]
    y = [axis.findtext("원점Y좌표") for axis in coordinate][0]
    
    crs = find_crs(starting_point)
    lat, lng = get_point(crs, int(x), int(y))
    return lat, lng

def find_crs(starting_point):
    if starting_point == '서부':
        return 'EPSG:5185'
    elif starting_point == '중부':
        return 'EPSG:5186'
    elif starting_point == '동부':
        return 'EPSG:5187'
    elif starting_point == '동해':
        return 'EPSG:5188'
    
    
def get_point(crs, x, y):
    p = Point(x,y)
    g = gpd.GeoDataFrame(geometry = [p], crs = crs)
    g_point = str(g.to_crs('EPSG:4326').loc[0]['geometry'])
    g_point = g_point.replace('(', '')
    g_point = g_point.replace(')', '')
    g_list = g_point.split(' ')
    lat, lng = g_list[2], g_list[1]
    return lat, lng

if __name__ == '__main__':
    xml_path = args.xml_path
    lat, lng = xy_from_xml(xml_path)
    print(lat, lng)

2. Google Earth Pro

2.1. Google 어스 옵션에서 ‘십진법으로 표기’로 변경

Untitled

2.2. 원하는 지점으로 이동 후 ‘보기-재설정-기울이기 및 둘레’ 를 눌러서 보정

Untitled

2.3. 아이콘 추가하기를 눌러 해당 지점 위도, 경도 확인

Untitled

3. QGIS

3.1. QGIS 실행 후 ‘Raster-Georeferencer’

Untitled

3.2. Open Raster 를 눌러 영상 등록