kopia lustrzana https://github.com/OpenDroneMap/NodeODM
seed file support, updated docs
rodzic
39b8926824
commit
250ba43506
|
@ -8,7 +8,7 @@ REST API to access ODM
|
||||||
|
|
||||||
=== Version information
|
=== Version information
|
||||||
[%hardbreaks]
|
[%hardbreaks]
|
||||||
_Version_ : 1.4.0
|
_Version_ : 1.5.0
|
||||||
|
|
||||||
|
|
||||||
=== Contact information
|
=== Contact information
|
||||||
|
@ -294,11 +294,13 @@ _optional_|An optional UUID string that will be used as UUID for this task inste
|
||||||
|*Query*|*token* +
|
|*Query*|*token* +
|
||||||
_optional_|Token required for authentication (when authentication is required).|string|
|
_optional_|Token required for authentication (when authentication is required).|string|
|
||||||
|*FormData*|*images* +
|
|*FormData*|*images* +
|
||||||
_optional_|Images to process, plus an optional GCP file. If included, the GCP file should have .txt extension|file|
|
_optional_|Images to process, plus an optional GCP file (*.txt) and/or an optional seed file (seed.zip). If included, the GCP file should have .txt extension. If included, the seed archive pre-polulates the task directory with its contents.|file|
|
||||||
|*FormData*|*name* +
|
|*FormData*|*name* +
|
||||||
_optional_|An optional name to be associated with the task|string|
|
_optional_|An optional name to be associated with the task|string|
|
||||||
|*FormData*|*options* +
|
|*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|
|
_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*|*outputs* +
|
||||||
|
_optional_|An optional serialized JSON string of paths relative to the project directory that should be included in the all.zip result file, overriding the default behavior.|string|
|
||||||
|*FormData*|*skipPostProcessing* +
|
|*FormData*|*skipPostProcessing* +
|
||||||
_optional_|When set, skips generation of map tiles, derivate assets, point cloud tiles.|boolean|
|
_optional_|When set, skips generation of map tiles, derivate assets, point cloud tiles.|boolean|
|
||||||
|*FormData*|*webhook* +
|
|*FormData*|*webhook* +
|
||||||
|
@ -402,6 +404,8 @@ _optional_|Token required for authentication (when authentication is required).|
|
||||||
_optional_|An optional name to be associated with the task|string|
|
_optional_|An optional name to be associated with the task|string|
|
||||||
|*FormData*|*options* +
|
|*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|
|
_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*|*outputs* +
|
||||||
|
_optional_|An optional serialized JSON string of paths relative to the project directory that should be included in the all.zip result file, overriding the default behavior.|string|
|
||||||
|*FormData*|*skipPostProcessing* +
|
|*FormData*|*skipPostProcessing* +
|
||||||
_optional_|When set, skips generation of map tiles, derivate assets, point cloud tiles.|boolean|
|
_optional_|When set, skips generation of map tiles, derivate assets, point cloud tiles.|boolean|
|
||||||
|*FormData*|*webhook* +
|
|*FormData*|*webhook* +
|
||||||
|
@ -451,7 +455,7 @@ _required_|UUID of the task|string|
|
||||||
|*Query*|*token* +
|
|*Query*|*token* +
|
||||||
_optional_|Token required for authentication (when authentication is required).|string|
|
_optional_|Token required for authentication (when authentication is required).|string|
|
||||||
|*FormData*|*images* +
|
|*FormData*|*images* +
|
||||||
_required_|Images to process, plus an optional GCP file. If included, the GCP file should have .txt extension|file|
|
_required_|Images to process, plus an optional GCP file (*.txt) and/or an optional seed file (seed.zip). If included, the GCP file should have .txt extension. If included, the seed archive pre-polulates the task directory with its contents.|file|
|
||||||
|===
|
|===
|
||||||
|
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
4
index.js
4
index.js
|
@ -131,7 +131,7 @@ app.post('/task/new/init', authCheck, taskNew.assignUUID, formDataParser, taskNe
|
||||||
* -
|
* -
|
||||||
* name: images
|
* name: images
|
||||||
* in: formData
|
* in: formData
|
||||||
* description: Images to process, plus an optional GCP file. If included, the GCP file should have .txt extension
|
* description: Images to process, plus an optional GCP file (*.txt) and/or an optional seed file (seed.zip). If included, the GCP file should have .txt extension. If included, the seed archive pre-polulates the task directory with its contents.
|
||||||
* required: true
|
* required: true
|
||||||
* type: file
|
* type: file
|
||||||
* -
|
* -
|
||||||
|
@ -198,7 +198,7 @@ app.post('/task/new/commit/:uuid', authCheck, taskNew.getUUID, taskNew.handleCom
|
||||||
* -
|
* -
|
||||||
* name: images
|
* name: images
|
||||||
* in: formData
|
* in: formData
|
||||||
* description: Images to process, plus an optional GCP file. If included, the GCP file should have .txt extension
|
* description: Images to process, plus an optional GCP file (*.txt) and/or an optional seed file (seed.zip). If included, the GCP file should have .txt extension. If included, the seed archive pre-polulates the task directory with its contents.
|
||||||
* required: false
|
* required: false
|
||||||
* type: file
|
* type: file
|
||||||
* -
|
* -
|
||||||
|
|
|
@ -329,8 +329,6 @@ module.exports = class Task{
|
||||||
// Did the user request different outputs than the default?
|
// Did the user request different outputs than the default?
|
||||||
if (this.outputs.length > 0) allPaths = this.outputs;
|
if (this.outputs.length > 0) allPaths = this.outputs;
|
||||||
|
|
||||||
console.log(allPaths);
|
|
||||||
|
|
||||||
let tasks = [];
|
let tasks = [];
|
||||||
|
|
||||||
if (config.test){
|
if (config.test){
|
||||||
|
|
|
@ -270,15 +270,35 @@ module.exports = {
|
||||||
cb => fs.mkdir(destGcpPath, undefined, cb),
|
cb => fs.mkdir(destGcpPath, undefined, cb),
|
||||||
cb => mv(srcPath, destImagesPath, cb),
|
cb => mv(srcPath, destImagesPath, cb),
|
||||||
|
|
||||||
|
// Zip files handling
|
||||||
cb => {
|
cb => {
|
||||||
// Find any *.zip file and extract
|
const handleSeed = (cb) => {
|
||||||
fs.readdir(destImagesPath, (err, entries) => {
|
const seedFileDst = path.join(destPath, "seed.zip");
|
||||||
if (err) cb(err);
|
|
||||||
else {
|
async.series([
|
||||||
async.eachSeries(entries, (entry, cb) => {
|
// Move to project root
|
||||||
if (/\.zip$/gi.test(entry)) {
|
cb => mv(path.join(destImagesPath, "seed.zip"), seedFileDst, cb),
|
||||||
|
|
||||||
|
// Extract
|
||||||
|
cb => {
|
||||||
|
fs.createReadStream(seedFileDst).pipe(unzip.Extract({ path: destPath }))
|
||||||
|
.on('close', cb)
|
||||||
|
.on('error', cb);
|
||||||
|
},
|
||||||
|
|
||||||
|
// Verify max images limit
|
||||||
|
cb => {
|
||||||
|
fs.readdir(destImagesPath, (err, files) => {
|
||||||
|
if (config.maxImages && files.length > config.maxImages) cb(`${files.length} images uploaded, but this node can only process up to ${config.maxImages}.`);
|
||||||
|
else cb(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
], cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleZipUrl = (cb) => {
|
||||||
let filesCount = 0;
|
let filesCount = 0;
|
||||||
fs.createReadStream(path.join(destImagesPath, entry)).pipe(unzip.Parse())
|
fs.createReadStream(path.join(destImagesPath, "zipurl.zip")).pipe(unzip.Parse())
|
||||||
.on('entry', function(entry) {
|
.on('entry', function(entry) {
|
||||||
if (entry.type === 'File') {
|
if (entry.type === 'File') {
|
||||||
filesCount++;
|
filesCount++;
|
||||||
|
@ -293,6 +313,18 @@ module.exports = {
|
||||||
else cb();
|
else cb();
|
||||||
})
|
})
|
||||||
.on('error', cb);
|
.on('error', cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Find and handle zip files and extract
|
||||||
|
fs.readdir(destImagesPath, (err, entries) => {
|
||||||
|
if (err) cb(err);
|
||||||
|
else {
|
||||||
|
async.eachSeries(entries, (entry, cb) => {
|
||||||
|
if (entry === "seed.zip"){
|
||||||
|
console.log("HERE");
|
||||||
|
handleSeed(cb);
|
||||||
|
}else if (entry === "zipurl.zip") {
|
||||||
|
handleZipUrl(cb);
|
||||||
} else cb();
|
} else cb();
|
||||||
}, cb);
|
}, cb);
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,7 +120,7 @@ $(function() {
|
||||||
url : "/task/new/upload/",
|
url : "/task/new/upload/",
|
||||||
parallelUploads: 8, // http://blog.olamisan.com/max-parallel-http-connections-in-a-browser max parallel connections
|
parallelUploads: 8, // http://blog.olamisan.com/max-parallel-http-connections-in-a-browser max parallel connections
|
||||||
uploadMultiple: false,
|
uploadMultiple: false,
|
||||||
acceptedFiles: "image/*,text/*",
|
acceptedFiles: "image/*,text/*,application/*",
|
||||||
autoProcessQueue: false,
|
autoProcessQueue: false,
|
||||||
createImageThumbnails: false,
|
createImageThumbnails: false,
|
||||||
previewTemplate: '<div style="display:none"></div>',
|
previewTemplate: '<div style="display:none"></div>',
|
||||||
|
|
Ładowanie…
Reference in New Issue