From 635a8a362b531a284f5330b82dc5b90f83d8c1bc Mon Sep 17 00:00:00 2001 From: Stephen Winn Date: Thu, 5 Sep 2024 14:28:52 +0900 Subject: [PATCH] Revert "[WIP] Added steps to include TIFFTAG data in the output .tif" This reverts commit 4734d8838f74ed29de4cb4c87a3f48a40e949efc. --- opendm/dem/utils.py | 8 -------- opendm/orthophoto.py | 7 ------- stages/odm_dem.py | 3 --- stages/odm_orthophoto.py | 3 --- 4 files changed, 21 deletions(-) diff --git a/opendm/dem/utils.py b/opendm/dem/utils.py index 507e44ad..9fb383a9 100644 --- a/opendm/dem/utils.py +++ b/opendm/dem/utils.py @@ -1,4 +1,3 @@ -import rasterio def get_dem_vars(args): return { @@ -9,10 +8,3 @@ def get_dem_vars(args): 'BIGTIFF': 'IF_SAFER', 'NUM_THREADS': args.max_concurrency, } - -def update_tags(dem_file): - - # - Update the geotiff tags in place using rasterio - with rasterio.open(dem_file, 'r+') as rst: - rst.update_tags(TIFFTAG_DATETIME='2024:01:01 00:00+00:00') - rst.update_tags(TIFFTAG_SOFTWARE='OpenDroneMap') diff --git a/opendm/orthophoto.py b/opendm/orthophoto.py index 663f3cb2..319a504c 100644 --- a/opendm/orthophoto.py +++ b/opendm/orthophoto.py @@ -27,13 +27,6 @@ def get_orthophoto_vars(args): 'NUM_THREADS': args.max_concurrency } -def update_tags(orthophoto_file): - - # - Update the geotiff tags in place using rasterio - with rasterio.open(orthophoto_file, 'r+') as rst: - rst.update_tags(TIFFTAG_DATETIME='2024:01:01 00:00+00:00') - rst.update_tags(TIFFTAG_SOFTWARE='OpenDroneMap') - def build_overviews(orthophoto_file): log.ODM_INFO("Building Overviews") kwargs = {'orthophoto': orthophoto_file} diff --git a/stages/odm_dem.py b/stages/odm_dem.py index f9671215..6964e036 100755 --- a/stages/odm_dem.py +++ b/stages/odm_dem.py @@ -80,9 +80,6 @@ class ODMDEMStage(types.ODM_Stage): dem_geotiff_path = os.path.join(odm_dem_root, "{}.tif".format(product)) bounds_file_path = os.path.join(tree.odm_georeferencing, 'odm_georeferenced_model.bounds.gpkg') - # update dem tags - utils.update_tags(dem_geotiff_path) - if args.crop > 0 or args.boundary: # Crop DEM Cropper.crop(bounds_file_path, dem_geotiff_path, utils.get_dem_vars(args), keep_original=not args.optimize_disk_space) diff --git a/stages/odm_orthophoto.py b/stages/odm_orthophoto.py index 91677064..e66d89db 100644 --- a/stages/odm_orthophoto.py +++ b/stages/odm_orthophoto.py @@ -109,9 +109,6 @@ class ODMOrthoPhotoStage(types.ODM_Stage): '-outputCornerFile "{corners}" {bands} {depth_idx} {inpaint} ' '{utm_offsets} {a_srs} {vars} {gdal_configs} '.format(**kwargs), env_vars={'OMP_NUM_THREADS': args.max_concurrency}) - # update output orthophoto tags - orthophoto.update_tags(tree.odm_orthophoto_tif) - # Create georeferenced GeoTiff if reconstruction.is_georeferenced(): bounds_file_path = os.path.join(tree.odm_georeferencing, 'odm_georeferenced_model.bounds.gpkg')