Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
Itinerary
Commits
9d094009
Commit
9d094009
authored
Jul 22, 2021
by
Volker Krause
Browse files
Also write intermediate stop waypoints to the GPX trip export
parent
ba7cdf47
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/app/gpxexport.cpp
View file @
9d094009
...
...
@@ -77,7 +77,7 @@ void GpxExport::writeReservation(const QVariant &res, const KPublicTransport::Jo
writeTransfer
(
after
);
m_writer
.
writeEndRoute
();
// waypoint
s
for departure
/arrival
// waypoint for departure
auto
coord
=
LocationUtil
::
geo
(
dep
);
if
(
coord
.
isValid
())
{
m_writer
.
writeStartWaypoint
(
coord
.
latitude
(),
coord
.
longitude
());
...
...
@@ -86,6 +86,18 @@ void GpxExport::writeReservation(const QVariant &res, const KPublicTransport::Jo
m_writer
.
writeEndWaypoint
();
}
// waypoints for intermediate stops
for
(
const
auto
&
stop
:
journey
.
intermediateStops
())
{
if
(
!
stop
.
stopPoint
().
hasCoordinate
())
{
continue
;
}
m_writer
.
writeStartWaypoint
(
stop
.
stopPoint
().
latitude
(),
stop
.
stopPoint
().
longitude
());
m_writer
.
writeName
(
stop
.
stopPoint
().
name
());
m_writer
.
writeTime
(
stop
.
hasExpectedDepartureTime
()
?
stop
.
expectedDepartureTime
()
:
stop
.
scheduledDepartureTime
());
m_writer
.
writeEndWaypoint
();
}
// waypoint for arrival
coord
=
LocationUtil
::
geo
(
arr
);
if
(
coord
.
isValid
())
{
m_writer
.
writeStartWaypoint
(
coord
.
latitude
(),
coord
.
longitude
());
...
...
@@ -144,6 +156,7 @@ void GpxExport::writeJourneySection(const KPublicTransport::JourneySection §
if
(
section
.
path
().
isEmpty
())
{
m_writer
.
writeStartRoutePoint
(
section
.
from
().
latitude
(),
section
.
from
().
longitude
());
m_writer
.
writeName
(
section
.
from
().
name
());
m_writer
.
writeTime
(
section
.
hasExpectedDepartureTime
()
?
section
.
expectedDepartureTime
()
:
section
.
scheduledDepartureTime
());
m_writer
.
writeEndRoutePoint
();
...
...
@@ -155,11 +168,12 @@ void GpxExport::writeJourneySection(const KPublicTransport::JourneySection §
}
m_writer
.
writeStartRoutePoint
(
section
.
to
().
latitude
(),
section
.
to
().
longitude
());
m_writer
.
writeName
(
section
.
to
().
name
());
m_writer
.
writeTime
(
section
.
hasExpectedArrivalTime
()
?
section
.
expectedArrivalTime
()
:
section
.
scheduledArrivalTime
());
m_writer
.
writeEndRoutePoint
();
}
else
{
for
(
const
auto
&
pathSec
:
section
.
path
().
sections
())
{
// TODO name
?
// TODO name
/time
for
(
const
auto
&
pt
:
pathSec
.
path
())
{
m_writer
.
writeStartRoutePoint
(
pt
.
y
(),
pt
.
x
());
m_writer
.
writeEndRoutePoint
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment