Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions opendm/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
'auto_boundary_distance': 'odm_filterpoints',
'bg_removal': 'dataset',
'boundary': 'odm_filterpoints',
'build_overviews': 'odm_orthophoto',
'camera_lens': 'dataset',
'cameras': 'dataset',
'cog': 'odm_dem',
Expand Down Expand Up @@ -753,12 +752,6 @@ def config(argv=None, parser=None):
'Note that not all cameras are present in the database. Set to 0 to use the database value. '
'Default: %(default)s')

parser.add_argument('--build-overviews',
action=StoreTrue,
nargs=0,
default=False,
help='Build orthophoto overviews for faster display in programs such as QGIS. Default: %(default)s')

parser.add_argument('--cog',
action=StoreTrue,
nargs=0,
Expand Down Expand Up @@ -903,14 +896,18 @@ def config(argv=None, parser=None):
'Default: %(default)s'))

args, unknown = parser.parse_known_args(argv)
DEPRECATED = ["--verbose", "--debug", "--time", "--resize-to", "--depthmap-resolution", "--pc-geometric", "--texturing-data-term", "--texturing-outlier-removal-type", "--texturing-tone-mapping", "--texturing-skip-local-seam-leveling"]
DEPRECATED = ["--verbose", "--debug", "--time", "--resize-to", "--depthmap-resolution", "--pc-geometric", "--texturing-data-term", "--texturing-outlier-removal-type", "--texturing-tone-mapping", "--texturing-skip-local-seam-leveling", "--build-overviews"]
unknown_e = [p for p in unknown if p not in DEPRECATED]
if len(unknown_e) > 0:
raise parser.error("unrecognized arguments: %s" % " ".join(unknown_e))

for p in unknown:
if p in DEPRECATED:
log.WARNING("%s is no longer a valid argument and will be ignored!" % p)
if p == "--build-overviews" and not args.cog:
log.WARNING("Turning on --cog to build overviews")
args.cog = True


# check that the project path setting has been set properly
if not args.project_path:
Expand Down
15 changes: 0 additions & 15 deletions opendm/orthophoto.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,6 @@ def get_orthophoto_vars(args):
'NUM_THREADS': args.max_concurrency
}

def build_overviews(orthophoto_file):
log.INFO("Building Overviews")
kwargs = {'orthophoto': orthophoto_file}

# Run gdaladdo
system.run('gdaladdo -r average '
'--config BIGTIFF_OVERVIEW IF_SAFER '
'--config COMPRESS_OVERVIEW JPEG '
'--config INTERLEAVE_OVERVIEW PIXEL '
'--config PHOTOMETRIC_OVERVIEW YCBCR'
'{orthophoto} 2 4 8 16'.format(**kwargs))

def generate_png(orthophoto_file, output_file=None, outsize=None):
if output_file is None:
base, ext = os.path.splitext(orthophoto_file)
Expand Down Expand Up @@ -174,9 +162,6 @@ def post_orthophoto_steps(args, bounds_file_path, orthophoto_file, orthophoto_ti
if args.crop > 0 or args.boundary:
Cropper.crop(bounds_file_path, orthophoto_file, get_orthophoto_vars(args), keep_original=not args.optimize_disk_space, warp_options=['-dstalpha'])

if args.build_overviews and not args.cog:
build_overviews(orthophoto_file)

if args.orthophoto_png:
generate_png(orthophoto_file)

Expand Down
Loading