Closed chetbox closed 6 years ago
Write GPX files to an OutputStream by supplying the appropriate Observable<Point> streams.
OutputStream
Observable<Point>
Example:
GpxWriter( creator: "GpxKit", track: Observable.just(Observable.from([ Point(lat: 54.9328621088893, lon: 9.860624216140083, elevation: 0, time: Date(timeIntervalSince1970: 1505900660)), Point(lat: 54.93293237320851, lon: 9.86092208681491, elevation: 1.1, time: Date(timeIntervalSince1970: 1505900661)), Point(lat: 54.93327743521187, lon: 9.86187816543752, elevation: 2.22, time: Date(timeIntervalSince1970: 1505900662)), Point(lat: 54.93342326167919, lon: 9.86243984967986, elevation: 3.333, time: Date(timeIntervalSince1970: 1505900663)) ])) ) .write(to: outputStream) .subscribe()
generates:
<?xml version="1.0" encoding="UTF-8"?> <gpx xmlns="http://www.topografix.com/GPX/1/1" version="1.1" creator="GpxKit"> <trk> <trkseg> <trkpt lat="54.9328621088893" lon="9.86062421614008"> <ele>0.0</ele> <time>2017-09-20T09:44:20Z</time> </trkpt> <trkpt lat="54.9329323732085" lon="9.86092208681491"> <ele>1.1</ele> <time>2017-09-20T09:44:21Z</time> </trkpt> <trkpt lat="54.9332774352119" lon="9.86187816543752"> <ele>2.22</ele> <time>2017-09-20T09:44:22Z</time> </trkpt> <trkpt lat="54.9334232616792" lon="9.86243984967986"> <ele>3.333</ele> <time>2017-09-20T09:44:23Z</time> </trkpt> </trkseg> </trk> </gpx>
Note that GpxKitTests has been renamed to GpxParserTests. There's a new GpxWriterTests with all the new tests.
GpxKitTests
GpxParserTests
GpxWriterTests
Please merge #2 first
Write GPX files to an
OutputStream
by supplying the appropriateObservable<Point>
streams.Example:
generates:
Note that
GpxKitTests
has been renamed toGpxParserTests
. There's a newGpxWriterTests
with all the new tests.Please merge #2 first