Skip to content

Commit

Permalink
Fix alignment file search
Browse files Browse the repository at this point in the history
  • Loading branch information
pierotofy committed Jan 13, 2023
1 parent 5d6c1e7 commit fc5c87e
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 11 deletions.
6 changes: 3 additions & 3 deletions docs/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ REST API to access ODM

=== Version information
[%hardbreaks]
_Version_ : 2.1.4
_Version_ : 2.2.1


=== Contact information
Expand Down Expand Up @@ -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 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|
_optional_|Images to process, plus optional files such as a GEO file (geo.txt), image groups file (image_groups.txt), GCP file (*.txt), seed file (seed.zip) or alignment files (align.las, align.laz, align.tif). 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* +
Expand Down Expand Up @@ -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 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|
_required_|Images to process, plus optional files such as a GEO file (geo.txt), image groups file (image_groups.txt), GCP file (*.txt), seed file (seed.zip) or alignment files (align.las, align.laz, align.tif). If included, the GCP file should have .txt extension. If included, the seed archive pre-polulates the task directory with its contents.|file|
|===


Expand Down
2 changes: 1 addition & 1 deletion docs/swagger.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ app.post('/task/new/init', authCheck, taskNew.assignUUID, formDataParser, taskNe
* -
* name: images
* in: formData
* 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.
* description: Images to process, plus optional files such as a GEO file (geo.txt), image groups file (image_groups.txt), GCP file (*.txt), seed file (seed.zip) or alignment files (align.las, align.laz, align.tif). 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
* -
Expand Down Expand Up @@ -209,7 +209,7 @@ app.post('/task/new/commit/:uuid', authCheck, taskNew.getUUID, taskNew.handleCom
* -
* name: images
* in: formData
* 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.
* description: Images to process, plus optional files such as a GEO file (geo.txt), image groups file (image_groups.txt), GCP file (*.txt), seed file (seed.zip) or alignment files (align.las, align.laz, align.tif). 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
* -
Expand Down
3 changes: 2 additions & 1 deletion libs/Task.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,10 @@ module.exports = class Task{
this.imageGroupsFiles.push(file);
}else if (/\.txt$/gi.test(file)){
this.gcpFiles.push(file);
}else if (/^align.(tif|laz|las)$/.test(file)){
}else if (/^align\.(tif|laz|las)$/gi.test(file)){
this.alignFiles.push(file);
}
logger.debug(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}`);
Expand Down
4 changes: 2 additions & 2 deletions libs/taskNew.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,13 +363,13 @@ module.exports = {
},

cb => {
// Find any *.txt (GCP) file and move it to the data/<uuid>/gcp directory
// Find any *.txt (GCP) file or alignment file and move it to the data/<uuid>/gcp directory
// also remove any lingering zipurl.zip
fs.readdir(destImagesPath, (err, entries) => {
if (err) cb(err);
else {
async.eachSeries(entries, (entry, cb) => {
if (/\.txt$/gi.test(entry)) {
if (/\.txt$/gi.test(entry) || /^align\.(las|laz|tif)$/gi.test(entry)) {
mv(path.join(destImagesPath, entry), path.join(destGcpPath, entry), cb);
}else if (/\.zip$/gi.test(entry)){
fs.unlink(path.join(destImagesPath, entry), cb);
Expand Down
2 changes: 1 addition & 1 deletion public/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ $(function() {
url : "/task/new/upload/",
parallelUploads: 8, // http://blog.olamisan.com/max-parallel-http-connections-in-a-browser max parallel connections
uploadMultiple: false,
acceptedFiles: "image/*,text/*,application/*",
acceptedFiles: "image/*,text/*,application/*,.las,.laz",
autoProcessQueue: false,
createImageThumbnails: false,
previewTemplate: '<div style="display:none"></div>',
Expand Down
2 changes: 1 addition & 1 deletion tests/odm_options.json

Large diffs are not rendered by default.

0 comments on commit fc5c87e

Please sign in to comment.