forked from OpenDroneMap/PyODM
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_geo_file.py
More file actions
33 lines (28 loc) · 880 Bytes
/
create_geo_file.py
File metadata and controls
33 lines (28 loc) · 880 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import os
# input_path = 'data/2018-11-13 10-02-50-CAM.log'
# images = sorted(os.listdir('data/2018-11-14_avdelning_Ribbfors_1-3'))
input_path = 'data/example/2018-11-13 10-02-50-CAM.log'
images = sorted(os.listdir('data/example'))
images = [im for im in images if im.endswith('.JPG')]
with open(input_path, 'r') as f:
data = f.readlines()
longitudes = []
latitudes = []
alts = []
for d in data[1:]:
d = d.split(',')
longitudes.append(float(d[5]))
latitudes.append(float(d[4]))
alts.append(float(d[6]))
longitudes = tuple(longitudes)
latitudes = tuple(latitudes)
alts = tuple(alts)
new_data = tuple(zip(images, longitudes, latitudes, alts))
with open('geo.txt', 'w', encoding='UTF-8') as f:
f.write('EPSG:4326')
f.write('\n')
for d in new_data:
for i in d:
f.write(str(i))
f.write(' ')
f.write('\n')