Skip to content

Commit

Permalink
Automatically set --cog if postprocessing is required (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
pierotofy committed Jun 4, 2021
1 parent d80ec21 commit e809c96
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions libs/Task.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,25 @@ module.exports = class Task{
}
},

cb => {
// If we need to post process results
// if cog is supported (build cloud optimized geotiffs)
// we automatically add the cog option to the task options by default
if (this.skipPostProcessing) cb();
else{
odmInfo.supportsOption("cog", (err, supported) => {
if (err){
console.warn(`Cannot check for supported option cog: ${err}`);
}else if (supported){
if (!this.options.find(opt => opt.name === "cog")){
this.options.push({ name: 'cog', value: true });
}
}
cb();
});
}
},

// Read images info
cb => {
fs.readdir(this.getImagesFolderPath(), (err, files) => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "NodeODM",
"version": "2.1.6",
"version": "2.1.7",
"description": "REST API to access ODM",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit e809c96

Please sign in to comment.