Skip to content

Commit abcf941

Browse files
authored
GCP aligned to ODM
Update gcp.py
2 parents 777f1be + 4cfe291 commit abcf941

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

dm/opendm/gcp.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ def read(self):
2525
self.raw_srs = lines[0] # SRS
2626
self.srs = location.parse_srs_header(self.raw_srs)
2727

28-
for line in contents[1:]:
28+
for line in lines[1:]:
2929
if line != "" and line[0] != "#":
30-
parts = line.strip().split()
30+
parts = line.split()
3131
if len(parts) >= 6:
3232
self.entries.append(line)
3333
else:
@@ -155,7 +155,7 @@ def make_filtered_copy(self, gcp_file_output, images_dir, min_images=3):
155155
if os.path.exists(gcp_file_output):
156156
os.remove(gcp_file_output)
157157

158-
files = map(os.path.basename, glob.glob(os.path.join(images_dir, "*")))
158+
files = list(map(os.path.basename, glob.glob(os.path.join(images_dir, "*"))))
159159

160160
output = [self.raw_srs]
161161
files_found = 0
@@ -234,6 +234,9 @@ def __init__(self, x, y, z, px, py, filename, extras=""):
234234
self.filename = filename
235235
self.extras = extras
236236

237+
def coords_key(self):
238+
return "{} {} {}".format(self.x, self.y, self.z)
239+
237240
def __str__(self):
238241
return "{} {} {} {} {} {} {}".format(self.x, self.y, self.z,
239242
self.px, self.py,

0 commit comments

Comments
 (0)