Merge pull request #1615 from pierotofy/align

Geolocation file download, task thumbnails, task alignment support
pull/1620/head
Piero Toffanin 2025-02-20 13:55:20 -05:00 zatwierdzone przez GitHub
commit 4665aac1e1
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
15 zmienionych plików z 630 dodań i 151 usunięć

Wyświetl plik

@ -125,7 +125,7 @@ class Thumbnail(TaskNestedView):
img.thumbnail((thumb_size, thumb_size))
output = io.BytesIO()
img.save(output, format='JPEG', quality=quality)
img.save(output, format='JPEG', quality=quality, progressive=True)
res = HttpResponse(content_type="image/jpeg")
res['Content-Disposition'] = 'inline'

Wyświetl plik

@ -4,6 +4,11 @@ import shutil
from wsgiref.util import FileWrapper
import mimetypes
import rasterio
from rasterio.enums import ColorInterp
from PIL import Image
import io
import numpy as np
from shutil import copyfileobj, move
from django.core.exceptions import ObjectDoesNotExist, SuspiciousFileOperation, ValidationError
@ -12,12 +17,14 @@ from django.db import transaction
from django.http import FileResponse
from django.http import HttpResponse
from django.http import StreamingHttpResponse
from django.contrib.gis.geos import Polygon
from app.vendor import zipfly
from rest_framework import status, serializers, viewsets, filters, exceptions, permissions, parsers
from rest_framework.decorators import action
from rest_framework.permissions import AllowAny
from rest_framework.response import Response
from rest_framework.views import APIView
from django.db.models import Q
from app import models, pending_actions
from nodeodm import status_codes
@ -46,6 +53,7 @@ class TaskSerializer(serializers.ModelSerializer):
processing_node_name = serializers.SerializerMethodField()
can_rerun_from = serializers.SerializerMethodField()
statistics = serializers.SerializerMethodField()
extent = serializers.SerializerMethodField()
tags = TagsField(required=False)
def get_processing_node_name(self, obj):
@ -76,6 +84,16 @@ class TaskSerializer(serializers.ModelSerializer):
return []
def get_extent(self, obj):
if obj.orthophoto_extent is not None:
return obj.orthophoto_extent.extent
elif obj.dsm_extent is not None:
return obj.dsm_extent.extent
elif obj.dtm_extent is not None:
return obj.dsm_extent.extent
else:
return None
class Meta:
model = models.Task
exclude = ('orthophoto_extent', 'dsm_extent', 'dtm_extent', )
@ -87,11 +105,11 @@ class TaskViewSet(viewsets.ViewSet):
A task represents a set of images and other input to be sent to a processing node.
Once a processing node completes processing, results are stored in the task.
"""
queryset = models.Task.objects.all().defer('orthophoto_extent', 'dsm_extent', 'dtm_extent', )
queryset = models.Task.objects.all()
parser_classes = (parsers.MultiPartParser, parsers.JSONParser, parsers.FormParser, )
ordering_fields = '__all__'
def get_permissions(self):
"""
Instantiates and returns the list of permissions that this view requires.
@ -153,7 +171,34 @@ class TaskViewSet(viewsets.ViewSet):
def list(self, request, project_pk=None):
get_and_check_project(request, project_pk)
tasks = self.queryset.filter(project=project_pk)
query = Q(project=project_pk)
status = request.query_params.get('status')
if status is not None:
try:
query &= Q(status=int(status))
except ValueError:
raise exceptions.ValidationError("Invalid status parameter")
available_assets = request.query_params.get('available_assets')
if available_assets is not None:
assets = [a.strip() for a in available_assets.split(",") if a.strip() != ""]
for a in assets:
query &= Q(available_assets__contains="{" + a + "}")
bbox = request.query_params.get('bbox')
if bbox is not None:
try:
xmin, ymin, xmax, ymax = [float(v) for v in bbox.split(",")]
except:
raise exceptions.ValidationError("Invalid bbox parameter")
geom = Polygon.from_bbox((xmin, ymin, xmax, ymax))
query &= Q(orthophoto_extent__intersects=geom) | \
Q(dsm_extent__intersects=geom) | \
Q(dtm_extent__intersects=geom)
tasks = self.queryset.filter(query)
tasks = filters.OrderingFilter().filter_queryset(self.request, tasks, self)
serializer = TaskSerializer(tasks, many=True)
return Response(serializer.data)
@ -234,15 +279,29 @@ class TaskViewSet(viewsets.ViewSet):
return Response({'success': True, 'task': TaskSerializer(new_task).data}, status=status.HTTP_200_OK)
else:
return Response({'error': _("Cannot duplicate task")}, status=status.HTTP_200_OK)
def create(self, request, project_pk=None):
project = get_and_check_project(request, project_pk, ('change_project', ))
# Check if an alignment field is set to a valid task
# this means a user wants to align this task with another
align_to = request.data.get('align_to')
align_task = None
if align_to is not None and align_to != "auto" and align_to != "":
try:
align_task = models.Task.objects.get(pk=align_to)
get_and_check_project(request, align_task.project.id, ('view_project', ))
except ObjectDoesNotExist:
raise exceptions.ValidationError(detail=_("Cannot create task, alignment task is not valid"))
# If this is a partial task, we're going to upload images later
# for now we just create a placeholder task.
if request.data.get('partial'):
task = models.Task.objects.create(project=project,
pending_action=pending_actions.RESIZE if 'resize_to' in request.data else None)
if align_task is not None:
task.set_alignment_file_from(align_task)
serializer = TaskSerializer(task, data=request.data, partial=True)
serializer.is_valid(raise_exception=True)
serializer.save()
@ -255,7 +314,8 @@ class TaskViewSet(viewsets.ViewSet):
with transaction.atomic():
task = models.Task.objects.create(project=project,
pending_action=pending_actions.RESIZE if 'resize_to' in request.data else None)
if align_task is not None:
task.set_alignment_file_from(align_task)
task.handle_images_upload(files)
task.images_count = len(task.scan_images())
@ -387,6 +447,85 @@ class TaskDownloads(TaskNestedView):
else:
return download_file_response(request, asset_fs, 'attachment', download_filename=download_filename)
class TaskThumbnail(TaskNestedView):
def get(self, request, pk=None, project_pk=None):
"""
Generate a thumbnail on the fly for a particular task
"""
task = self.get_and_check_task(request, pk)
orthophoto_path = task.get_check_file_asset_path("orthophoto.tif")
if orthophoto_path is None:
raise exceptions.NotFound()
thumb_size = 256
try:
thumb_size = max(1, min(1024, int(request.query_params.get('size', 256))))
except ValueError:
pass
with rasterio.open(orthophoto_path, "r") as raster:
ci = raster.colorinterp
indexes = (1, 2, 3,)
# More than 4 bands?
if len(ci) > 4:
# Try to find RGBA band order
if ColorInterp.red in ci and \
ColorInterp.green in ci and \
ColorInterp.blue in ci:
indexes = (ci.index(ColorInterp.red) + 1,
ci.index(ColorInterp.green) + 1,
ci.index(ColorInterp.blue) + 1,)
elif len(ci) < 3:
raise exceptions.NotFound()
if ColorInterp.alpha in ci:
indexes += (ci.index(ColorInterp.alpha) + 1, )
w = raster.width
h = raster.height
d = max(w, h)
dw = (d - w) // 2
dh = (d - h) // 2
win = rasterio.windows.Window(-dw, -dh, d, d)
img = raster.read(indexes=indexes, window=win, boundless=True, fill_value=0, out_shape=(
len(indexes),
thumb_size,
thumb_size,
), resampling=rasterio.enums.Resampling.nearest).transpose((1, 2, 0))
if img.dtype != np.uint8:
img = img.astype(np.float32)
# Ignore alpha values
minval = img[:,:,:3].min()
maxval = img[:,:,:3].max()
if minval != maxval:
img[:,:,:3] -= minval
img[:,:,:3] *= (255.0/(maxval-minval))
img = img.astype(np.uint8)
img = Image.fromarray(img)
output = io.BytesIO()
if 'image/webp' in request.META.get('HTTP_ACCEPT', ''):
img.save(output, format='WEBP')
res = HttpResponse(content_type="image/webp")
else:
img.save(output, format='PNG')
res = HttpResponse(content_type="image/png")
res['Content-Disposition'] = 'inline'
res.write(output.getvalue())
output.close()
return res
"""
Raw access to the task's asset folder resources
Useful when accessing a textured 3d model, or the Potree point cloud data

Wyświetl plik

@ -3,7 +3,7 @@ from django.conf.urls import url, include
from app.api.presets import PresetViewSet
from app.plugins.views import api_view_handler
from .projects import ProjectViewSet
from .tasks import TaskViewSet, TaskDownloads, TaskAssets, TaskBackup, TaskAssetsImport
from .tasks import TaskViewSet, TaskDownloads, TaskThumbnail, TaskAssets, TaskBackup, TaskAssetsImport
from .imageuploads import Thumbnail, ImageDownload
from .processingnodes import ProcessingNodeViewSet, ProcessingNodeOptionsView
from .admin import AdminUserViewSet, AdminGroupViewSet, AdminProfileViewSet
@ -46,6 +46,7 @@ urlpatterns = [
url(r'projects/(?P<project_pk>[^/.]+)/tasks/(?P<pk>[^/.]+)/download/(?P<asset>.+)$', TaskDownloads.as_view()),
url(r'projects/(?P<project_pk>[^/.]+)/tasks/(?P<pk>[^/.]+)/assets/(?P<unsafe_asset_path>.+)$', TaskAssets.as_view()),
url(r'projects/(?P<project_pk>[^/.]+)/tasks/import$', TaskAssetsImport.as_view()),
url(r'projects/(?P<project_pk>[^/.]+)/tasks/(?P<pk>[^/.]+)/thumbnail$', TaskThumbnail.as_view()),
url(r'projects/(?P<project_pk>[^/.]+)/tasks/(?P<pk>[^/.]+)/backup$', TaskBackup.as_view()),
url(r'projects/(?P<project_pk>[^/.]+)/tasks/(?P<pk>[^/.]+)/images/thumbnail/(?P<image_filename>.+)$', Thumbnail.as_view()),
url(r'projects/(?P<project_pk>[^/.]+)/tasks/(?P<pk>[^/.]+)/images/download/(?P<image_filename>.+)$', ImageDownload.as_view()),

Wyświetl plik

@ -411,7 +411,15 @@ class Task(models.Model):
points = j.get('point_cloud_statistics', {}).get('stats', {}).get('statistic', [{}])[0].get('count')
else:
points = j.get('reconstruction_statistics', {}).get('reconstructed_points_count')
spatial_refs = []
if j.get('reconstruction_statistics', {}).get('has_gps'):
spatial_refs.append("gps")
if j.get('reconstruction_statistics', {}).get('has_gcp') and 'average_error' in j.get('gcp_errors', {}):
spatial_refs.append("gcp")
if 'align' in j:
spatial_refs.append("alignment")
return {
'pointcloud':{
'points': points,
@ -420,6 +428,7 @@ class Task(models.Model):
'area': j.get('processing_statistics', {}).get('area'),
'start_date': j.get('processing_statistics', {}).get('start_date'),
'end_date': j.get('processing_statistics', {}).get('end_date'),
'spatial_refs': spatial_refs,
}
else:
return {}
@ -1241,7 +1250,31 @@ class Task(models.Model):
def get_image_path(self, filename):
p = self.task_path(filename)
return path_traversal_check(p, self.task_path())
def set_alignment_file_from(self, align_task):
tp = self.task_path()
if not os.path.exists(tp):
os.makedirs(tp, exist_ok=True)
alignment_file = align_task.assets_path(self.ASSETS_MAP['georeferenced_model.laz'])
dst_file = self.task_path("align.laz")
if os.path.exists(dst_file):
os.unlink(dst_file)
if os.path.exists(alignment_file):
try:
os.link(alignment_file, dst_file)
except:
shutil.copy(alignment_file, dst_file)
else:
logger.warn("Cannot set alignment file for {}, {} does not exist".format(self, alignment_file))
def get_check_file_asset_path(self, asset):
file = self.assets_path(self.ASSETS_MAP[asset])
if isinstance(file, str) and os.path.isfile(file):
return file
def handle_images_upload(self, files):
uploaded = {}
for file in files:

Wyświetl plik

@ -66,7 +66,7 @@ export default class ExportAssetPanel extends React.Component {
},
'csv': {
label: "CSV",
icon: "fa fa-file-text"
icon: "fas fa-file-alt"
}
};

Wyświetl plik

@ -24,12 +24,14 @@ const Colors = {
class MapPreview extends React.Component {
static defaultProps = {
getFiles: null,
onPolygonChange: () => {}
onPolygonChange: () => {},
onImagesBboxChanged: () => {}
};
static propTypes = {
getFiles: PropTypes.func.isRequired,
onPolygonChange: PropTypes.func
onPolygonChange: PropTypes.func,
onImagesBboxChanged: PropTypes.func
};
constructor(props) {
@ -214,6 +216,8 @@ _('Example:'),
this.map.fitBounds(this.imagesGroup.getBounds());
}
this.props.onImagesBboxChanged(this.computeBbox(this.exifData));
this.setState({showLoading: false});
}).catch(e => {
@ -221,6 +225,20 @@ _('Example:'),
});
}
computeBbox = exifData => {
// minx, miny, maxx, maxy
let bbox = [Infinity, Infinity, -Infinity, -Infinity];
exifData.forEach(ed => {
if (ed.gps){
bbox[0] = Math.min(bbox[0], ed.gps.longitude);
bbox[1] = Math.min(bbox[1], ed.gps.latitude);
bbox[2] = Math.max(bbox[2], ed.gps.longitude);
bbox[3] = Math.max(bbox[3], ed.gps.latitude);
}
});
return bbox;
}
readExifData = () => {
return new Promise((resolve, reject) => {
const files = this.props.getFiles();
@ -508,9 +526,45 @@ _('Example:'),
}));
}
setAlignmentPolygon = (task) => {
if (this.alignPoly){
this.map.removeLayer(this.alignPoly);
this.alignPoly = null;
}
if (!task || !task.extent){
if (this.imagesGroup) this.map.fitBounds(this.imagesGroup.getBounds());
return;
}
const [xmin, ymin, xmax, ymax] = task.extent;
this.alignPoly = L.polygon([
[ymin, xmin],
[ymax, xmin],
[ymax, xmax],
[ymin, xmax],
[ymin, xmin]
], {
clickable: true,
weight: 3,
opacity: 0.9,
color: "#808f9b",
fillColor: "#808f9b",
fillOpacity: 0.2
}).bindPopup(task.name).addTo(this.map);
this.alignPoly.bringToBack();
this.map.fitBounds(this.alignPoly.getBounds());
}
download = format => {
let output = "";
let filename = `images.${format}`;
if (format === "geo"){
filename = "geo.txt";
}
const feats = {
type: "FeatureCollection",
features: this.exifData.map(ed => {
@ -538,6 +592,10 @@ _('Example:'),
output = `Filename,Timestamp,Latitude,Longitude,Altitude\r\n${feats.features.map(feat => {
return `${feat.properties.Filename},${feat.properties.Timestamp},${feat.geometry.coordinates[1]},${feat.geometry.coordinates[0]},${feat.geometry.coordinates[2]}`
}).join("\r\n")}`;
}else if (format === 'geo'){
output = `EPSG:4326\r\n${feats.features.map(feat => {
return `${feat.properties.Filename} ${feat.geometry.coordinates[0]} ${feat.geometry.coordinates[1]} ${feat.geometry.coordinates[2]}`
}).join("\r\n")}`;
}else{
console.error("Invalid format");
}
@ -567,8 +625,9 @@ _('Example:'),
</button>
<ul className="dropdown-menu">
<li>
<a href="javascript:void(0);" onClick={() => this.download('geojson')}><i className="fas fa-map fa-fw"></i> GeoJSON</a>
<a href="javascript:void(0);" onClick={() => this.download('csv')}><i className="fas fa-file-alt fa-fw"></i> CSV</a>
<a href="javascript:void(0);" onClick={() => this.download('geojson')}><i className="fas fa-map fa-fw"></i> {_("GeoJSON")}</a>
<a href="javascript:void(0);" onClick={() => this.download('csv')}><i className="fas fa-file-alt fa-fw"></i> {_("CSV")}</a>
<a href="javascript:void(0);" onClick={() => this.download('geo')}><i className="fas fa-file-alt fa-fw"></i> {_("Geolocation File")}</a>
</li>
</ul>
</div> : ""}

Wyświetl plik

@ -7,12 +7,15 @@ import ResizeModes from '../classes/ResizeModes';
import MapPreview from './MapPreview';
import update from 'immutability-helper';
import PluginsAPI from '../classes/plugins/API';
import statusCodes from '../classes/StatusCodes';
import { _, interpolate } from '../classes/gettext';
class NewTaskPanel extends React.Component {
static defaultProps = {
filesCount: 0,
showResize: false
showResize: false,
showAlign: false,
projectId: null
};
static propTypes = {
@ -20,7 +23,9 @@ class NewTaskPanel extends React.Component {
onCancel: PropTypes.func,
filesCount: PropTypes.number,
showResize: PropTypes.bool,
showAlign: PropTypes.bool,
getFiles: PropTypes.func,
projectId: PropTypes.number,
suggestedTaskName: PropTypes.oneOfType([PropTypes.string, PropTypes.func])
};
@ -31,6 +36,9 @@ class NewTaskPanel extends React.Component {
editTaskFormLoaded: false,
resizeMode: Storage.getItem('resize_mode') === null ? ResizeModes.YES : ResizeModes.fromString(Storage.getItem('resize_mode')),
resizeSize: parseInt(Storage.getItem('resize_size')) || 2048,
alignTo: "auto",
alignTasks: [], // loaded on mount if showAlign is true
loadingAlignTasks: false,
items: [], // Coming from plugins,
taskInfo: {},
inReview: false,
@ -63,6 +71,25 @@ class NewTaskPanel extends React.Component {
});
}
componentWillUnmount(){
if (this.alignTasksRequest) this.alignTasksRequest.abort();
}
loadAlignTasks = (bbox) => {
this.setState({alignTasks: [], alignTo: "auto", loadingAlignTasks: true});
this.alignTasksRequest =
$.getJSON(`/api/projects/${this.props.projectId}/tasks/?ordering=-created_at&status=${statusCodes.COMPLETED}&available_assets=georeferenced_model.laz&bbox=${bbox.join(",")}`, tasks => {
if (Array.isArray(tasks)){
this.setState({loadingAlignTasks: false, alignTasks: tasks});
}else{
this.setState({loadingAlignTasks: false});
}
}).fail(() => {
this.setState({loadingAlignTasks: false});
});
}
save(e){
if (!this.state.inReview){
this.setState({inReview: true});
@ -99,7 +126,8 @@ class NewTaskPanel extends React.Component {
getTaskInfo(){
return Object.assign(this.taskForm.getTaskInfo(), {
resizeSize: this.state.resizeSize,
resizeMode: this.state.resizeMode
resizeMode: this.state.resizeMode,
alignTo: this.state.alignTo
});
}
@ -148,6 +176,27 @@ class NewTaskPanel extends React.Component {
if (this.taskForm) this.taskForm.forceUpdate();
}
handleImagesBboxChange = (bbox) => {
if (this.props.showAlign){
this.loadAlignTasks(bbox);
}
}
handleAlignToChanged = e => {
this.setState({alignTo: e.target.value});
if (this.mapPreview){
if (e.target.value !== "auto"){
this.mapPreview.setAlignmentPolygon(this.state.alignTasks.find(t => t.id === e.target.value));
}else{
this.mapPreview.setAlignmentPolygon(null);
}
}
setTimeout(() => {
this.handleFormChanged();
}, 0);
}
render() {
let filesCountOk = true;
if (this.taskForm && !this.taskForm.checkFilesCount(this.props.filesCount)) filesCountOk = false;
@ -176,6 +225,7 @@ class NewTaskPanel extends React.Component {
{this.state.showMapPreview ? <MapPreview
getFiles={this.props.getFiles}
onPolygonChange={this.handlePolygonChange}
onImagesBboxChanged={this.handleImagesBboxChange}
ref={(domNode) => {this.mapPreview = domNode; }}
/> : ""}
@ -189,6 +239,22 @@ class NewTaskPanel extends React.Component {
ref={(domNode) => { if (domNode) this.taskForm = domNode; }}
/>
{this.state.editTaskFormLoaded && this.props.showAlign && this.state.showMapPreview ?
<div>
<div className="form-group">
<label className="col-sm-2 control-label">{_("Alignment")}</label>
<div className="col-sm-10">
<select className="form-control" disabled={this.state.loadingAlignTasks} value={this.state.alignTo} onChange={this.handleAlignToChanged}>
<option value="auto" key="auto">{this.state.loadingAlignTasks ? _("Loading...") : _("Automatic")}</option>
{this.state.alignTasks.map(t =>
<option value={t.id} key={t.id}>{t.name}</option>
)}
</select>
</div>
</div>
</div>
: ""}
{this.state.editTaskFormLoaded && this.props.showResize ?
<div>
<div className="form-group">
@ -228,6 +294,7 @@ class NewTaskPanel extends React.Component {
</div>)}
</div>
: ""}
</div>
{this.state.editTaskFormLoaded ?

Wyświetl plik

@ -418,7 +418,8 @@ class ProjectListItem extends React.Component {
options: taskInfo.options,
processing_node: taskInfo.selectedNode.id,
auto_processing_node: taskInfo.selectedNode.key == "auto",
partial: true
partial: true,
align_to: taskInfo.alignTo
};
if (taskInfo.resizeMode === ResizeModes.YES){
@ -780,6 +781,8 @@ class ProjectListItem extends React.Component {
suggestedTaskName={this.handleTaskTitleHint}
filesCount={this.state.upload.totalCount}
showResize={true}
showAlign={numTasks > 0}
projectId={this.state.data.id}
getFiles={() => this.state.upload.files }
/>
: ""}

Wyświetl plik

@ -48,6 +48,7 @@ class TaskListItem extends React.Component {
view: "basic",
showMoveDialog: false,
actionLoading: false,
thumbLoadFailed: false
}
for (let k in props.data){
@ -171,6 +172,10 @@ class TaskListItem extends React.Component {
return `/api/projects/${this.state.task.project}/tasks/${this.state.task.id}/output/?line=${line}`;
}
thumbnailUrl = () => {
return `/api/projects/${this.state.task.project}/tasks/${this.state.task.id}/thumbnail?size=164`;
}
hoursMinutesSecs(t){
if (t === 0 || t === -1) return "-- : -- : --";
@ -425,6 +430,24 @@ class TaskListItem extends React.Component {
}
}
handleThumbError = e => {
this.setState({thumbLoadFailed: true});
}
spatialRefsToHuman = (refs) => {
if (refs.indexOf("alignment") !== -1) return _("Alignment");
let out = [];
if (refs.indexOf("gps") !== -1){
out.push(_("GPS"));
}
if (refs.indexOf("gcp") !== -1){
out.push(_("GCP"));
}
return out.join("/");
}
render() {
const task = this.state.task;
const name = task.name !== null ? task.name : interpolate(_("Task #%(number)s"), { number: task.id });
@ -556,54 +579,67 @@ class TaskListItem extends React.Component {
<div className="expanded-panel">
<div className="row">
<div className="col-md-12 no-padding">
<table className="table table-condensed info-table">
<tbody>
<tr>
<td><strong>{_("Created on:")}</strong></td>
<td>{(new Date(task.created_at)).toLocaleString()}</td>
</tr>
<tr>
<td><strong>{_("Processing Node:")}</strong></td>
<td>{task.processing_node_name || "-"} ({task.auto_processing_node ? _("auto") : _("manual")})</td>
</tr>
{Array.isArray(task.options) &&
<tr>
<td><strong>{_("Options:")}</strong></td>
<td>{this.optionsToList(task.options)}</td>
</tr>}
{stats && stats.gsd &&
<tr>
<td><strong>{_("Average GSD:")}</strong></td>
<td>{parseFloat(stats.gsd.toFixed(2)).toLocaleString()} cm</td>
</tr>}
{stats && stats.area &&
<tr>
<td><strong>{_("Area:")}</strong></td>
<td>{parseFloat(stats.area.toFixed(2)).toLocaleString()} m&sup2;</td>
</tr>}
{stats && stats.pointcloud && stats.pointcloud.points &&
<tr>
<td><strong>{_("Reconstructed Points:")}</strong></td>
<td>{stats.pointcloud.points.toLocaleString()}</td>
</tr>}
{task.size > 0 &&
<tr>
<td><strong>{_("Disk Usage:")}</strong></td>
<td>{Utils.bytesToSize(task.size * 1024 * 1024)}</td>
</tr>}
<tr>
<td><strong>{_("Task ID:")}</strong></td>
<td>{task.id}</td>
</tr>
<tr>
<td><strong>{_("Task Output:")}</strong></td>
<td><div className="btn-group btn-toggle">
<button onClick={this.setView("console")} className={"btn btn-xs " + (this.state.view === "basic" ? "btn-default" : "btn-primary")}>{_("On")}</button>
<button onClick={this.setView("basic")} className={"btn btn-xs " + (this.state.view === "console" ? "btn-default" : "btn-primary")}>{_("Off")}</button>
</div></td>
</tr>
</tbody>
</table>
<div className="col-md-9 col-sm-10 no-padding">
<table className="table table-condensed info-table">
<tbody>
<tr>
<td><strong>{_("Created on:")}</strong></td>
<td>{(new Date(task.created_at)).toLocaleString()}</td>
</tr>
<tr>
<td><strong>{_("Processing Node:")}</strong></td>
<td>{task.processing_node_name || "-"} ({task.auto_processing_node ? _("auto") : _("manual")})</td>
</tr>
{Array.isArray(task.options) &&
<tr>
<td><strong>{_("Options:")}</strong></td>
<td>{this.optionsToList(task.options)}</td>
</tr>}
{stats && stats.gsd &&
<tr>
<td><strong>{_("Average GSD:")}</strong></td>
<td>{parseFloat(stats.gsd.toFixed(2)).toLocaleString()} cm</td>
</tr>}
{stats && stats.area &&
<tr>
<td><strong>{_("Area:")}</strong></td>
<td>{parseFloat(stats.area.toFixed(2)).toLocaleString()} m&sup2;</td>
</tr>}
{stats && stats.pointcloud && stats.pointcloud.points &&
<tr>
<td><strong>{_("Reconstructed Points:")}</strong></td>
<td>{stats.pointcloud.points.toLocaleString()}</td>
</tr>}
{stats && stats.spatial_refs && stats.spatial_refs.length &&
<tr>
<td><strong>{_("Spatial Reference:")}</strong></td>
<td>{this.spatialRefsToHuman(stats.spatial_refs)}</td>
</tr>}
{task.size > 0 &&
<tr>
<td><strong>{_("Disk Usage:")}</strong></td>
<td>{Utils.bytesToSize(task.size * 1024 * 1024)}</td>
</tr>}
<tr>
<td><strong>{_("Task ID:")}</strong></td>
<td>{task.id}</td>
</tr>
<tr>
<td><strong>{_("Task Output:")}</strong></td>
<td><div className="btn-group btn-toggle">
<button onClick={this.setView("console")} className={"btn btn-xs " + (this.state.view === "basic" ? "btn-default" : "btn-primary")}>{_("On")}</button>
<button onClick={this.setView("basic")} className={"btn btn-xs " + (this.state.view === "console" ? "btn-default" : "btn-primary")}>{_("Off")}</button>
</div></td>
</tr>
</tbody>
</table>
</div>
{!this.state.thumbLoadFailed && task.status === statusCodes.COMPLETED ?
<div className="col-md-3 col-sm-2 text-center">
<a href={`/map/project/${task.project}/task/${task.id}/`}>
<img onError={this.handleThumbError} className="task-thumbnail" src={this.thumbnailUrl()} alt={_("Thumbnail")}/>
</a>
</div> : ""}
{this.state.view === 'console' ?
<Console

Wyświetl plik

@ -156,4 +156,15 @@
.name-link{
margin-right: 4px;
}
.task-thumbnail{
width: 164px;
height: 164px;
max-width: 100%;
max-height: 164px;
overflow: hidden;
&:hover{
opacity: 0.9;
}
}
}

Wyświetl plik

@ -1,93 +1,93 @@
// Auto-generated with extract_odm_strings.py, do not edit!
_("Filters the point cloud by removing points that deviate more than N standard deviations from the local mean. Set to 0 to disable filtering. Default: %(default)s");
_("Automatically compute image masks using AI to remove the sky. Experimental. Default: %(default)s");
_("Set the compression to use for orthophotos. Can be one of: %(choices)s. Default: %(default)s");
_("Skip generation of the orthophoto. This can save time if you only need 3D results or DEMs. Default: %(default)s");
_("Classify the point cloud outputs. You can control the behavior of this option by tweaking the --dem-* parameters. Default: %(default)s");
_("Skip normalization of colors across all images. Useful when processing radiometric data. Default: %(default)s");
_("End processing at this stage. Can be one of: %(choices)s. Default: %(default)s");
_("Automatically crop image outputs by creating a smooth buffer around the dataset boundaries, shrunk by N meters. Use 0 to disable cropping. Default: %(default)s");
_("Filters the point cloud by keeping only a single point around a radius N (in meters). This can be useful to limit the output resolution of the point cloud and remove duplicate points. Set to 0 to disable sampling. Default: %(default)s");
_("Matcher algorithm, Fast Library for Approximate Nearest Neighbors or Bag of Words. FLANN is slower, but more stable. BOW is faster, but can sometimes miss valid matches. BRUTEFORCE is very slow but robust.Can be one of: %(choices)s. Default: %(default)s");
_("Do not use GPU acceleration, even if it's available. Default: %(default)s");
_("Skip generation of PDF report. This can save time if you don't need a report. Default: %(default)s");
_("Perform image matching with the nearest images based on GPS exif data. Set to 0 to match by triangulation. Default: %(default)s");
_("When processing multispectral datasets, ODM will automatically align the images for each band. If the images have been postprocessed and are already aligned, use this option. Default: %(default)s");
_("Set a camera projection type. Manually setting a value can help improve geometric undistortion. By default the application tries to determine a lens type from the images metadata. Can be one of: %(choices)s. Default: %(default)s");
_("Set a value in meters for the GPS Dilution of Precision (DOP) information for all images. If your images are tagged with high precision GPS information (RTK), this value will be automatically set accordingly. You can use this option to manually set it in case the reconstruction fails. Lowering this option can sometimes help control bowling-effects over large areas. Default: %(default)s");
_("Run local bundle adjustment for every image added to the reconstruction and a global adjustment every 100 images. Speeds up reconstruction for very large datasets. Default: %(default)s");
_("Skip generation of a full 3D model. This can save time if you only need 2D results such as orthophotos and DEMs. Default: %(default)s");
_("Specify the distance between camera shot locations and the outer edge of the boundary when computing the boundary with --auto-boundary. Set to 0 to automatically choose a value. Default: %(default)s");
_("Delete heavy intermediate files to optimize disk space usage. This affects the ability to restart the pipeline from an intermediate stage, but allows datasets to be processed on machines that don't have sufficient disk space available. Default: %(default)s");
_("Use this tag if you have a GCP File but want to use the EXIF information for georeferencing instead. Default: %(default)s");
_("Set feature extraction quality. Higher quality generates better features, but requires more memory and takes longer. Can be one of: %(choices)s. Default: %(default)s");
_("Turn on rolling shutter correction. If the camera has a rolling shutter and the images were taken in motion, you can turn on this option to improve the accuracy of the results. See also --rolling-shutter-readout. Default: %(default)s");
_("When processing multispectral datasets, you can specify the name of the primary band that will be used for reconstruction. It's recommended to choose a band which has sharp details and is in focus. Default: %(default)s");
_("Use this tag to build a DSM (Digital Surface Model, ground + objects) using a progressive morphological filter. Check the --dem* parameters for finer tuning. Default: %(default)s");
_("Orthophoto resolution in cm / pixel. Note that this value is capped by a ground sampling distance (GSD) estimate.Default: %(default)s");
_("Simple Morphological Filter slope parameter (rise over run). Default: %(default)s");
_("Export the georeferenced point cloud in LAS format. Default: %(default)s");
_("Create Cloud-Optimized GeoTIFFs instead of normal GeoTIFFs. Default: %(default)s");
_("Perform ground rectification on the point cloud. This means that wrongly classified ground points will be re-classified and gaps will be filled. Useful for generating DTMs. Default: %(default)s");
_("Perform image matching with the nearest N images based on image filename order. Can speed up processing of sequential images, such as those extracted from video. It is applied only on non-georeferenced datasets. Set to 0 to disable. Default: %(default)s");
_("Path to a GeoTIFF DEM or a LAS/LAZ point cloud that the reconstruction outputs should be automatically aligned to. Experimental. Default: %(default)s");
_("Set this parameter if you want to generate a PNG rendering of the orthophoto. Default: %(default)s");
_("Geometric estimates improve the accuracy of the point cloud by computing geometrically consistent depthmaps but may not be usable in larger datasets. This flag disables geometric estimates. Default: %(default)s");
_("Maximum number of frames to extract from video files for processing. Set to 0 for no limit. Default: %(default)s");
_("Path to the image groups file that controls how images should be split into groups. The file needs to use the following format: image_name group_nameDefault: %(default)s");
_("Radius of the overlap between submodels. After grouping images into clusters, images that are closer than this radius to a cluster are added to the cluster. This is done to ensure that neighboring submodels overlap. Default: %(default)s");
_("Copy output results to this folder after processing.");
_("Octree depth used in the mesh reconstruction, increase to get more vertices, recommended values are 8-12. Default: %(default)s");
_("Use the camera parameters computed from another dataset instead of calculating them. Can be specified either as path to a cameras.json file or as a JSON string representing the contents of a cameras.json file. Default: %(default)s");
_("Override the rolling shutter readout time for your camera sensor (in milliseconds), instead of using the rolling shutter readout database. Note that not all cameras are present in the database. Set to 0 to use the database value. Default: %(default)s");
_("Generate static tiles for orthophotos and DEMs that are suitable for viewers like Leaflet or OpenLayers. Default: %(default)s");
_("Permanently delete all previous results and rerun the processing pipeline.");
_("Minimum number of features to extract per image. More features can be useful for finding more matches between images, potentially allowing the reconstruction of areas with little overlap or insufficient features. More features also slow down processing. Default: %(default)s");
_("The maximum number of processes to use in various processes. Peak memory requirement is ~1GB per thread and 2 megapixel image resolution. Default: %(default)s");
_("Name of dataset (i.e subfolder name within project folder). Default: %(default)s");
_("Average number of images per submodel. When splitting a large dataset into smaller submodels, images are grouped into clusters. This value regulates the number of images that each cluster should have on average. Default: %(default)s");
_("Displays version number and exits. ");
_("Automatically compute image masks using AI to remove the background. Experimental. Default: %(default)s");
_("Use images' GPS exif data for reconstruction, even if there are GCPs present.This flag is useful if you have high precision GPS measurements. If there are no GCPs, this flag does nothing. Default: %(default)s");
_("Export the georeferenced point cloud in CSV format. Default: %(default)s");
_("Decimate the points before generating the DEM. 1 is no decimation (full quality). 100 decimates ~99%% of the points. Useful for speeding up generation of DEM results in very large datasets. Default: %(default)s");
_("Export the georeferenced point cloud in Entwine Point Tile (EPT) format. Default: %(default)s");
_("Use this tag to build a DTM (Digital Terrain Model, ground only) using a simple morphological filter. Check the --dem* and --smrf* parameters for finer tuning. Default: %(default)s");
_("Path to the project folder. Your project folder should contain subfolders for each dataset. Each dataset should have an \"images\" folder.");
_("Turn off camera parameter optimization during bundle adjustment. This can be sometimes useful for improving results that exhibit doming/bowling or when images are taken with a rolling shutter camera. Default: %(default)s");
_("The maximum output resolution of extracted video frames in pixels. Default: %(default)s");
_("Generates a polygon around the cropping area that cuts the orthophoto around the edges of features. This polygon can be useful for stitching seamless mosaics with multiple overlapping orthophotos. Default: %(default)s");
_("Choose the algorithm for extracting keypoints and computing descriptors. Can be one of: %(choices)s. Default: %(default)s");
_("Set the radiometric calibration to perform on images. When processing multispectral and thermal images you should set this option to obtain reflectance/temperature values (otherwise you will get digital number values). [camera] applies black level, vignetting, row gradient gain/exposure compensation (if appropriate EXIF tags are found) and computes absolute temperature values. [camera+sun] is experimental, applies all the corrections of [camera], plus compensates for spectral radiance registered via a downwelling light sensor (DLS) taking in consideration the angle of the sun. Can be one of: %(choices)s. Default: %(default)s");
_("Use a full 3D mesh to compute the orthophoto instead of a 2.5D mesh. This option is a bit faster and provides similar results in planar areas. Default: %(default)s");
_("Skip alignment of submodels in split-merge. Useful if GPS is good enough on very large datasets. Default: %(default)s");
_("Path to the file containing the ground control points used for georeferencing. The file needs to use the following format: EPSG:<code> or <+proj definition>geo_x geo_y geo_z im_x im_y image_name [gcp_name] [extra1] [extra2]Default: %(default)s");
_("Choose the structure from motion algorithm. For aerial datasets, if camera GPS positions and angles are available, triangulation can generate better results. For planar scenes captured at fixed altitude with nadir-only images, planar can be much faster. Can be one of: %(choices)s. Default: %(default)s");
_("Skips dense reconstruction and 3D model generation. It generates an orthophoto directly from the sparse reconstruction. If you just need an orthophoto and do not need a full 3D model, turn on this option. Default: %(default)s");
_("Simple Morphological Filter elevation scalar parameter. Default: %(default)s");
_("Computes an euclidean raster map for each DEM. The map reports the distance from each cell to the nearest NODATA value (before any hole filling takes place). This can be useful to isolate the areas that have been filled. Default: %(default)s");
_("Set point cloud quality. Higher quality generates better, denser point clouds, but requires more memory and takes longer. Each step up in quality increases processing time roughly by a factor of 4x.Can be one of: %(choices)s. Default: %(default)s");
_("Set this parameter if you want to generate a Google Earth (KMZ) rendering of the orthophoto. Default: %(default)s");
_("show this help message and exit");
_("Number of steps used to fill areas with gaps. Set to 0 to disable gap filling. Starting with a radius equal to the output resolution, N different DEMs are generated with progressively bigger radius using the inverse distance weighted (IDW) algorithm and merged together. Remaining gaps are then merged using nearest neighbor interpolation. Default: %(default)s");
_("Choose what to merge in the merge step in a split dataset. By default all available outputs are merged. Options: %(choices)s. Default: %(default)s");
_("URL to a ClusterODM instance for distributing a split-merge workflow on multiple nodes in parallel. Default: %(default)s");
_("Rerun processing from this stage. Can be one of: %(choices)s. Default: %(default)s");
_("Path to the image geolocation file containing the camera center coordinates used for georeferencing. If you don't have values for yaw/pitch/roll you can set them to 0. The file needs to use the following format: EPSG:<code> or <+proj definition>image_name geo_x geo_y geo_z [yaw (degrees)] [pitch (degrees)] [roll (degrees)] [horz accuracy (meters)] [vert accuracy (meters)]Default: %(default)s");
_("DSM/DTM resolution in cm / pixel. Note that this value is capped by a ground sampling distance (GSD) estimate. Default: %(default)s");
_("Ignore Ground Sampling Distance (GSD).A memory and processor hungry change relative to the default behavior if set to true. Ordinarily, GSD estimates are used to cap the maximum resolution of image outputs and resizes images when necessary, resulting in faster processing and lower memory usage. Since GSD is an estimate, sometimes ignoring it can result in slightly better image output quality. Never set --ignore-gsd to true unless you are positive you need it, and even then: do not use it. Default: %(default)s");
_("Generate single file Binary glTF (GLB) textured models. Default: %(default)s");
_("Build orthophoto overviews for faster display in programs such as QGIS. Default: %(default)s");
_("The maximum output resolution of extracted video frames in pixels. Default: %(default)s");
_("Set feature extraction quality. Higher quality generates better features, but requires more memory and takes longer. Can be one of: %(choices)s. Default: %(default)s");
_("Set this parameter if you want a striped GeoTIFF. Default: %(default)s");
_("Save the georeferenced point cloud in Cloud Optimized Point Cloud (COPC) format. Default: %(default)s");
_("Generate OGC 3D Tiles outputs. Default: %(default)s");
_("Specify the distance between camera shot locations and the outer edge of the boundary when computing the boundary with --auto-boundary. Set to 0 to automatically choose a value. Default: %(default)s");
_("Perform ground rectification on the point cloud. This means that wrongly classified ground points will be re-classified and gaps will be filled. Useful for generating DTMs. Default: %(default)s");
_("Matcher algorithm, Fast Library for Approximate Nearest Neighbors or Bag of Words. FLANN is slower, but more stable. BOW is faster, but can sometimes miss valid matches. BRUTEFORCE is very slow but robust.Can be one of: %(choices)s. Default: %(default)s");
_("Set this parameter if you want to generate a Google Earth (KMZ) rendering of the orthophoto. Default: %(default)s");
_("Simple Morphological Filter elevation threshold parameter (meters). Default: %(default)s");
_("Classify the point cloud outputs. You can control the behavior of this option by tweaking the --dem-* parameters. Default: %(default)s");
_("Override the rolling shutter readout time for your camera sensor (in milliseconds), instead of using the rolling shutter readout database. Note that not all cameras are present in the database. Set to 0 to use the database value. Default: %(default)s");
_("GeoJSON polygon limiting the area of the reconstruction. Can be specified either as path to a GeoJSON file or as a JSON string representing the contents of a GeoJSON file. Default: %(default)s");
_("Skips dense reconstruction and 3D model generation. It generates an orthophoto directly from the sparse reconstruction. If you just need an orthophoto and do not need a full 3D model, turn on this option. Default: %(default)s");
_("Keep faces in the mesh that are not seen in any camera. Default: %(default)s");
_("Do not use GPU acceleration, even if it's available. Default: %(default)s");
_("Save the georeferenced point cloud in Cloud Optimized Point Cloud (COPC) format. Default: %(default)s");
_("Average number of images per submodel. When splitting a large dataset into smaller submodels, images are grouped into clusters. This value regulates the number of images that each cluster should have on average. Default: %(default)s");
_("Use images' GPS exif data for reconstruction, even if there are GCPs present.This flag is useful if you have high precision GPS measurements. If there are no GCPs, this flag does nothing. Default: %(default)s");
_("Orthophoto resolution in cm / pixel. Note that this value is capped by a ground sampling distance (GSD) estimate.Default: %(default)s");
_("Number of steps used to fill areas with gaps. Set to 0 to disable gap filling. Starting with a radius equal to the output resolution, N different DEMs are generated with progressively bigger radius using the inverse distance weighted (IDW) algorithm and merged together. Remaining gaps are then merged using nearest neighbor interpolation. Default: %(default)s");
_("Skip generation of PDF report. This can save time if you don't need a report. Default: %(default)s");
_("Turn on rolling shutter correction. If the camera has a rolling shutter and the images were taken in motion, you can turn on this option to improve the accuracy of the results. See also --rolling-shutter-readout. Default: %(default)s");
_("Set a value in meters for the GPS Dilution of Precision (DOP) information for all images. If your images are tagged with high precision GPS information (RTK), this value will be automatically set accordingly. You can use this option to manually set it in case the reconstruction fails. Lowering this option can sometimes help control bowling-effects over large areas. Default: %(default)s");
_("Skip normalization of colors across all images. Useful when processing radiometric data. Default: %(default)s");
_("Filters the point cloud by keeping only a single point around a radius N (in meters). This can be useful to limit the output resolution of the point cloud and remove duplicate points. Set to 0 to disable sampling. Default: %(default)s");
_("Perform image matching with the nearest images based on GPS exif data. Set to 0 to match by triangulation. Default: %(default)s");
_("Radius of the overlap between submodels. After grouping images into clusters, images that are closer than this radius to a cluster are added to the cluster. This is done to ensure that neighboring submodels overlap. Default: %(default)s");
_("End processing at this stage. Can be one of: %(choices)s. Default: %(default)s");
_("Rerun this stage only and stop. Can be one of: %(choices)s. Default: %(default)s");
_("Set the radiometric calibration to perform on images. When processing multispectral and thermal images you should set this option to obtain reflectance/temperature values (otherwise you will get digital number values). [camera] applies black level, vignetting, row gradient gain/exposure compensation (if appropriate EXIF tags are found) and computes absolute temperature values. [camera+sun] is experimental, applies all the corrections of [camera], plus compensates for spectral radiance registered via a downwelling light sensor (DLS) taking in consideration the angle of the sun. Can be one of: %(choices)s. Default: %(default)s");
_("Octree depth used in the mesh reconstruction, increase to get more vertices, recommended values are 8-12. Default: %(default)s");
_("Export the georeferenced point cloud in LAS format. Default: %(default)s");
_("When processing multispectral datasets, you can specify the name of the primary band that will be used for reconstruction. It's recommended to choose a band which has sharp details and is in focus. Default: %(default)s");
_("Simple Morphological Filter slope parameter (rise over run). Default: %(default)s");
_("Generates a polygon around the cropping area that cuts the orthophoto around the edges of features. This polygon can be useful for stitching seamless mosaics with multiple overlapping orthophotos. Default: %(default)s");
_("Automatically crop image outputs by creating a smooth buffer around the dataset boundaries, shrunk by N meters. Use 0 to disable cropping. Default: %(default)s");
_("Simple Morphological Filter elevation scalar parameter. Default: %(default)s");
_("Generate single file Binary glTF (GLB) textured models. Default: %(default)s");
_("Decimate the points before generating the DEM. 1 is no decimation (full quality). 100 decimates ~99%% of the points. Useful for speeding up generation of DEM results in very large datasets. Default: %(default)s");
_("Export the georeferenced point cloud in CSV format. Default: %(default)s");
_("Choose the algorithm for extracting keypoints and computing descriptors. Can be one of: %(choices)s. Default: %(default)s");
_("Choose the structure from motion algorithm. For aerial datasets, if camera GPS positions and angles are available, triangulation can generate better results. For planar scenes captured at fixed altitude with nadir-only images, planar can be much faster. Can be one of: %(choices)s. Default: %(default)s");
_("Turn off camera parameter optimization during bundle adjustment. This can be sometimes useful for improving results that exhibit doming/bowling or when images are taken with a rolling shutter camera. Default: %(default)s");
_("Path to the project folder. Your project folder should contain subfolders for each dataset. Each dataset should have an \"images\" folder.");
_("Rerun processing from this stage. Can be one of: %(choices)s. Default: %(default)s");
_("Skip alignment of submodels in split-merge. Useful if GPS is good enough on very large datasets. Default: %(default)s");
_("Build orthophoto overviews for faster display in programs such as QGIS. Default: %(default)s");
_("show this help message and exit");
_("Name of dataset (i.e subfolder name within project folder). Default: %(default)s");
_("Use a full 3D mesh to compute the orthophoto instead of a 2.5D mesh. This option is a bit faster and provides similar results in planar areas. Default: %(default)s");
_("Use the camera parameters computed from another dataset instead of calculating them. Can be specified either as path to a cameras.json file or as a JSON string representing the contents of a cameras.json file. Default: %(default)s");
_("Path to the file containing the ground control points used for georeferencing. The file needs to use the following format: EPSG:<code> or <+proj definition>geo_x geo_y geo_z im_x im_y image_name [gcp_name] [extra1] [extra2]Default: %(default)s");
_("Generate OGC 3D Tiles outputs. Default: %(default)s");
_("Use this tag to build a DTM (Digital Terrain Model, ground only) using a simple morphological filter. Check the --dem* and --smrf* parameters for finer tuning. Default: %(default)s");
_("Automatically compute image masks using AI to remove the background. Experimental. Default: %(default)s");
_("Copy output results to this folder after processing.");
_("The maximum number of processes to use in various processes. Peak memory requirement is ~1GB per thread and 2 megapixel image resolution. Default: %(default)s");
_("Perform image matching with the nearest N images based on image filename order. Can speed up processing of sequential images, such as those extracted from video. It is applied only on non-georeferenced datasets. Set to 0 to disable. Default: %(default)s");
_("Automatically compute image masks using AI to remove the sky. Experimental. Default: %(default)s");
_("Generate OBJs that have a single material and a single texture file instead of multiple ones. Default: %(default)s");
_("DSM/DTM resolution in cm / pixel. Note that this value is capped by a ground sampling distance (GSD) estimate. Default: %(default)s");
_("When processing multispectral datasets, ODM will automatically align the images for each band. If the images have been postprocessed and are already aligned, use this option. Default: %(default)s");
_("Ignore Ground Sampling Distance (GSD).A memory and processor hungry change relative to the default behavior if set to true. Ordinarily, GSD estimates are used to cap the maximum resolution of image outputs and resizes images when necessary, resulting in faster processing and lower memory usage. Since GSD is an estimate, sometimes ignoring it can result in slightly better image output quality. Never set --ignore-gsd to true unless you are positive you need it, and even then: do not use it. Default: %(default)s");
_("Skip generation of a full 3D model. This can save time if you only need 2D results such as orthophotos and DEMs. Default: %(default)s");
_("Do not attempt to merge partial reconstructions. This can happen when images do not have sufficient overlap or are isolated. Default: %(default)s");
_("Path to a GeoTIFF DEM or a LAS/LAZ point cloud that the reconstruction outputs should be automatically aligned to. Experimental. Default: %(default)s");
_("Delete heavy intermediate files to optimize disk space usage. This affects the ability to restart the pipeline from an intermediate stage, but allows datasets to be processed on machines that don't have sufficient disk space available. Default: %(default)s");
_("Computes an euclidean raster map for each DEM. The map reports the distance from each cell to the nearest NODATA value (before any hole filling takes place). This can be useful to isolate the areas that have been filled. Default: %(default)s");
_("Generate static tiles for orthophotos and DEMs that are suitable for viewers like Leaflet or OpenLayers. Default: %(default)s");
_("Use this tag to build a DSM (Digital Surface Model, ground + objects) using a progressive morphological filter. Check the --dem* parameters for finer tuning. Default: %(default)s");
_("Skip generation of the orthophoto. This can save time if you only need 3D results or DEMs. Default: %(default)s");
_("Automatically set a boundary using camera shot locations to limit the area of the reconstruction. This can help remove far away background artifacts (sky, background landscapes, etc.). See also --boundary. Default: %(default)s");
_("The maximum vertex count of the output mesh. Default: %(default)s");
_("Do not attempt to merge partial reconstructions. This can happen when images do not have sufficient overlap or are isolated. Default: %(default)s");
_("GeoJSON polygon limiting the area of the reconstruction. Can be specified either as path to a GeoJSON file or as a JSON string representing the contents of a GeoJSON file. Default: %(default)s");
_("Keep faces in the mesh that are not seen in any camera. Default: %(default)s");
_("Generate OBJs that have a single material and a single texture file instead of multiple ones. Default: %(default)s");
_("Filters the point cloud by removing points that deviate more than N standard deviations from the local mean. Set to 0 to disable filtering. Default: %(default)s");
_("Set this parameter if you want to generate a PNG rendering of the orthophoto. Default: %(default)s");
_("Maximum number of frames to extract from video files for processing. Set to 0 for no limit. Default: %(default)s");
_("URL to a ClusterODM instance for distributing a split-merge workflow on multiple nodes in parallel. Default: %(default)s");
_("Set point cloud quality. Higher quality generates better, denser point clouds, but requires more memory and takes longer. Each step up in quality increases processing time roughly by a factor of 4x.Can be one of: %(choices)s. Default: %(default)s");
_("Set the compression to use for orthophotos. Can be one of: %(choices)s. Default: %(default)s");
_("Export the georeferenced point cloud in Entwine Point Tile (EPT) format. Default: %(default)s");
_("Set a camera projection type. Manually setting a value can help improve geometric undistortion. By default the application tries to determine a lens type from the images metadata. Can be one of: %(choices)s. Default: %(default)s");
_("Displays version number and exits. ");
_("Simple Morphological Filter window radius parameter (meters). Default: %(default)s");
_("Rerun this stage only and stop. Can be one of: %(choices)s. Default: %(default)s");
_("Run local bundle adjustment for every image added to the reconstruction and a global adjustment every 100 images. Speeds up reconstruction for very large datasets. Default: %(default)s");
_("Minimum number of features to extract per image. More features can be useful for finding more matches between images, potentially allowing the reconstruction of areas with little overlap or insufficient features. More features also slow down processing. Default: %(default)s");
_("Choose what to merge in the merge step in a split dataset. By default all available outputs are merged. Options: %(choices)s. Default: %(default)s");
_("Create Cloud-Optimized GeoTIFFs instead of normal GeoTIFFs. Default: %(default)s");
_("Permanently delete all previous results and rerun the processing pipeline.");
_("Path to the image groups file that controls how images should be split into groups. The file needs to use the following format: image_name group_nameDefault: %(default)s");
_("Use this tag if you have a GCP File but want to use the EXIF information for georeferencing instead. Default: %(default)s");
_("Geometric estimates improve the accuracy of the point cloud by computing geometrically consistent depthmaps but may not be usable in larger datasets. This flag disables geometric estimates. Default: %(default)s");

Wyświetl plik

@ -14,6 +14,7 @@ from PIL import Image
from django.contrib.auth.models import User
from rest_framework import status
from rest_framework.test import APIClient
from django.contrib.gis.geos import Polygon
import worker
from django.utils import timezone
@ -237,6 +238,9 @@ class TestApiTask(BootTransactionTestCase):
# Can_rerun_from should be an empty list
self.assertTrue(len(res.data['can_rerun_from']) == 0)
# Extent should be null
self.assertTrue(res.data['extent'] is None)
# processing_node_name should be null
self.assertTrue(res.data['processing_node_name'] is None)
@ -294,10 +298,18 @@ class TestApiTask(BootTransactionTestCase):
res = client.get("/api/projects/{}/tasks/{}/images/download/tiny_drone_image.jpg".format(other_project.id, other_task.id))
self.assertTrue(res.status_code == status.HTTP_404_NOT_FOUND)
# Cannot get thumbnail for task we have no access to
res = client.get("/api/projects/{}/tasks/{}/thumbnail".format(other_project.id, other_task.id))
self.assertEqual(res.status_code, status.HTTP_404_NOT_FOUND)
# Cannot duplicate a task we have no access to
res = client.post("/api/projects/{}/tasks/{}/duplicate/".format(other_project.id, other_task.id))
self.assertEqual(res.status_code, status.HTTP_404_NOT_FOUND)
# Cannot get thumbnail for task that is not processed
res = client.get("/api/projects/{}/tasks/{}/thumbnail".format(project.id, task.id))
self.assertEqual(res.status_code, status.HTTP_404_NOT_FOUND)
# Cannot export orthophoto
res = client.post("/api/projects/{}/tasks/{}/orthophoto/export".format(project.id, task.id), {
'formula': 'NDVI',
@ -362,6 +374,14 @@ class TestApiTask(BootTransactionTestCase):
# processing_node_name should be the name of the pnode
self.assertEqual(res.data['processing_node_name'], str(pnode))
# extent should be populated
self.assertEqual(len(res.data['extent']), 4)
self.assertTrue(isinstance(res.data['extent'][0], float))
# Can get thumbnail
res = client.get("/api/projects/{}/tasks/{}/thumbnail".format(project.id, task.id))
self.assertEqual(res.status_code, status.HTTP_200_OK)
# Can download assets
for asset in list(task.ASSETS_MAP.keys()):
res = client.get("/api/projects/{}/tasks/{}/download/{}".format(project.id, task.id, asset))
@ -435,6 +455,36 @@ class TestApiTask(BootTransactionTestCase):
self.assertEqual(i.width, 48)
self.assertEqual(i.height, 36)
# Can access task thumbnails
res = client.get("/api/projects/{}/tasks/{}/thumbnail?size=128".format(project.id, task.id))
self.assertEqual(res.status_code, status.HTTP_200_OK)
with Image.open(io.BytesIO(res.content)) as i:
# Thumbnail has requested size
self.assertEqual(i.width, 128)
self.assertEqual(i.height, 128)
# Should be PNG
self.assertEqual(i.format, "PNG")
# Can make a bad thumbnail size request
res = client.get("/api/projects/{}/tasks/{}/thumbnail?size=abc".format(project.id, task.id))
self.assertEqual(res.status_code, status.HTTP_200_OK)
with Image.open(io.BytesIO(res.content)) as i:
# Thumbnail has default size
self.assertEqual(i.width, 256)
self.assertEqual(i.height, 256)
# Can get webp thumbnails, use out of bounds size parameter
res = client.get("/api/projects/{}/tasks/{}/thumbnail?size=-5".format(project.id, task.id), HTTP_ACCEPT="image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8")
self.assertEqual(res.status_code, status.HTTP_200_OK)
with Image.open(io.BytesIO(res.content)) as i:
# Thumbnail has size 1 due to out of bounds value
self.assertEqual(i.width, 1)
self.assertEqual(i.height, 1)
# Should be WEBP
self.assertEqual(i.format, "WEBP")
# Can download images
res = client.get("/api/projects/{}/tasks/{}/images/download/tiny_drone_image.jpg".format(project.id, task.id))
self.assertTrue(res.status_code == status.HTTP_200_OK)
@ -976,6 +1026,9 @@ class TestApiTask(BootTransactionTestCase):
self.assertFalse('orthophoto_tiles.zip' in res.data['available_assets'])
self.assertTrue('textured_model.zip' in res.data['available_assets'])
# Extent should be set
self.assertTrue(len(res.data['extent']), 4)
# Can duplicate a task
res = client.post("/api/projects/{}/tasks/{}/duplicate/".format(project.id, task.id))
self.assertTrue(res.status_code, status.HTTP_200_OK)
@ -992,6 +1045,29 @@ class TestApiTask(BootTransactionTestCase):
# Directories have been created
self.assertTrue(os.path.exists(new_task.task_path()))
# Can create task with align_to parameter
res = client.post("/api/projects/{}/tasks/".format(project.id), {
'images': [image1, image2],
'name': 'test_align_task',
'processing_node': pnode.id,
'align_to': new_task.id
}, format="multipart")
self.assertTrue(res.status_code == status.HTTP_201_CREATED)
align_task = Task.objects.latest('created_at')
# Has alignment file
self.assertTrue(os.path.isfile(align_task.task_path("align.laz")))
# Alignment file is same as point cloud from align task
with open(align_task.task_path("align.laz"), "rb") as f1, open(new_task.assets_path(new_task.ASSETS_MAP['georeferenced_model.laz']), "rb") as f2:
self.assertEqual(f1.read(), f2.read())
# Images are 2 + 1 (alignment file)
self.assertEqual(align_task.images_count, 3)
image1.seek(0)
image2.seek(0)
image1.close()
image2.close()
multispec_image.close()
@ -1190,3 +1266,56 @@ class TestApiTask(BootTransactionTestCase):
image1.close()
image2.close()
def test_task_list(self):
user = User.objects.get(username="testuser")
project = Project.objects.create(name="User Test Project", owner=user)
task_completed = Task.objects.create(project=project, name="Test Success",
status=status_codes.COMPLETED,
available_assets=["dsm.tif", "georeferenced_model.laz"],
dsm_extent=Polygon.from_bbox([-82.8325,27.9578,-82.8310,27.9593]))
task_fail = Task.objects.create(project=project, name="Test Fail",
status=status_codes.FAILED,
available_assets=["orthophoto.tif", "georeferenced_model.laz"],
orthophoto_extent=Polygon.from_bbox([-82.8325,27.9578,-82.8310,27.9593]))
client = APIClient()
client.login(username="testuser", password="test1234")
other_client = APIClient()
other_client.login(username="testuser2", password="test1234")
# Cannot list another user's tasks
res = other_client.get("/api/projects/{}/tasks/".format(project.id))
self.assertEqual(res.status_code, status.HTTP_404_NOT_FOUND)
# Can list tasks
res = client.get("/api/projects/{}/tasks/".format(project.id))
self.assertEqual(res.status_code, status.HTTP_200_OK)
self.assertEqual(len(res.data), 2)
# Can filter tasks by status
res = client.get("/api/projects/{}/tasks/?status={}".format(project.id, status_codes.COMPLETED))
self.assertEqual(len(res.data), 1)
self.assertEqual(res.data[0]['id'], str(task_completed.id))
# Can filter tasks by available_assets
res = client.get("/api/projects/{}/tasks/?available_assets=georeferenced_model.laz,dsm.tif".format(project.id))
self.assertEqual(len(res.data), 1)
self.assertEqual(res.data[0]['id'], str(task_completed.id))
res = client.get("/api/projects/{}/tasks/?available_assets=orthophoto.tif".format(project.id))
self.assertEqual(len(res.data), 1)
self.assertEqual(res.data[0]['id'], str(task_fail.id))
# Can filter by bounding box intersection
res = client.get("/api/projects/{}/tasks/?bbox=-82.8320,27.9588,-82.8310,27.9593".format(project.id))
self.assertEqual(len(res.data), 2)
res = client.get("/api/projects/{}/tasks/?bbox=-82.8420,27.9688,-82.8410,27.9693".format(project.id))
self.assertEqual(len(res.data), 0)
# Cannot filter with invalid bounding box format
res = client.get("/api/projects/{}/tasks/?bbox=bad".format(project.id))
self.assertEqual(res.status_code, status.HTTP_400_BAD_REQUEST)

Wyświetl plik

@ -20,3 +20,4 @@ _("A plugin to create GCP files from images")
_("Annotate and measure on 2D maps with ease")
_("Add a GPS location button to the 2D map view")
_("Plugin to get align from external service for WebODM")
_("Detect objects using AI in orthophotos")

2
locale

@ -1 +1 @@
Subproject commit 58b4dc1e1a145c2ad892e4a3de4b4514a91fbff3
Subproject commit 820bc7a599c768f3bd4d437180f192baf8bc077b

Wyświetl plik

@ -1,6 +1,6 @@
{
"name": "WebODM",
"version": "2.7.0",
"version": "2.7.1",
"description": "User-friendly, extendable application and API for processing aerial imagery.",
"main": "index.js",
"scripts": {