kopia lustrzana https://github.com/OpenDroneMap/NodeODM
Added skippostprocess parameter, converted tabs to spaces in files
rodzic
43558492f1
commit
cdf175f16c
|
@ -8,7 +8,7 @@ REST API to access ODM
|
|||
|
||||
=== Version information
|
||||
[%hardbreaks]
|
||||
_Version_ : 1.3.0
|
||||
_Version_ : 1.3.1
|
||||
|
||||
|
||||
=== Contact information
|
||||
|
@ -299,6 +299,8 @@ _optional_|Images to process, plus an optional GCP file. If included, the GCP fi
|
|||
_optional_|An optional name to be associated with the task|string|
|
||||
|*FormData*|*options* +
|
||||
_optional_|Serialized JSON string of the options to use for processing, as an array of the format: [{name: option1, value: value1}, {name: option2, value: value2}, …]. For example, [{"name":"cmvs-maxImages","value":"500"},{"name":"time","value":true}]. For a list of all options, call /options|string|
|
||||
|*FormData*|*skipPostProcessing* +
|
||||
_optional_|When set, skips generation of map tiles, derivate assets, point cloud tiles.|boolean|
|
||||
|*FormData*|*zipurl* +
|
||||
_optional_|URL of the zip file containing the images to process, plus an optional GCP file. If included, the GCP file should have .txt extension|string|
|
||||
|===
|
||||
|
|
File diff suppressed because one or more lines are too long
10
index.js
10
index.js
|
@ -119,6 +119,12 @@ let server;
|
|||
* required: false
|
||||
* type: string
|
||||
* -
|
||||
* name: skipPostProcessing
|
||||
* in: formData
|
||||
* description: 'When set, skips generation of map tiles, derivate assets, point cloud tiles.'
|
||||
* required: false
|
||||
* type: boolean
|
||||
* -
|
||||
* name: token
|
||||
* in: query
|
||||
* description: 'Token required for authentication (when authentication is required).'
|
||||
|
@ -287,7 +293,9 @@ app.post('/task/new', authCheck, (req, res, next) => {
|
|||
res.json({ uuid: req.id });
|
||||
cb();
|
||||
}
|
||||
}, req.body.options, req.body.webhook);
|
||||
}, req.body.options,
|
||||
req.body.webhook,
|
||||
req.body.skipPostProcessing === 'true');
|
||||
}
|
||||
], err => {
|
||||
if (err) die(err.message);
|
||||
|
|
16
libs/Task.js
16
libs/Task.js
|
@ -36,7 +36,7 @@ const request = require('request');
|
|||
const statusCodes = require('./statusCodes');
|
||||
|
||||
module.exports = class Task{
|
||||
constructor(uuid, name, done, options = [], webhook = null){
|
||||
constructor(uuid, name, done, options = [], webhook = null, skipPostProcessing = false){
|
||||
assert(uuid !== undefined, "uuid must be set");
|
||||
assert(done !== undefined, "ready must be set");
|
||||
|
||||
|
@ -50,6 +50,7 @@ module.exports = class Task{
|
|||
this.output = [];
|
||||
this.runningProcesses = [];
|
||||
this.webhook = webhook;
|
||||
this.skipPostProcessing = skipPostProcessing;
|
||||
|
||||
async.series([
|
||||
// Read images info
|
||||
|
@ -100,7 +101,7 @@ module.exports = class Task{
|
|||
}
|
||||
done(null, task);
|
||||
}
|
||||
}, taskJson.options, taskJson.webhook);
|
||||
}, taskJson.options, taskJson.webhook, taskJson.skipPostProcessing);
|
||||
}
|
||||
|
||||
// Get path where images are stored for this task
|
||||
|
@ -336,10 +337,10 @@ module.exports = class Task{
|
|||
}
|
||||
}
|
||||
|
||||
let tasks = [
|
||||
runPostProcessingScript(),
|
||||
createZipArchive('all.zip', allPaths)
|
||||
];
|
||||
let tasks = [];
|
||||
if (!this.skipPostProcessing) tasks.push(runPostProcessingScript());
|
||||
|
||||
tasks.push(createZipArchive('all.zip', allPaths));
|
||||
|
||||
// Upload to S3 all paths + all.zip file (if config says so)
|
||||
if (S3.enabled()){
|
||||
|
@ -521,7 +522,8 @@ module.exports = class Task{
|
|||
dateCreated: this.dateCreated,
|
||||
status: this.status,
|
||||
options: this.options,
|
||||
webhook: this.webhook
|
||||
webhook: this.webhook,
|
||||
skipPostProcessing: !!this.skipPostProcessing
|
||||
};
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "node-opendronemap",
|
||||
"version": "1.3.0",
|
||||
"version": "1.3.1",
|
||||
"description": "REST API to access ODM",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
|
|
@ -47,11 +47,9 @@
|
|||
</div>
|
||||
<div id="imagesInput" class="form-group">
|
||||
<label for="images">Aerial Images and GCP List (optional):</label> <input id="images" name="images" multiple accept="image/*|.txt|.zip" type="file">
|
||||
|
||||
</div>
|
||||
<div id="zipFileInput" class="form-group hidden">
|
||||
<label for="zipurl">URL to zip file with Aerial Images and GCP List (optional):</label> <input id="zipurl" name="zipurl" class="form-control" type="text">
|
||||
|
||||
</div>
|
||||
<div id="errorBlock" class="help-block"></div>
|
||||
|
||||
|
@ -65,6 +63,20 @@
|
|||
<button style="position: relative; top: -45px;" type="submit" class="btn btn-default" data-bind="visible: !error(), click: function(){ showOptions(!showOptions()); }, text: (showOptions() ? 'Hide' : 'Show') + ' Options'"></button>
|
||||
|
||||
<div data-bind="visible: showOptions()">
|
||||
<div>
|
||||
<label for="doPostProcessing">generate 2D and potree point cloud tiles:</label>
|
||||
<br/>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="doPostProcessing"> Enable
|
||||
</label>
|
||||
</div>
|
||||
<button type="submit" class="btn glyphicon glyphicon-info-sign btn-info" data-toggle="tooltip" data-placement="top" title="Generate 2D and Potree Point Cloud Tiles" ></button>
|
||||
<button id="resetDoPostProcessing" type="submit" class="btn glyphicon glyphicon glyphicon-repeat btn-default" data-toggle="tooltip" data-placement="top" title="Reset to default" ></button>
|
||||
|
||||
<br/><br/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="webhook">webhook callback url (optional):</label>
|
||||
|
@ -75,7 +87,6 @@
|
|||
<br/><br/>
|
||||
</div>
|
||||
|
||||
|
||||
<div data-bind="foreach: options">
|
||||
<label data-bind="text: properties.name + (properties.domain ? ' (' + properties.domain + ')' : '')"></label><br/>
|
||||
<!-- ko if: properties.type !== 'bool' -->
|
||||
|
|
|
@ -299,6 +299,7 @@ $(function() {
|
|||
name: $("#taskName").val(),
|
||||
zipurl: $("#zipurl").val(),
|
||||
webhook: $("#webhook").val(),
|
||||
skipPostProcessing: !$("#doPostProcessing").prop('checked'),
|
||||
options: JSON.stringify(optionsModel.getUserOptions())
|
||||
};
|
||||
}
|
||||
|
@ -326,6 +327,10 @@ $(function() {
|
|||
$("#webhook").val('');
|
||||
});
|
||||
|
||||
$('#resetDoPostProcessing').on('click', function(){
|
||||
$("#doPostProcessing").prop('checked', false);
|
||||
});
|
||||
|
||||
// zip file control
|
||||
$('#btnShowImport').on('click', function(e){
|
||||
e.preventDefault();
|
||||
|
|
Ładowanie…
Reference in New Issue