Skip to content

Commit

Permalink
Merge pull request #197 from pierotofy/gltf
Browse files Browse the repository at this point in the history
Automatically set --gltf when processing with WebODM
  • Loading branch information
pierotofy committed Jan 28, 2023
2 parents d3ee44d + ca61927 commit 5d4703a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 27 deletions.
40 changes: 14 additions & 26 deletions libs/Task.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,44 +118,32 @@ module.exports = class Task{
}

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

cb => {
const autoSet = (opt) => {
return 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 opt is supported
// we automatically add the opt to the task options by default
if (this.skipPostProcessing) cb();
else{
odmInfo.supportsOption("cog", (err, supported) => {
odmInfo.supportsOption(opt, (err, supported) => {
if (err){
console.warn(`Cannot check for supported option cog: ${err}`);
console.warn(`Cannot check for supported option ${opt}: ${err}`);
}else if (supported){
if (!this.options.find(opt => opt.name === "cog")){
this.options.push({ name: 'cog', value: true });
if (!this.options.find(o => o.name === opt)){
this.options.push({ name: opt, value: true });
}
}
cb();
});
}
}
};

return [
autoSet("pc-ept"),
autoSet("cog"),
autoSet("gltf")
];
}

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.2.1",
"version": "2.2.2",
"description": "REST API to access ODM",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 5d4703a

Please sign in to comment.