Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OVAPI
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
WANDER
OVAPI
Commits
db229353
Commit
db229353
authored
1 year ago
by
Knuiman, Bart
Browse files
Options
Downloads
Patches
Plain Diff
Fixes routelinks that contain duplicate points (points 1 mtr from each other are removed).
parent
8e44f2ee
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ZeroMQTest/Code/OVParsers/Netex.cs
+38
-0
38 additions, 0 deletions
ZeroMQTest/Code/OVParsers/Netex.cs
ZeroMQTest/Code/Program.cs
+1
-1
1 addition, 1 deletion
ZeroMQTest/Code/Program.cs
with
39 additions
and
1 deletion
ZeroMQTest/Code/OVParsers/Netex.cs
+
38
−
0
View file @
db229353
...
...
@@ -388,6 +388,44 @@ namespace OVAPI.Code.OVParsers
kvp
.
Value
.
line
.
destination
=
kvp
.
Value
.
destination
;
}
// Validate links.
foreach
(
var
kvp
in
routeLinks
)
{
var
link
=
kvp
.
Value
;
if
(
link
.
points
.
Count
!=
0
)
{
Debug
.
Assert
(
link
.
points
.
Count
>=
2
);
for
(
int
j
=
0
;
j
<
link
.
points
.
Count
-
1
;
j
++)
{
var
p0
=
link
.
points
[
j
];
var
p1
=
link
.
points
[
j
+
1
];
var
dir
=
new
Vector2
(
p0
.
rdx
,
p0
.
rdy
)
-
new
Vector2
(
p1
.
rdx
,
p1
.
rdy
);
var
len
=
dir
.
Length
();
if
(
len
<
1
)
{
// Remove points less than a meter apart from eachother.
link
.
points
.
RemoveAt
(
j
);
j
--;
continue
;
}
}
if
(
link
.
points
.
Count
==
1
)
{
link
.
points
.
Clear
();
}
}
// Because of points too close together, may end up with no in between points. Always check from-to distance. Must not be sane value.
{
var
p0
=
link
.
from
;
var
p1
=
link
.
to
;
var
dir
=
new
Vector2
(
p0
.
rdx
,
p0
.
rdy
)
-
new
Vector2
(
p1
.
rdx
,
p1
.
rdy
);
Debug
.
Assert
(
Sane
(
dir
.
Length
()
)
);
Debug
.
Assert
(
Sane
(
dir
/
dir
.
Length
()
)
);
}
}
// Fixup routes (concat routelinks).
foreach
(
var
kvp
in
routes
)
{
...
...
This diff is collapsed.
Click to expand it.
ZeroMQTest/Code/Program.cs
+
1
−
1
View file @
db229353
...
...
@@ -42,7 +42,7 @@ class App
// Update the active simulation with new vehicle updates.
if
(
vehicleUpdates
!=
null
)
{
var
varFilteredList
=
vehicleUpdates
.
Where
(
vhi
=>
vhi
.
infos
[
0
]==
"
RET
"
).
ToList
();
var
varFilteredList
=
vehicleUpdates
.
Where
(
vhi
=>
vhi
.
infos
[
0
]==
"
HTM
"
).
ToList
();
activeOV
.
UpdateVehicles
(
varFilteredList
);
}
...
...
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