Skip to content

Commit e809c96

Browse files
authored
Automatically set --cog if postprocessing is required (#155)
1 parent d80ec21 commit e809c96

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

libs/Task.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,25 @@ module.exports = class Task{
8484
}
8585
},
8686

87+
cb => {
88+
// If we need to post process results
89+
// if cog is supported (build cloud optimized geotiffs)
90+
// we automatically add the cog option to the task options by default
91+
if (this.skipPostProcessing) cb();
92+
else{
93+
odmInfo.supportsOption("cog", (err, supported) => {
94+
if (err){
95+
console.warn(`Cannot check for supported option cog: ${err}`);
96+
}else if (supported){
97+
if (!this.options.find(opt => opt.name === "cog")){
98+
this.options.push({ name: 'cog', value: true });
99+
}
100+
}
101+
cb();
102+
});
103+
}
104+
},
105+
87106
// Read images info
88107
cb => {
89108
fs.readdir(this.getImagesFolderPath(), (err, files) => {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "NodeODM",
3-
"version": "2.1.6",
3+
"version": "2.1.7",
44
"description": "REST API to access ODM",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)