Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AMAPVox Stubs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AMAP
AMAPVox
AMAPVox Stubs
Commits
ac86caaa
Verified
Commit
ac86caaa
authored
5 years ago
by
philippe.verley_ird.fr
Committed by
philippe.verley_ird.fr
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
PointsToShot.java: better handles error when parsing trajectory file.
parent
7331d8bd
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
AMAPVox/AMAPVoxCore/src/main/java/fr/amap/lidar/amapvox/voxelisation/als/PointsToShot.java
+22
-8
22 additions, 8 deletions
.../fr/amap/lidar/amapvox/voxelisation/als/PointsToShot.java
with
22 additions
and
8 deletions
AMAPVox/AMAPVoxCore/src/main/java/fr/amap/lidar/amapvox/voxelisation/als/PointsToShot.java
+
22
−
8
View file @
ac86caaa
...
...
@@ -69,7 +69,7 @@ public class PointsToShot extends Process implements IterableWithException<Shot>
}
public
void
init
()
throws
Exception
{
// read LAS / LAZ points
lasPoints
=
readALSPoints
(
inputFile
);
...
...
@@ -210,11 +210,25 @@ public class PointsToShot extends Process implements IterableWithException<Shot>
while
((
line
=
reader
.
readLine
())
!=
null
)
{
fireProgress
(
"Reading trajectory file "
+
file
.
getName
(),
count
++,
nPoint
);
String
[]
lineSplit
=
line
.
split
(
file
.
getColumnSeparator
());
points
.
add
(
new
TrajectoryPoint
(
Double
.
valueOf
(
lineSplit
[
eastingIndex
]),
Double
.
valueOf
(
lineSplit
[
northingIndex
]),
Double
.
valueOf
(
lineSplit
[
elevationIndex
]),
Double
.
valueOf
(
lineSplit
[
timeIndex
])));
if
(
lineSplit
.
length
<
4
)
{
StringBuilder
msg
=
new
StringBuilder
();
msg
.
append
(
"Line "
).
append
(
count
).
append
(
" from trajectory file has less than four columns. The point is discarded."
);
msg
.
append
(
'\n'
).
append
(
line
);
LOGGER
.
warn
(
msg
);
continue
;
}
try
{
double
easting
=
Double
.
valueOf
(
lineSplit
[
eastingIndex
]);
double
northing
=
Double
.
valueOf
(
lineSplit
[
northingIndex
]);
double
elevation
=
Double
.
valueOf
(
lineSplit
[
elevationIndex
]);
double
time
=
Double
.
valueOf
(
lineSplit
[
timeIndex
]);
points
.
add
(
new
TrajectoryPoint
(
easting
,
northing
,
elevation
,
time
));
}
catch
(
NumberFormatException
ex
)
{
StringBuilder
msg
=
new
StringBuilder
();
msg
.
append
(
"Failed to parse line "
).
append
(
count
).
append
(
" from trajectory file (number format error). The point is discarded."
);
msg
.
append
(
'\n'
).
append
(
line
);
LOGGER
.
warn
(
msg
);
}
}
LOGGER
.
info
(
"Sorting and trimming trajectory points"
);
...
...
@@ -243,7 +257,7 @@ public class PointsToShot extends Process implements IterableWithException<Shot>
// shot origin, apply transformation
Point3d
origin
=
findOrigin
(
lasPoint
);
vopMatrix
.
transform
(
origin
);
// shot direction
Vector3d
direction
=
new
Vector3d
(
point
);
direction
.
sub
(
origin
);
...
...
@@ -406,7 +420,7 @@ public class PointsToShot extends Process implements IterableWithException<Shot>
// check collinearity
return
Math
.
abs
(
1
.
d
-
Math
.
abs
(
AB
.
dot
(
AC
)))
<
epsilon
;
}
private
Point3d
toPoint3d
(
LasPoint
point
)
{
return
new
Point3d
(
point
.
x
,
point
.
y
,
point
.
z
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment