From bf1b34ffd40ba4568b27e8b22b35ece58c7ccfd3 Mon Sep 17 00:00:00 2001 From: Sylvain POULAIN Date: Sun, 15 Sep 2024 15:00:54 +0400 Subject: [PATCH 1/2] Update gcp.py --- dm/opendm/gcp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dm/opendm/gcp.py b/dm/opendm/gcp.py index 49e83f5..ae90161 100644 --- a/dm/opendm/gcp.py +++ b/dm/opendm/gcp.py @@ -25,9 +25,9 @@ def read(self): self.raw_srs = lines[0] # SRS self.srs = location.parse_srs_header(self.raw_srs) - for line in contents[1:]: + for line in lines[1:]: if line != "" and line[0] != "#": - parts = line.strip().split() + parts = line.split() if len(parts) >= 6: self.entries.append(line) else: From 4cfe291d14d84a33d3d0f9f7aed7c153667eba8e Mon Sep 17 00:00:00 2001 From: Sylvain POULAIN Date: Sun, 15 Sep 2024 15:22:52 +0400 Subject: [PATCH 2/2] Update gcp.py --- dm/opendm/gcp.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dm/opendm/gcp.py b/dm/opendm/gcp.py index ae90161..6d1017d 100644 --- a/dm/opendm/gcp.py +++ b/dm/opendm/gcp.py @@ -155,7 +155,7 @@ def make_filtered_copy(self, gcp_file_output, images_dir, min_images=3): if os.path.exists(gcp_file_output): os.remove(gcp_file_output) - files = map(os.path.basename, glob.glob(os.path.join(images_dir, "*"))) + files = list(map(os.path.basename, glob.glob(os.path.join(images_dir, "*")))) output = [self.raw_srs] files_found = 0 @@ -234,6 +234,9 @@ def __init__(self, x, y, z, px, py, filename, extras=""): self.filename = filename self.extras = extras + def coords_key(self): + return "{} {} {}".format(self.x, self.y, self.z) + def __str__(self): return "{} {} {} {} {} {} {}".format(self.x, self.y, self.z, self.px, self.py,