Change output for outputDetail=:points_of_interest for a path without POI
parent
acf8cd0c3b
commit
5e33e62a79
|
@ -8,17 +8,23 @@ function createOutput(settings::Settings, drivingCourse::Vector{Dict}, pointsOfI
|
||||||
if settings.outputDetail == :running_time
|
if settings.outputDetail == :running_time
|
||||||
output::Vector{Dict} = [Dict(:t => drivingCourse[end][:t])]
|
output::Vector{Dict} = [Dict(:t => drivingCourse[end][:t])]
|
||||||
|
|
||||||
elseif settings.outputDetail == :points_of_interest && !isempty(pointsOfInterest)
|
elseif settings.outputDetail == :points_of_interest
|
||||||
# get only the driving course's support points with POI labels
|
# get only the driving course's support points with POI labels
|
||||||
|
# if there is no point with POI label return the information of departure and arrival (first and last points)
|
||||||
output = Dict[]
|
output = Dict[]
|
||||||
supportPoint = 1
|
if isempty(pointsOfInterest)
|
||||||
for POI in 1:length(pointsOfInterest)
|
push!(output, drivingCourse[1])
|
||||||
while supportPoint <= length(drivingCourse)
|
push!(output, drivingCourse[end])
|
||||||
if pointsOfInterest[POI][1] == drivingCourse[supportPoint][:s]
|
else
|
||||||
push!(output, drivingCourse[supportPoint])
|
supportPoint = 1
|
||||||
break
|
for POI in 1:length(pointsOfInterest)
|
||||||
|
while supportPoint <= length(drivingCourse)
|
||||||
|
if pointsOfInterest[POI][1] == drivingCourse[supportPoint][:s]
|
||||||
|
push!(output, drivingCourse[supportPoint])
|
||||||
|
break
|
||||||
|
end
|
||||||
|
supportPoint += 1
|
||||||
end
|
end
|
||||||
supportPoint += 1
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -34,7 +40,7 @@ function createOutput(settings::Settings, drivingCourse::Vector{Dict}, pointsOfI
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
else #if settings.outputDetail == :driving_course || (settings.outputDetail == :points_of_interest && !isempty(path.poi))
|
elseif settings.outputDetail == :driving_course
|
||||||
output = drivingCourse
|
output = drivingCourse
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue