force icon indicating copy to clipboard operation
force copied to clipboard

force-mosaic only supports tif

Open maxfreu opened this issue 2 years ago • 4 comments

Hi! The .tif file extensions is hardcoded in force-mosaic. Therefore it fails for my cog files. I think the easiest fix would be to give another argument for the extension.

maxfreu avatar Sep 15 '22 09:09 maxfreu

or just use tif extension for your COG, because essentially, it is a tif.

davidfrantz avatar Sep 15 '22 09:09 davidfrantz

True. But then it would be cool to have some hint that prints with -h :)

maxfreu avatar Sep 15 '22 09:09 maxfreu

Oh by the way, there is a way to speed up the process significally, especially for cubes with lots of small files: Use find -L "$ROUT" \( -name '*.dat' -o -name '*.tif' \) | xargs basename -a | sort | uniq > $PRODUCTS instead of find -L "$ROUT" \( -name '*.dat' -o -name '*.tif' \) -exec basename {} \; | sort | uniq > $PRODUCTS The problem is that -exec invokes basename for each file, which is slow. xargs comes pre-packaged with Ubuntu, so should work for all users.

maxfreu avatar Sep 15 '22 10:09 maxfreu

Thanks, that makes a lot of sense. Can you pull request this?

Best, David

davidfrantz avatar Sep 15 '22 10:09 davidfrantz