Merge pull request #1521 from theoway/split-merge-warning

Added a warning before split-merge to ensure GPS/`image_groups.txt` info is present.
pull/1524/head
Piero Toffanin 2022-08-05 11:12:12 -04:00 zatwierdzone przez GitHub
commit 90a60cb58a
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 20 dodań i 1 usunięć

Wyświetl plik

@ -93,6 +93,13 @@ class ODM_Reconstruction(object):
def has_gcp(self):
return self.is_georeferenced() and self.gcp is not None and self.gcp.exists()
def has_geotagged_photos(self):
for photo in self.photos:
if photo.latitude is None and photo.longitude is None:
return False
return True
def georeference_with_gcp(self, gcp_file, output_coords_file, output_gcp_file, output_model_txt_geo, rerun=False):
if not io.file_exists(output_coords_file) or not io.file_exists(output_gcp_file) or rerun:

Wyświetl plik

@ -27,7 +27,19 @@ class ODMSplitStage(types.ODM_Stage):
reconstruction = outputs['reconstruction']
photos = reconstruction.photos
outputs['large'] = len(photos) > args.split
gps_info_available = False
# check for availability of either image_groups.txt (split-merge) or geotagged photos
image_groups_file = os.path.join(args.project_path, "image_groups.txt")
if 'split_image_groups_is_set' in args:
image_groups_file = os.path.abspath(args.split_image_groups)
if io.file_exists(image_groups_file) or reconstruction.has_geotagged_photos():
gps_info_available = True
should_split = len(photos) > args.split
if should_split and not gps_info_available:
log.ODM_WARNING('Could not perform split-merge as GPS information in photos or image_groups.txt is missing.')
outputs['large'] = should_split and gps_info_available
if outputs['large']:
# If we have a cluster address, we'll use a distributed workflow