Merge pull request #143 from pierotofy/imagegroups

Support for image groups
pull/145/head
Piero Toffanin 2021-02-07 10:58:11 -05:00 zatwierdzone przez GitHub
commit 300f013235
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
7 zmienionych plików z 30 dodań i 7 usunięć

Wyświetl plik

@ -8,7 +8,7 @@ REST API to access ODM
=== Version information
[%hardbreaks]
_Version_ : 2.1.3
_Version_ : 2.1.4
=== Contact information
@ -340,7 +340,7 @@ _optional_|Token required for authentication (when authentication is required).|
|*FormData*|*dateCreated* +
_optional_|An optional timestamp overriding the default creation date of the task.|integer|
|*FormData*|*images* +
_optional_|Images to process, plus an optional GEO file (geo.txt) and/or 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|
_optional_|Images to process, plus optional files such as a GEO file (geo.txt), image groups file (image_groups.txt), GCP file (*.txt) or 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* +
_optional_|An optional name to be associated with the task|string|
|*FormData*|*options* +
@ -503,7 +503,7 @@ _required_|UUID of the task|string|
|*Query*|*token* +
_optional_|Token required for authentication (when authentication is required).|string|
|*FormData*|*images* +
_required_|Images to process, plus an optional GEO file (geo.txt) and/or 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|
_required_|Images to process, plus optional files such as a GEO file (geo.txt), image groups file (image_groups.txt), GCP file (*.txt) or 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

Wyświetl plik

@ -138,7 +138,7 @@ app.post('/task/new/init', authCheck, taskNew.assignUUID, formDataParser, taskNe
* -
* name: images
* in: formData
* description: Images to process, plus an optional GEO file (geo.txt) and/or 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.
* description: Images to process, plus optional files such as a GEO file (geo.txt), image groups file (image_groups.txt), GCP file (*.txt) or 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
* type: file
* -
@ -205,7 +205,7 @@ app.post('/task/new/commit/:uuid', authCheck, taskNew.getUUID, taskNew.handleCom
* -
* name: images
* in: formData
* description: Images to process, plus an optional GEO file (geo.txt) and/or 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.
* description: Images to process, plus optional files such as a GEO file (geo.txt), image groups file (image_groups.txt), GCP file (*.txt) or 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
* type: file
* -

Wyświetl plik

@ -49,6 +49,7 @@ module.exports = class Task{
this.options = options;
this.gcpFiles = [];
this.geoFiles = [];
this.imageGroupsFiles = [];
this.output = [];
this.runningProcesses = [];
this.webhook = webhook;
@ -77,12 +78,15 @@ module.exports = class Task{
files.forEach(file => {
if (/^geo\.txt$/gi.test(file)){
this.geoFiles.push(file);
}else if (/^image_groups\.txt$/gi.test(file)){
this.imageGroupsFiles.push(file);
}else if (/\.txt$/gi.test(file)){
this.gcpFiles.push(file);
}
});
logger.debug(`Found ${this.gcpFiles.length} GCP files (${this.gcpFiles.join(" ")}) for ${this.uuid}`);
logger.debug(`Found ${this.geoFiles.length} GEO files (${this.geoFiles.join(" ")}) for ${this.uuid}`);
logger.debug(`Found ${this.imageGroupsFiles.length} image groups files (${this.imageGroupsFiles.join(" ")}) for ${this.uuid}`);
cb(null);
}
});
@ -372,6 +376,15 @@ module.exports = class Task{
};
};
const saveTaskOutput = (destination) => {
return (done) => {
fs.writeFile(destination, this.output.join("\n"), err => {
if (err) logger.info(`Cannot write log at ${destination}, skipping...`);
done();
});
};
}
// All paths are relative to the project directory (./data/<uuid>/)
let allPaths = ['odm_orthophoto/odm_orthophoto.tif',
'odm_orthophoto/odm_orthophoto.png',
@ -380,6 +393,7 @@ module.exports = class Task{
'odm_dem/dsm.tif', 'odm_dem/dtm.tif', 'dsm_tiles', 'dtm_tiles',
'orthophoto_tiles', 'potree_pointcloud', 'entwine_pointcloud',
'images.json', 'cameras.json',
'task_output.txt',
'odm_report'];
// Did the user request different outputs than the default?
@ -419,6 +433,9 @@ module.exports = class Task{
}
if (!this.skipPostProcessing) tasks.push(runPostProcessingScript());
const taskOutputFile = path.join(this.getProjectFolderPath(), 'task_output.txt');
tasks.push(saveTaskOutput(taskOutputFile));
const archiveFunc = config.has7z ? createZipArchive : createZipArchiveLegacy;
tasks.push(archiveFunc('all.zip', allPaths));
@ -470,6 +487,9 @@ module.exports = class Task{
if (this.geoFiles.length > 0){
runnerOptions.geo = fs.realpathSync(path.join(this.getGcpFolderPath(), this.geoFiles[0]));
}
if (this.imageGroupsFiles.length > 0){
runnerOptions["split-image-groups"] = fs.realpathSync(path.join(this.getGcpFolderPath(), this.imageGroupsFiles[0]));
}
this.runningProcesses.push(odmRunner.run(runnerOptions, this.uuid, (err, code, signal) => {
if (err){

Wyświetl plik

@ -74,6 +74,7 @@ module.exports = {
if (["-h", "--project-path", "--cmvs-maxImages", "--time",
"--zip-results", "--pmvs-num-cores",
"--start-with", "--gcp", "--images", "--geo",
"--split-image-groups",
"--rerun-all", "--rerun",
"--slam-config", "--video", "--version", "name"].indexOf(option) !== -1) continue;

Wyświetl plik

@ -1,6 +1,6 @@
{
"name": "NodeODM",
"version": "2.1.3",
"version": "2.1.4",
"description": "REST API to access ODM",
"main": "index.js",
"scripts": {

Wyświetl plik

@ -0,0 +1,2 @@
test output