diff --git a/.gitignore b/.gitignore index c2658d7..dcb92f7 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ node_modules/ +.idea +coverage/ \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index a9f0e2a..2e65e13 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,4 +7,4 @@ node_js: notifications: email: false -after_script: NODE_ENV=test istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage \ No newline at end of file +after_script: cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage \ No newline at end of file diff --git a/README.md b/README.md index 8e07914..17fb8e9 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ # dvbjs -[![travis-ci](http://img.shields.io/travis/kiliankoe/dvbjs.svg?style=flat)](https://travis-ci.org/kiliankoe/dvbjs) -[![Coverage Status](https://coveralls.io/repos/kiliankoe/dvbjs/badge.svg?branch=master&service=github)](https://coveralls.io/github/kiliankoe/dvbjs?branch=master) -[![npmversion](http://img.shields.io/npm/v/dvbjs.svg?style=flat)](https://www.npmjs.org/package/dvbjs) +[![travis-ci](http://img.shields.io/travis/kiliankoe/dvbjs.svg?style=flat)](https://travis-ci.org/kiliankoe/dvbjs) [![Coverage Status](https://coveralls.io/repos/kiliankoe/dvbjs/badge.svg?branch=master&service=github)](https://coveralls.io/github/kiliankoe/dvbjs?branch=master) [![npmversion](http://img.shields.io/npm/v/dvbjs.svg?style=flat)](https://www.npmjs.org/package/dvbjs) This is an unofficial node module, giving you a few options to query Dresden's public transport system for current bus- and tramstop data. @@ -176,8 +174,17 @@ var nelat = 51.04615; var nelng = 13.71368; var pinType = dvb.pins.type.STOP; // type of the Pins +// or +var pinType = [dvb.pins.type.STOP, dvb.pins.type.PLATFORM]; // for multiple types + +// options for stops +var options = { + showLines: true, // show connections. default: true + groupByType: true, // group lines by transport type. default: false + fullLineType: true // show type name, title and icon_url or only the name. default: false +}; -dvb.pins(swlat, swlng, nelat, nelng, pinType, function (err, data) { +dvb.pins(swlat, swlng, nelat, nelng, pinType, options, function (err, data) { if (err) throw err; console.log(JSON.stringify(data, null, 4)); }); @@ -194,14 +201,18 @@ Output: 51.043733606562675, 13.706279792263878 ], + "type": "stop", "connections": [ { - "line": "7", - "type": "1" - }, - { - "line": "8", - "type": "1" + "type": { + "title": "Straßenbahn", + "name": "tram", + "icon_url": "https://www.dvb.de/assets/img/trans-icon/transport-tram.svg" + }, + "lines": [ + "8", + "1" + ] }, {...} ] @@ -211,7 +222,7 @@ Output: ``` -The default pin type is `STOP`, other posible types are: +The default pin type is `STOP and POI`, other posible types are: ```js pins.type = { diff --git a/lib/monitor.js b/lib/monitor.js index d806161..632afad 100644 --- a/lib/monitor.js +++ b/lib/monitor.js @@ -17,7 +17,8 @@ var monitor = function monitor(stop, offset, amount, callback) { hst: stop, vz: offset, lim: amount - } + }, + timeout: 10000 }; var now = new Date(); @@ -25,6 +26,7 @@ var monitor = function monitor(stop, offset, amount, callback) { return requestP(options) .then(JSON.parse) .map(function (transport) { + console.log(transport); var arrivalTimeRelative = parseInt(transport[2]) || 0; return { line: transport[0], diff --git a/lib/pins.js b/lib/pins.js index 807df88..1b8ab5f 100644 --- a/lib/pins.js +++ b/lib/pins.js @@ -1,25 +1,31 @@ 'use strict'; var requestP = require('request-promise'); +var _ = require('lodash'); var utils = require('./utils'); -var pins = function pins(swlat, swlng, nelat, nelng, pinType, callback) { +var pins = function pins(swlat, swlng, nelat, nelng, pinTypes, options, callback) { var sw = utils.WGS84toGK4(swlat, swlng); var ne = utils.WGS84toGK4(nelat, nelng); - var options = { - url: 'https://www.dvb.de/apps/map/pins', + if (options == null) { + options = {}; + } + options.showLines = options.showLines != false; + + var request_options = { + uri: 'https://www.dvb.de/apps/map/pins', qs: { - showLines: 'true', + showLines: options.showLines, swlat: sw[1], swlng: sw[0], nelat: ne[1], nelng: ne[0], - pintypes: pinType + pintypes: pinTypes } }; - return requestP(options) + return requestP(request_options) .then(function (data) { if (!data) { return []; @@ -30,7 +36,7 @@ var pins = function pins(swlat, swlng, nelat, nelng, pinType, callback) { return data.slice(2, data.length - 2).split('\",\"'); }) .map(function (elem) { - return utils.parsePin(elem, pinType); + return parsePin(elem, options); }).nodeify(callback); }; @@ -44,4 +50,143 @@ pins.type = { PARK_AND_RIDE: 'parkandride' }; +pins.connection_type = [ + { + title: "Straßenbahn", + name: "tram", + icon_url: "https://www.dvb.de/assets/img/trans-icon/transport-tram.svg" + }, + { + title: "Stadtbus", + name: "citybus", + icon_url: "https://www.dvb.de/assets/img/trans-icon/transport-bus.svg" + }, + { + title: "Regionalbus", + name: "regiobus", + icon_url: "https://www.dvb.de/assets/img/trans-icon/transport-bus.svg" + }, + { + title: "S-Bahn", + name: "metropolitan", + icon_url: "https://www.dvb.de/assets/img/trans-icon/transport-metropolitan.svg" + }, + { + title: "Seilbahn", + name: "lift", + icon_url: "https://www.dvb.de/assets/img/trans-icon/transport-lift.svg" + }, + { + title: "Fähre", + name: "ferry", + icon_url: "https://www.dvb.de/assets/img/trans-icon/transport-ferry.svg" + }, + { + title: "Anrufsammeltaxi (AST)/ Rufbus", + name: "ast", + icon_url: "https://www.dvb.de/assets/img/trans-icon/transport-alita.svg" + }, + { + title: "Train", + name: "train", + icon_url: "https://www.dvb.de/assets/img/trans-icon/transport-train.svg" + } +]; + +function parsePin(dataAsString, options) { + var data = dataAsString.split('|'); + var coords = utils.GK4toWGS84(data[4], data[5]); + var pinType = parsePinType(data[1]); + + if (pinType === 'platform') { + return { + name: data[3], + coords: coords, + platform_nr: data[6], + type: pinType + }; + } else if (_.contains(['poi', 'rentabike', 'ticketmachine', 'carsharing', 'parkandride'], pinType)) { + return { + id: data[0], + name: data[3], + coords: coords, + type: pinType + }; + } + + // 'stop' id default + + if (options.showLines) { + return { + id: data[0], + name: data[3], + coords: coords, + type: pinType, + connections: parseConnections(data[7], options) + }; + } else { + return { + id: data[0], + name: data[3], + coords: coords, + type: pinType + }; + } +} + +function parsePinType(pinID) { + switch (pinID) { + case "t": + return pins.type.TICKET_MACHINE; + case "pf": + return pins.type.PLATFORM; + case "c": + return pins.type.CAR_SHARING; + case "r": + return pins.type.RENT_A_BIKE; + case "pr": + return pins.type.PARK_AND_RIDE; + case "p": + return pins.type.POI; + default: + return pins.type.STOP; + } +} + +function parseConnections(data, options) { + var connections = []; + + if (options.groupByType == true) { + connections = data.split('#').map(function (types) { + types = types.split(":"); + return { + type: parseConnectionType(types[0], options), + lines: types[1].split("~").map(function (line) { + return line; + }) + } + }); + } else { + data.split('#').forEach(function (types) { + types = types.split(":"); + connections = connections.concat(types[1].split("~").map(function (line) { + return { + line: line, + type: parseConnectionType(types[0], options) + } + })); + }); + } + + return connections; +} + +function parseConnectionType(id, options) { + if (options.fullLineType == true) { + return pins.connection_type[id - 1] + } else { + return pins.connection_type[id - 1].name; + } +} + module.exports = pins; diff --git a/lib/route.js b/lib/route.js index 7ef4a9b..f540a2b 100644 --- a/lib/route.js +++ b/lib/route.js @@ -2,6 +2,8 @@ var requestP = require('request-promise'); var utils = require('./utils'); +var moment = require('moment'); +var querystring = require('querystring'); var route = function route(origin, destination, time, deparr, callback) { origin = utils.stripSpaces(origin); @@ -17,9 +19,7 @@ var route = function route(origin, destination, time, deparr, callback) { month = '0' + month; } - if (deparr !== route.DEPARTURE && deparr !== route.ARRIVAL) { - deparr = route.ARRIVAL; - } + deparr = deparr == route.DEPARTURE ? route.DEPARTURE : route.ARRIVAL; // API docs: http://data.linz.gv.at/katalog/linz_ag/linz_ag_linien/fahrplan/LINZ_LINIEN_Schnittstelle_EFA_V1.pdf // found here -> http://www.nise81.com/archives/2674 @@ -75,9 +75,9 @@ var route = function route(origin, destination, time, deparr, callback) { }; function extractTrip(trip) { - var departure = trip.legs[0].points[0].dateTime.time; - var arrival = trip.legs[trip.legs.length - 1].points[trip.legs[trip.legs.length - 1].points.length - 1].dateTime.time; - var duration = trip.duration; + var departure = parseDateTime(trip.legs[0].points[0].dateTime); + var arrival = parseDateTime(trip.legs[trip.legs.length - 1].points[trip.legs[trip.legs.length - 1].points.length - 1].dateTime); + var duration = parseDuration(trip.duration); var interchange = parseInt(trip.interchange); return { @@ -93,13 +93,13 @@ function extractTrip(trip) { var departure = { stop: leg.points[0].nameWO, - time: leg.points[0].dateTime.time, + time: parseDateTime(leg.points[0].dateTime), coords: utils.convertCoordinates(leg.points[0].ref.coords) }; var arrival = { stop: leg.points[1].nameWO, - time: leg.points[1].dateTime.time, + time: parseDateTime(leg.points[1].dateTime), coords: utils.convertCoordinates(leg.points[1].ref.coords) }; @@ -115,6 +115,15 @@ function extractTrip(trip) { }; } +function parseDateTime(dateTime) { + return moment(dateTime.date + " " + dateTime.time + "+0100", "DD.MM.YYYY HH:mmZ").toDate(); +} + +function parseDuration(duration) { + duration = duration.split(":"); + return duration[1] + duration[0] * 60; +} + route.DEPARTURE = 'dep'; route.ARRIVAL = 'arr'; diff --git a/lib/utils.js b/lib/utils.js index 7868eba..7c6cb0a 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -1,6 +1,5 @@ 'use strict'; -var _ = require('lodash'); var utils = {}; var proj4 = require('proj4'); @@ -29,53 +28,9 @@ utils.convertCoordinates = function convertCoordinates(s) { utils.convertStop = function convertStop(point) { return { stop: point.object, + id: point.stateless, coords: utils.convertCoordinates(point.ref.coords) }; }; -utils.parsePin = function parsePin(dataAsString, pinType) { - var data = dataAsString.split('|'); - var coords = utils.GK4toWGS84(data[4], data[5]); - - if (pinType === 'platform') { - return { - name: data[3], - coords: coords, - platform_nr: data[6] - }; - } else if (_.contains(['poi', 'rentabike', 'ticketmachine', 'carsharing', 'parkandride'], pinType)) { - return { - id: data[0], - name: data[3], - coords: coords - }; - } - - // 'stop' id default - return { - id: data[0], - name: data[3], - coords: coords, - connections: parseConnections(data[7]) - }; -}; - -function parseConnections(data) { - if (!data) return []; - - var connections = []; - - data.split('#').forEach(function (types) { - types = types.split(":"); - connections = connections.concat(types[1].split("~").map(function (line) { - return { - line: line, - type: types[0] - } - })); - }); - - return connections; -} - module.exports = utils; diff --git a/package.json b/package.json index 25ad810..9b8f8d6 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,9 @@ "description": "query Dresden's public transport system for current bus- and tramstop data", "main": "index", "scripts": { - "test": "mocha", - "test-live": "NODE_ENV=test_live mocha" + "test": "NODE_ENV=test istanbul cover ./node_modules/mocha/bin/_mocha -- -R spec", + "test-live": "NODE_ENV=test_live istanbul cover ./node_modules/mocha/bin/_mocha -- -R spec", + "update-mocks": "NODE_ENV=test_update istanbul cover ./node_modules/mocha/bin/_mocha -- -R spec" }, "repository": { "type": "git", @@ -47,6 +48,7 @@ "homepage": "https://github.com/kiliankoe/dvbjs", "dependencies": { "lodash": "^3.10.0", + "moment": "^2.10.6", "proj4": "^2.3.12", "request-promise": "^1.0.2" }, diff --git a/test/address.js b/test/address.js new file mode 100644 index 0000000..2c3ccec --- /dev/null +++ b/test/address.js @@ -0,0 +1,45 @@ +'use strict'; + +var Utils = require('./utils'); +var utils = new Utils(); +var assert = require('assert'); + +describe('dvb.address', function () { + describe('dvb.address "51.025451, 13.722943"', function () { + utils.mockRequest('address.json'); + + it('should resolve into an object with city and address properties', function (done) { + utils.dvb.address(51.025451, 13.722943) + .then(function (data) { + assert.strictEqual("Nöthnitzer Straße 46", data.address); + assert.strictEqual("Dresden", data.city); + done() + }) + .catch(function (err) { + done(err); + }); + }); + + it('should return a Promise but still accept a callback', function (done) { + utils.dvb.address(51.025451, 13.722943, function (err, data) { + assert(data); + done(); + }).then(assert); + }); + }); + + describe('dvb.address "0, 0"', function () { + utils.mockRequest('address-empty.json'); + + it('should return null', function (done) { + utils.dvb.address(0, 0) + .then(function (data) { + assert.equal(null, data); + done(); + }) + .catch(function (err) { + done(err); + }); + }); + }); +}); \ No newline at end of file diff --git a/test/coords.js b/test/coords.js new file mode 100644 index 0000000..a74cdbd --- /dev/null +++ b/test/coords.js @@ -0,0 +1,93 @@ +'use strict'; + +var Utils = require('./utils'); +var utils = new Utils(); +var assert = require('assert'); +var pinTypes = require('../lib/pins').type; + +describe('dvb.coords', function () { + describe('dvb.coords "33000755"', function () { + utils.mockRequest('coords-33000755.json'); + + it('should resolve into a coordinate array [lat, lng]', function (done) { + utils.dvb.coords('33000755') + .then(function (data) { + assert(Array.isArray(data)); + assert.equal(data.length, 2); + assert.strictEqual(13, Math.floor(data[1])); + assert.strictEqual(51, Math.floor(data[0])); + done(); + }) + .catch(function (err) { + done(err); + }); + }); + + it('should return a Promise but still accept a callback', function (done) { + utils.dvb.coords('33000755', function (err, data) { + assert(data); + done(); + }).then(assert); + }); + }); + + describe('dvb.coords "123"', function () { + utils.mockRequest('coords-empty.json'); + + it('should return null', function (done) { + utils.dvb.coords("123") + .then(function (data) { + assert.equal(null, data); + done(); + }) + .catch(function (err) { + done(err); + }); + }); + }); +}); + +describe('dvb.coords for id from dvb.pins', function () { + + var pins = []; + + describe('dvb.pins "51.026578, 13.713899, 51.035565, 13.737974, POI"', function () { + utils.mockRequest('pins-poi.json'); + + it('should contain objects with name, coords and id', function (done) { + utils.dvb.pins(51.026578, 13.713899, 51.035565, 13.737974, pinTypes.POI) + .then(function (data) { + assert(Array.isArray(data)); + assert.notEqual(0, data.length); + data.forEach(function (elem) { + assert(elem.id); + assert(elem.name); + assert(elem.coords); + assert.strictEqual(2, elem.coords.length); + assert.strictEqual(13, Math.floor(elem.coords[1])); + assert.strictEqual(51, Math.floor(elem.coords[0])); + }); + pins = data; + done(); + }) + .catch(function (err) { + done(err); + }); + }); + }); + + describe('dvb.coords should be equal to first pin coords', function () { + utils.mockRequest('coords-poi.json'); + + it('coordinates should be equal', function (done) { + utils.dvb.coords(pins[0].id) + .then(function (coords) { + assert.deepEqual(coords, pins[0].coords); + done(); + }) + .catch(function (err) { + done(err); + }); + }); + }); +}); \ No newline at end of file diff --git a/test/data/address-empty.json b/test/data/address-empty.json new file mode 100644 index 0000000..e16c76d --- /dev/null +++ b/test/data/address-empty.json @@ -0,0 +1 @@ +"" diff --git a/test/data/address-51-13.json b/test/data/address.json similarity index 100% rename from test/data/address-51-13.json rename to test/data/address.json diff --git a/test/data/coords-empty.json b/test/data/coords-empty.json new file mode 100644 index 0000000..e16c76d --- /dev/null +++ b/test/data/coords-empty.json @@ -0,0 +1 @@ +"" diff --git a/test/data/coords-poi.json b/test/data/coords-poi.json index 2ddf3fe..22e6bb4 100644 --- a/test/data/coords-poi.json +++ b/test/data/coords-poi.json @@ -1 +1 @@ -"5656699|4621216" \ No newline at end of file +"5656699|4621216" diff --git a/test/data/empty.json b/test/data/empty.json deleted file mode 100644 index e69de29..0000000 diff --git a/test/data/empty_json.json b/test/data/empty_json.json deleted file mode 100644 index 0637a08..0000000 --- a/test/data/empty_json.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/test/data/find-empty.json b/test/data/find-empty.json new file mode 100644 index 0000000..451caef --- /dev/null +++ b/test/data/find-empty.json @@ -0,0 +1 @@ +{ "parameters": [ { "name":"serverID", "value":"efa.vvo-online.de:8080" }, { "name":"requestID", "value":"0" }, { "name":"sessionID", "value":"0" } ], "stopFinder": { "message": [ { "name":"code", "value":"-8020" }, { "name":"error", "value":"" } ], "input": { "input":"0#" }, "points": null } } diff --git a/test/data/find-zellescherweg.json b/test/data/find-zellescherweg.json index ffd5e56..f0af17c 100644 --- a/test/data/find-zellescherweg.json +++ b/test/data/find-zellescherweg.json @@ -1 +1 @@ -{ "parameters": [ { "name":"serverID", "value":"efa.vvo-online.de:8080" }, { "name":"requestID", "value":"0" }, { "name":"sessionID", "value":"0" } ], "stopFinder": { "input": { "input":"zellesch" }, "points": { "point": { "usage":"sf", "type":"any", "name":"Dresden, Zellescher Weg", "stateless":"33000312", "anyType":"stop", "sort":"2", "quality":"408", "best":"0", "object":"Zellescher Weg", "mainLoc":"Dresden", "modes":"4,5", "ref": { "id":"33000312", "omc":"14612000", "placeID":"1", "place":"Dresden", "coords":"13.745847050,51.028365791" } } } } } +{ "parameters": [ { "name":"serverID", "value":"efa.vvo-online.de:8080" }, { "name":"requestID", "value":"0" }, { "name":"sessionID", "value":"0" } ], "stopFinder": { "message": [ { "name":"code", "value":"-8010" }, { "name":"error", "value":"" } ], "input": { "input":"zellesch" }, "points": { "point": { "usage":"sf", "type":"any", "name":"Dresden, Zellescher Weg", "stateless":"33000312", "anyType":"stop", "sort":"2", "quality":"817", "best":"0", "object":"Zellescher Weg", "mainLoc":"Dresden", "modes":"4,5", "ref": { "id":"33000312", "omc":"14612000", "placeID":"1", "place":"Dresden", "coords":"13.745847050,51.028365791" }, "infos": null } }, "itdOdvAssignedStops": { "stopID":"33000312", "name":"Zellescher Weg", "x":"13.745847050", "y":"51.028365791", "mapName":"WGS84[DD.ddddd]", "value":"33000312:Zellescher Weg", "place":"Dresden", "nameWithPlace":"Dresden Zellescher Weg", "distanceTime":"0", "isTransferStop":"0", "vm":"100", "gid":"de:14612:312" } } } diff --git a/test/data/monitor-empty.json b/test/data/monitor-empty.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/test/data/monitor-empty.json @@ -0,0 +1 @@ +[] diff --git a/test/data/monitor-postplatz.json b/test/data/monitor-postplatz.json index 39f0921..e99c900 100644 --- a/test/data/monitor-postplatz.json +++ b/test/data/monitor-postplatz.json @@ -1 +1 @@ -[["8","Südvorstadt","0"],["2","Gorbitz","1"],["2","Kleinzschachwitz","1"],["11","Zschertnitz","2"],["8","Hellerau","3"]] +[["9","Prohlis",""],["11","Bühlau",""],["4","Radebeul West","1"],["1","Prohlis","3"],["4","Laubegast","4"]] diff --git a/test/data/pins-car-sharing.json b/test/data/pins-car-sharing.json new file mode 100644 index 0000000..1164411 --- /dev/null +++ b/test/data/pins-car-sharing.json @@ -0,0 +1 @@ +["poiID:2104108141:14612000:|c||teilAuto Station Nürnberger Straße - (NU)|5656855|4621006||","poiID:2104108096:14612000:|c||teilAuto Station Fritz-Löffler-Straße (Studentenwerk) - (FL)|5657104|4621471||","poiID:2104108140:14612000:|c||teilAuto Station Nöthnitzer Straße - (NO)|5656014|4620448||"] diff --git a/test/data/pins-empty.json b/test/data/pins-empty.json new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/test/data/pins-empty.json @@ -0,0 +1 @@ + diff --git a/test/data/pins-park-and-ride.json b/test/data/pins-park-and-ride.json new file mode 100644 index 0000000..6c48a41 --- /dev/null +++ b/test/data/pins-park-and-ride.json @@ -0,0 +1 @@ +["poiID:2104107903:14628110:|pr|Freital|P+R Freital-Potschappel|5654410|4616752|10 Stellplätze, kostenfrei, 24h|","poiID:2104107857:14612000:|pr||P+R Dresden Pennrich|5657409|4614165|48 Stellplätze, kostenfrei, 24h|","poiID:2104107901:14628110:|pr|Freital|P+R Freital-Deuben|5652980|4615621|49 Stellplätze, kostenfrei, 24h|","poiID:2104107855:14612000:|pr||P+R Dresden Kaditz|5662033|4618583|195 Stellplätze, kostenfrei, 24h|","poiID:2104107902:14628110:|pr|Freital|P+R Freital-Hainsberg|5651662|4615191|110 Stellplätze, kostenfrei, 24h|"] diff --git a/test/data/pins-platform.json b/test/data/pins-platform.json index 52d3629..12a6ac1 100644 --- a/test/data/pins-platform.json +++ b/test/data/pins-platform.json @@ -1 +1 @@ -["|pf||Nürnberger Platz|5656552|4621158|3|","|pf||Nürnberger Platz|5656567|4621188|4|","|pf||Nürnberger Platz|5656643|4621195|2|","|pf||Nürnberger Platz|5656647|4621197|1|","|pf||Münchner Platz|5656372|4620892|3|","|pf||Münchner Platz|5656383|4620879|1|","|pf||Münchner Platz|5656384|4620879|2|","|pf||Münchner Platz|5656398|4620868|4|","|pf||Technische Universität (Fr.-Foerster-Platz)|5656358|4621516|4|","|pf||Technische Universität (Fr.-Foerster-Platz)|5656349|4621541|3|","|pf||Südvorstadt|5656843|4620898|2|","|pf||Südvorstadt|5656843|4620898|1|","|pf||Mommsenstraße|5656128|4621560|2|","|pf||Mommsenstraße|5656144|4621575|1|","|pf||Bernhardstraße|5656919|4620795|1|","|pf||Reichenbachstraße|5656941|4621534|4|","|pf||Bernhardstraße|5656934|4620795|2|","|pf||Reichenbachstraße|5656980|4621535|1|","|pf||Reichenbachstraße|5656972|4621562|3|","|pf||Helmholtzstraße|5655904|4621157|1|","|pf||Helmholtzstraße|5655904|4621157|2|","|pf||Regensburger Straße|5655983|4620849|1|","|pf||Reichenbachstraße|5657028|4621548|2|","|pf||Regensburger Straße|5655992|4620811|2|","|pf||Reichenbachstraße|5656761|4621794|90|","|pf||Bamberger Straße|5656621|4620487|91|","|pf||Bernhardstraße|5657243|4621095|99|","|pf||Plauen Nöthnitzer Straße|5656147|4620529|7|","|pf||Plauen Nöthnitzer Straße|5656150|4620523|1|","|pf||Plauen Nöthnitzer Straße|5656162|4620504|3|","|pf||Plauen Nöthnitzer Straße|5656122|4620504|2|","|pf||Plauen Nöthnitzer Straße|5656060|4620527|6|","|pf||Plauen Nöthnitzer Straße|5656156|4620456|8|","|pf||Staats- und Universitätsbibliothek|5656331|4621972|2|","|pf||Plauen Nöthnitzer Straße|5656105|4620436|4|","|pf||Plauen Nöthnitzer Straße|5656082|4620433|5|","|pf||Chemnitzer Straße|5657103|4620534|2|","|pf||Kaitzer Straße|5656350|4620298|90|","|pf||Bamberger Straße|5656955|4620395|93|","|pf||Staats- und Universitätsbibliothek|5656310|4622063|1|","|pf||Chemnitzer Straße|5657125|4620478|1|","|pf||Chemnitzer Straße|5657172|4620468|3|","|pf||Chemnitzer Straße|5657180|4620456|4|","|pf||Bamberger Straße|5656835|4620235|2|","|pf||Bamberger Straße|5656804|4620215|1|","|pf||Hauptbahnhof (Friedrich-List-Platz)|5657389|4621706|8|","|pf||Hauptbahnhof|5657443|4621616|11|","|pf||Hauptbahnhof (Friedrich-List-Platz)|5657395|4621705|7|","|pf||Kaitzer Straße|5656165|4620200|1|","|pf||Agentur für Arbeit|5657424|4620648|1|","|pf||Stadtgutstraße|5655763|4621918|1|","|pf||Stadtgutstraße|5655763|4621928|2|","|pf||Hauptbahnhof|5657480|4621681|3|","|pf||Hauptbahnhof|5657490|4621686|4|","|pf||Hauptbahnhof|5657495|4621703|6|","|pf||Uhlandstraße|5657229|4622032|3|","|pf||Westendstraße|5655778|4620327|1|","|pf||Westendstraße|5655778|4620327|2|","|pf||Uhlandstraße|5657192|4622111|2|","|pf||Uhlandstraße|5657180|4622135|1|","|pf||Zwickauer Straße|5657321|4620294|2|","|pf||Zwickauer Straße|5657320|4620281|1|","|pf||Gret-Palucca-Straße|5657404|4622106|92|","|pf||Gret-Palucca-Straße|5657424|4622096|2|","|pf||Gret-Palucca-Straße|5657406|4622128|1|"] +["|pf||Nürnberger Platz|5656555|4621180|1|","|pf||Nürnberger Platz|5656562|4621159|2|","|pf||Nürnberger Platz|5656643|4621195|6|","|pf||Nürnberger Platz|5656647|4621197|3|","|pf||Nürnberger Platz|5656665|4621161|4|","|pf||Nürnberger Platz|5656684|4621146|5|","|pf||Münchner Platz|5656388|4620895|1|","|pf||Münchner Platz|5656372|4620892|3|","|pf||Münchner Platz|5656398|4620868|4|","|pf||Münchner Platz|5656388|4620862|2|","|pf||Technische Universität (Fr.-Foerster-Platz)|5656358|4621516|4|","|pf||Technische Universität (Fr.-Foerster-Platz)|5656411|4621555|1|","|pf||Technische Universität (Fr.-Foerster-Platz)|5656349|4621541|3|","|pf||Südvorstadt|5656829|4620907|1|","|pf||Südvorstadt|5656845|4620915|2|","|pf||Technische Universität (Fr.-Foerster-Platz)|5656375|4621581|2|","|pf||Mommsenstraße|5656144|4621575|1|","|pf||Mommsenstraße|5656128|4621560|2|","|pf||Bernhardstraße|5656919|4620795|1|","|pf||Reichenbachstraße|5656941|4621534|4|","|pf||Bernhardstraße|5656934|4620795|2|","|pf||Reichenbachstraße|5656980|4621535|1|","|pf||Reichenbachstraße|5656972|4621562|3|","|pf||Helmholtzstraße|5655904|4621157|1|","|pf||Helmholtzstraße|5655904|4621157|2|","|pf||Regensburger Straße|5655983|4620849|1|","|pf||Reichenbachstraße|5657028|4621548|2|","|pf||Regensburger Straße|5655992|4620811|2|","|pf||Reichenbachstraße|5656761|4621794|90|","|pf||Bamberger Straße|5656621|4620487|91|","|pf||Bernhardstraße|5657243|4621095|99|","|pf||Plauen Nöthnitzer Straße|5656147|4620529|7|","|pf||Plauen Nöthnitzer Straße|5656158|4620521|1|","|pf||Plauen Nöthnitzer Straße|5656152|4620507|2|","|pf||Plauen Nöthnitzer Straße|5656167|4620490|3|","|pf||Plauen Nöthnitzer Straße|5656060|4620527|6|","|pf||Plauen Nöthnitzer Straße|5656156|4620456|8|","|pf||Staats- und Universitätsbibliothek|5656331|4621972|2|","|pf||Plauen Nöthnitzer Straße|5656110|4620439|4|","|pf||Plauen Nöthnitzer Straße|5656082|4620433|5|","|pf||Chemnitzer Straße|5657103|4620534|2|","|pf||Bamberger Straße|5656955|4620395|93|","|pf||Kaitzer Straße|5656350|4620298|90|","|pf||Staats- und Universitätsbibliothek|5656310|4622063|1|","|pf||Chemnitzer Straße|5657125|4620478|1|","|pf||Chemnitzer Straße|5657172|4620468|3|","|pf||Chemnitzer Straße|5657180|4620456|4|","|pf||Bamberger Straße|5656835|4620235|2|","|pf||Bamberger Straße|5656804|4620215|1|","|pf||Hauptbahnhof (Friedrich-List-Platz)|5657389|4621706|8|","|pf||Hauptbahnhof|5657443|4621616|11|","|pf||Hauptbahnhof (Friedrich-List-Platz)|5657395|4621705|7|","|pf||Kaitzer Straße|5656165|4620200|1|","|pf||Agentur für Arbeit|5657424|4620648|1|","|pf||Stadtgutstraße|5655763|4621918|1|","|pf||Stadtgutstraße|5655763|4621928|2|","|pf||Hauptbahnhof|5657489|4621675|4|","|pf||Hauptbahnhof|5657453|4621748|Gl. 4|","|pf||Hauptbahnhof|5657497|4621685|3|","|pf||Hauptbahnhof|5657495|4621703|6|","|pf||Uhlandstraße|5657229|4622032|3|","|pf||Westendstraße|5655778|4620327|1|","|pf||Westendstraße|5655778|4620327|2|","|pf||Uhlandstraße|5657192|4622111|2|","|pf||Uhlandstraße|5657180|4622135|1|","|pf||Zwickauer Straße|5657321|4620294|2|","|pf||Zwickauer Straße|5657320|4620281|1|","|pf||Gret-Palucca-Straße|5657404|4622106|92|","|pf||Gret-Palucca-Straße|5657424|4622096|2|","|pf||Gret-Palucca-Straße|5657406|4622128|1|"] diff --git a/test/data/pins-poi-and-platform.json b/test/data/pins-poi-and-platform.json new file mode 100644 index 0000000..8d98749 --- /dev/null +++ b/test/data/pins-poi-and-platform.json @@ -0,0 +1 @@ +["|pf||Nürnberger Platz|5656555|4621180|1|","|pf||Nürnberger Platz|5656562|4621159|2|","|pf||Nürnberger Platz|5656643|4621195|6|","|pf||Nürnberger Platz|5656647|4621197|3|","|pf||Nürnberger Platz|5656665|4621161|4|","|pf||Nürnberger Platz|5656684|4621146|5|","poiID:2104107042:14612000:|p||Helmholtz-Apotheke|5656699|4621216||","poiID:2104107024:14612000:|p||Hannah-Arendt-Institut|5656347|4621072||","poiID:2104106844:14612000:|p||Gedenkstätte Münchner Platz|5656321|4620993||","|pf||Münchner Platz|5656388|4620895|1|","|pf||Münchner Platz|5656372|4620892|3|","poiID:2104106534:14612000:|p||Bibliothek Südvorstadt Anne Frank|5656757|4620960||","poiID:2104107264:14612000:|p||Liebig-Apotheke|5656659|4620879||","|pf||Münchner Platz|5656398|4620868|4|","|pf||Münchner Platz|5656388|4620862|2|","poiID:2104107151:14612000:|p||Jugendherberge Rudi Arndt|5656870|4621151||","poiID:2104106373:14612000:|p||Apotheke Am Ei|5656710|4620874||","poiID:2104107773:14612000:|p||Unisammlungen Kunst + Technik|5656157|4621145||","|pf||Technische Universität (Fr.-Foerster-Platz)|5656358|4621516|4|","|pf||Technische Universität (Fr.-Foerster-Platz)|5656411|4621555|1|","|pf||Technische Universität (Fr.-Foerster-Platz)|5656349|4621541|3|","|pf||Südvorstadt|5656829|4620907|1|","|pf||Südvorstadt|5656845|4620915|2|","poiID:2104107065:14612000:|p||Hörsaalzentrum|5656259|4621506||","poiID:2104107830:14612000:|p||Zionskirche|5656674|4620776||","|pf||Technische Universität (Fr.-Foerster-Platz)|5656375|4621581|2|","poiID:2104107490:14612000:|p||Russisch-Orthodoxe Kirche|5656803|4621528||","poiID:2104107279:14612000:|p||Lukas-Apotheke|5656677|4621647||","poiID:2104107665:14612000:|p||Technische Universität Dresden|5655981|4621255||","|pf||Mommsenstraße|5656144|4621575|1|","|pf||Mommsenstraße|5656128|4621560|2|","|pf||Bernhardstraße|5656919|4620795|1|","|pf||Reichenbachstraße|5656941|4621534|4|","poiID:2104107657:14612000:|p||Studentenwerk Dresden|5656981|4621484||","|pf||Bernhardstraße|5656934|4620795|2|","poiID:2104106806:14612000:|p||GAG 18|5656970|4621527||","|pf||Reichenbachstraße|5656980|4621535|1|","|pf||Reichenbachstraße|5656972|4621562|3|","poiID:2104107280:14612000:|p||Lukaskirche|5656560|4621787||","|pf||Helmholtzstraße|5655904|4621157|2|","|pf||Helmholtzstraße|5655904|4621157|1|","|pf||Regensburger Straße|5655983|4620849|1|","|pf||Reichenbachstraße|5657028|4621548|2|","|pf||Regensburger Straße|5655992|4620811|2|","poiID:2104106246:14612000:|p||117. Grundschule Dresden Ludwig Reichenbach|5656839|4621737||","|pf||Reichenbachstraße|5656761|4621794|90|","|pf||Bamberger Straße|5656621|4620487|91|","poiID:2104106289:14612000:|p||49. Grundschule Bernhard August von Lindenau Dresden|5656347|4620494||","poiID:2104107606:14612000:|p||Sporthallen TUD Nöthnitzer Str.|5655819|4621014||","|pf||Bernhardstraße|5657243|4621095|99|","|pf||Plauen Nöthnitzer Straße|5656147|4620529|7|","|pf||Plauen Nöthnitzer Straße|5656158|4620521|1|","|pf||Plauen Nöthnitzer Straße|5656152|4620507|2|","|pf||Plauen Nöthnitzer Straße|5656167|4620490|3|","poiID:2104106286:14612000:|p||46. Mittelschule Dresden|5657298|4621038||","|pf||Plauen Nöthnitzer Straße|5656060|4620527|6|","|pf||Plauen Nöthnitzer Straße|5656156|4620456|8|","poiID:2104107577:14612000:|p||SLUB|5656270|4621951||","poiID:2104106565:14612000:|p||Buchmuseum der Sächsischen Landesbibliothek|5656271|4621951||","poiID:2104107494:14612000:|p||Sächsische Landes-, Staats- und Universitätsbibliothek|5656270|4621951||","|pf||Staats- und Universitätsbibliothek|5656331|4621972|2|","poiID:2104106714:14612000:|p||FhG - EAS|5656090|4621884||","|pf||Plauen Nöthnitzer Straße|5656110|4620439|4|","|pf||Plauen Nöthnitzer Straße|5656082|4620433|5|","|pf||Chemnitzer Straße|5657103|4620534|2|","poiID:2104107101:14612000:|p||Hotel Kipping|5657340|4621485||","poiID:2104106742:14612000:|p||Fraunhofer IVI|5656056|4621932||","|pf||Kaitzer Straße|5656350|4620298|90|","|pf||Bamberger Straße|5656955|4620395|93|","poiID:2104106264:14612000:|p||2. Schule für geistig Behinderte|5657415|4621116||","poiID:2104106256:14612000:|p||14. Grundschule Dresden|5657415|4621116||","|pf||Staats- und Universitätsbibliothek|5656310|4622063|1|","|pf||Chemnitzer Straße|5657125|4620478|1|","|pf||Chemnitzer Straße|5657172|4620468|3|","|pf||Chemnitzer Straße|5657180|4620456|4|","|pf||Bamberger Straße|5656835|4620235|2|","|pf||Bamberger Straße|5656804|4620215|1|","|pf||Hauptbahnhof (Friedrich-List-Platz)|5657389|4621706|8|","|pf||Hauptbahnhof|5657443|4621616|11|","|pf||Hauptbahnhof (Friedrich-List-Platz)|5657395|4621705|7|","|pf||Kaitzer Straße|5656165|4620200|1|","|pf||Agentur für Arbeit|5657424|4620648|1|","|pf||Stadtgutstraße|5655763|4621918|1|","|pf||Stadtgutstraße|5655763|4621928|2|","|pf||Hauptbahnhof|5657489|4621675|4|","|pf||Hauptbahnhof|5657453|4621748|Gl. 4|","|pf||Hauptbahnhof|5657497|4621685|3|","|pf||Hauptbahnhof|5657495|4621703|6|","|pf||Uhlandstraße|5657229|4622032|3|","|pf||Westendstraße|5655778|4620327|2|","|pf||Westendstraße|5655778|4620327|1|","|pf||Uhlandstraße|5657192|4622111|2|","|pf||Uhlandstraße|5657180|4622135|1|","|pf||Zwickauer Straße|5657321|4620294|2|","|pf||Zwickauer Straße|5657320|4620281|1|","|pf||Gret-Palucca-Straße|5657404|4622106|92|","|pf||Gret-Palucca-Straße|5657424|4622096|2|","|pf||Gret-Palucca-Straße|5657406|4622128|1|"] diff --git a/test/data/pins-poi.json b/test/data/pins-poi.json index e3964b5..6e1a251 100644 --- a/test/data/pins-poi.json +++ b/test/data/pins-poi.json @@ -1 +1 @@ -["poiID:2104107042:14612000:|p||Helmholtz-Apotheke|5656699|4621216||","poiID:2104107024:14612000:|p||Hannah-Arendt-Institut|5656347|4621072||","poiID:2104106844:14612000:|p||Gedenkstätte Münchner Platz|5656321|4620993||","poiID:2104106534:14612000:|p||Bibliothek Südvorstadt Anne Frank|5656757|4620960||","poiID:2104107264:14612000:|p||Liebig-Apotheke|5656659|4620879||","poiID:2104107151:14612000:|p||Jugendherberge Rudi Arndt|5656870|4621151||","poiID:2104106373:14612000:|p||Apotheke Am Ei|5656710|4620874||","poiID:2104107773:14612000:|p||Unisammlungen Kunst + Technik|5656157|4621145||","poiID:2104107065:14612000:|p||Hörsaalzentrum|5656259|4621506||","poiID:2104107830:14612000:|p||Zionskirche|5656674|4620776||","poiID:2104107490:14612000:|p||Russisch-Orthodoxe Kirche|5656803|4621528||","poiID:2104107279:14612000:|p||Lukas-Apotheke|5656677|4621647||","poiID:2104107665:14612000:|p||Technische Universität Dresden|5655981|4621255||","poiID:2104107657:14612000:|p||Studentenwerk Dresden|5656981|4621484||","poiID:2104106806:14612000:|p||GAG 18|5656970|4621527||","poiID:2104107280:14612000:|p||Lukaskirche|5656560|4621787||","poiID:2104106246:14612000:|p||117. Grundschule Dresden Ludwig Reichenbach|5656839|4621737||","poiID:2104106289:14612000:|p||49. Grundschule Bernhard August von Lindenau Dresden|5656347|4620494||","poiID:2104107606:14612000:|p||Sporthallen TUD Nöthnitzer Str.|5655819|4621014||","poiID:2104106286:14612000:|p||46. Mittelschule Dresden|5657298|4621038||","poiID:2104106565:14612000:|p||Buchmuseum der Sächsischen Landesbibliothek|5656271|4621951||","poiID:2104107494:14612000:|p||Sächsische Landes-, Staats- und Universitätsbibliothek|5656270|4621951||","poiID:2104107577:14612000:|p||SLUB|5656270|4621951||","poiID:2104106714:14612000:|p||FhG - EAS|5656090|4621884||","poiID:2104107101:14612000:|p||Hotel Kipping|5657340|4621485||","poiID:2104106742:14612000:|p||Fraunhofer IVI|5656056|4621932||","poiID:2104106264:14612000:|p||2. Schule für geistig Behinderte|5657415|4621116||","poiID:2104106256:14612000:|p||14. Grundschule Dresden|5657415|4621116||"] \ No newline at end of file +["poiID:2104107042:14612000:|p||Helmholtz-Apotheke|5656699|4621216||","poiID:2104107024:14612000:|p||Hannah-Arendt-Institut|5656347|4621072||","poiID:2104106844:14612000:|p||Gedenkstätte Münchner Platz|5656321|4620993||","poiID:2104106534:14612000:|p||Bibliothek Südvorstadt Anne Frank|5656757|4620960||","poiID:2104107264:14612000:|p||Liebig-Apotheke|5656659|4620879||","poiID:2104107151:14612000:|p||Jugendherberge Rudi Arndt|5656870|4621151||","poiID:2104106373:14612000:|p||Apotheke Am Ei|5656710|4620874||","poiID:2104107773:14612000:|p||Unisammlungen Kunst + Technik|5656157|4621145||","poiID:2104107065:14612000:|p||Hörsaalzentrum|5656259|4621506||","poiID:2104107830:14612000:|p||Zionskirche|5656674|4620776||","poiID:2104107490:14612000:|p||Russisch-Orthodoxe Kirche|5656803|4621528||","poiID:2104107279:14612000:|p||Lukas-Apotheke|5656677|4621647||","poiID:2104107665:14612000:|p||Technische Universität Dresden|5655981|4621255||","poiID:2104107657:14612000:|p||Studentenwerk Dresden|5656981|4621484||","poiID:2104106806:14612000:|p||GAG 18|5656970|4621527||","poiID:2104107280:14612000:|p||Lukaskirche|5656560|4621787||","poiID:2104106246:14612000:|p||117. Grundschule Dresden Ludwig Reichenbach|5656839|4621737||","poiID:2104106289:14612000:|p||49. Grundschule Bernhard August von Lindenau Dresden|5656347|4620494||","poiID:2104107606:14612000:|p||Sporthallen TUD Nöthnitzer Str.|5655819|4621014||","poiID:2104106286:14612000:|p||46. Mittelschule Dresden|5657298|4621038||","poiID:2104106565:14612000:|p||Buchmuseum der Sächsischen Landesbibliothek|5656271|4621951||","poiID:2104107494:14612000:|p||Sächsische Landes-, Staats- und Universitätsbibliothek|5656270|4621951||","poiID:2104107577:14612000:|p||SLUB|5656270|4621951||","poiID:2104106714:14612000:|p||FhG - EAS|5656090|4621884||","poiID:2104107101:14612000:|p||Hotel Kipping|5657340|4621485||","poiID:2104106742:14612000:|p||Fraunhofer IVI|5656056|4621932||","poiID:2104106264:14612000:|p||2. Schule für geistig Behinderte|5657415|4621116||","poiID:2104106256:14612000:|p||14. Grundschule Dresden|5657415|4621116||"] diff --git a/test/data/pins-rent-a-bike.json b/test/data/pins-rent-a-bike.json new file mode 100644 index 0000000..ade6234 --- /dev/null +++ b/test/data/pins-rent-a-bike.json @@ -0,0 +1 @@ +["poiID:2104108009:14612000:|r||SZ-Bike Station - Nürnberger Platz|5656570|4621200||","poiID:2104107979:14612000:|r||SZ-Bike Station - Nürnberger Ei|5656814|4620957||","poiID:2104107976:14612000:|r||SZ-Bike Station - Bergstr./Zellescher Weg|5656431|4621534||","poiID:2104107983:14612000:|r||SZ-Bike Station - Bautest|5656199|4620902||","poiID:2104107981:14612000:|r||SZ-Bike Station - Mommsenstr./Bergstr.|5656107|4621546||","poiID:2104108008:14612000:|r||SZ-Bike Station - Bamberger Straße|5656589|4620565||","poiID:2104107982:14612000:|r||SZ-Bike Station - Nöthnitzer Straße|5655898|4621211||","poiID:2104108007:14612000:|r||SZ-Bike Station - Leubnitzer Straße|5657252|4621112||","poiID:2104107975:14612000:|r||SZ-Bike Station - HTW Dresden/Hochschulstraße|5657020|4621775||","poiID:2104108010:14612000:|r||SZ-Bike Station - Plauen/Nöthnitzer Straße|5656124|4620487||"] diff --git a/test/data/pins-stop.json b/test/data/pins-stop.json index 0a77330..93ccfce 100644 --- a/test/data/pins-stop.json +++ b/test/data/pins-stop.json @@ -1 +1 @@ -["33000132|||Nürnberger Platz|5656599|4621245||1:3~7~8~9#2:61~63#3:333~400","33000134|||Münchner Platz|5656381|4620873||1:3~7~8~9","33000727|||Technische Universität (Fr.-Foerster-Platz)|5656396|4621529||2:61~63~66#3:352~360~366~424~672","33000133|||Südvorstadt|5656843|4620898||1:3~8#2:61","33000724|||Bernhardstraße|5656892|4620833||2:61~63#3:333","33000732|||Mommsenstraße|5656132|4621567||2:66#3:352~360~366","33000131|||Reichenbachstraße|5656979|4621548||1:3~7~8~9#2:66#3:333~352~360~366","33000742|||Helmholtzstraße|5655904|4621157||2:85","33000513|||Regensburger Straße|5655989|4620830||2:85","33000135|||Plauen Nöthnitzer Straße|5656119|4620472||1:3~7~8~9#2:85","33000728|||Staats- und Universitätsbibliothek|5656319|4622011||2:61~63","33000723|||Chemnitzer Straße|5657144|4620451||2:61~62~63#3:333","33000720|||Bamberger Straße|5656814|4620223||2:62","33000036|||Hauptbahnhof (Friedrich-List-Platz)|5657392|4621708||2:66~SEV#3:SEV","33000512|||Stadtgutstraße|5655763|4621918||2:85","33000721|||Agentur für Arbeit|5657491|4620678||2:62","33000160|||Westendstraße|5655779|4620329||2:63","33000782|||Uhlandstraße|5657186|4622121||2:66~H/S","33000722|||Zwickauer Straße|5657322|4620286||2:61~63","33000030|||Gret-Palucca-Straße|5657405|4622123||1:9~10~11#2:66"] +["33000132|||Nürnberger Platz|5656599|4621245||1:3~7~8#2:61~63#3:333~400","33000134|||Münchner Platz|5656381|4620873||1:3~7~8","33000727|||Technische Universität (Fr.-Foerster-Platz)|5656396|4621529||2:61~63~66#3:352~360~366~424~672","33000133|||Südvorstadt|5656838|4620912||1:8","33000724|||Bernhardstraße|5656912|4620804||2:61~63#3:333","33000732|||Mommsenstraße|5656132|4621567||2:66#3:352~360~366","33000131|||Reichenbachstraße|5656979|4621548||1:3~7~8#2:66#3:333~352~360~366","33000742|||Helmholtzstraße|5655904|4621157||2:85","33000513|||Regensburger Straße|5655989|4620830||2:85","33000135|||Plauen Nöthnitzer Straße|5656119|4620472||1:3~7~8#2:85","33000728|||Staats- und Universitätsbibliothek|5656319|4622011||2:61~63","33000723|||Chemnitzer Straße|5657144|4620451||2:61~62~63#3:333","33000720|||Bamberger Straße|5656814|4620223||2:62","33000036|||Hauptbahnhof (Friedrich-List-Platz)|5657392|4621708||2:66#3:SEV","33000512|||Stadtgutstraße|5655763|4621918||2:85","33000721|||Agentur für Arbeit|5657491|4620678||2:62","33000160|||Westendstraße|5655779|4620329||2:63","33000782|||Uhlandstraße|5657186|4622121||2:66~H/S","33000722|||Zwickauer Straße|5657322|4620286||2:61~63","33000030|||Gret-Palucca-Straße|5657405|4622123||1:9~10~11#2:66"] diff --git a/test/data/pins-ticket-machine.json b/test/data/pins-ticket-machine.json new file mode 100644 index 0000000..1bf6312 --- /dev/null +++ b/test/data/pins-ticket-machine.json @@ -0,0 +1 @@ +["poiID:2104108200:14612000:|t||Ticketautomat Dresden, Nürnberger Platz -|5656639|4621187||","poiID:2104108302:14612000:|t||Ticketautomat Dresden, Münchner Platz -|5656386|4620914||","poiID:2104108255:14612000:|t||Ticketautomat Dresden, Südvorstadt -|5656841|4620905||","poiID:2104108239:14612000:|t||Ticketautomat Dresden, Reichenbachstraße -|5656927|4621532||","poiID:2104108257:14612000:|t||Ticketautomat Dresden, Nöthnitzer Straße -|5656165|4620532||","poiID:2104108241:14612000:|t||Ticketautomat Dresden, Chemnitzer Straße -|5657165|4620478||"] diff --git a/test/data/route-empty.json b/test/data/route-empty.json new file mode 100644 index 0000000..94e915d --- /dev/null +++ b/test/data/route-empty.json @@ -0,0 +1 @@ +{ "parameters": [ { "name":"serverID", "value":"efa.vvo-online.de:8080" }, { "name":"requestID", "value":"1" }, { "name":"sessionID", "value":"1832555959" } ], "itdMessageList": [ ], "origin": { "message": [ { "name":"code", "value":"-2000" }, { "name":"error", "value":"stop invalid" } ], "input": { "input":"0" }, "points": null }, "destination": { "message": [ { "name":"code", "value":"-2000" }, { "name":"error", "value":"stop invalid" } ], "input": { "input":"0" }, "points": null }, "via": { "input": { "input":"" }, "points": null }, "dateTime": { "deparr":"arr", "ttpFrom":"20161211", "ttpTo":"20171209", "year":"2017", "month":"2", "day":"16", "hour":"17", "minute":"25" }, "dateRange": [ { "day":"16", "month":"02", "year":"2017", "weekday":"5" }, { "day":"17", "month":"02", "year":"2017", "weekday":"6" }, { "day":"18", "month":"02", "year":"2017", "weekday":"7" }, { "day":"19", "month":"02", "year":"2017", "weekday":"1" }, { "day":"20", "month":"02", "year":"2017", "weekday":"2" }, { "day":"21", "month":"02", "year":"2017", "weekday":"3" }, { "day":"22", "month":"02", "year":"2017", "weekday":"4" }, { "day":"23", "month":"02", "year":"2017", "weekday":"5" }, { "day":"24", "month":"02", "year":"2017", "weekday":"6" }, { "day":"25", "month":"02", "year":"2017", "weekday":"7" }, { "day":"26", "month":"02", "year":"2017", "weekday":"1" }, { "day":"27", "month":"02", "year":"2017", "weekday":"2" }, { "day":"28", "month":"02", "year":"2017", "weekday":"3" }, { "day":"01", "month":"03", "year":"2017", "weekday":"4" }, { "day":"02", "month":"03", "year":"2017", "weekday":"5" } ], "option": { "ptOption": { "active":"1", "maxChanges":"9", "maxTime":"360", "maxWait":"120", "routeType":"LEASTTIME", "changeSpeed":"normal", "lineRestriction":"400", "useProxFootSearch":"0", "useProxFootSearchOrigin":"0", "useProxFootSearchDestination":"0", "bike":"0", "plane":"0", "noCrowded":"0", "noSolidStairs":"0", "noEscalators":"0", "noElevators":"0", "lowPlatformVhcl":"0", "wheelchair":"0", "needElevatedPlt":"0", "assistance":"0", "SOSAvail":"0", "noLonelyTransfer":"0", "illumTransfer":"0", "noInsecurePlaces":"0", "privateTransport":"0", "excludedMeans": [ { "means":"Zug", "value":"0", "selected":"0" }, { "means":"S-Bahn", "value":"1", "selected":"0" }, { "means":"U-Bahn", "value":"2", "selected":"0" }, { "means":"Stadtbahn", "value":"3", "selected":"0" }, { "means":"Straßen-/Trambahn", "value":"4", "selected":"0" }, { "means":"Stadtbus", "value":"5", "selected":"0" }, { "means":"Regionalbus", "value":"6", "selected":"0" }, { "means":"Schnellbus", "value":"7", "selected":"0" }, { "means":"Seil-/Zahnradbahn", "value":"8", "selected":"0" }, { "means":"Schiff", "value":"9", "selected":"0" }, { "means":"AST/Rufbus", "value":"10", "selected":"0" }, { "means":"Sonstige", "value":"11", "selected":"0" }, { "means":"Flugzeug", "value":"12", "selected":"0" }, { "means":"Zug (Nahverkehr)", "value":"13", "selected":"0" }, { "means":"Zug (Fernverkehr)", "value":"14", "selected":"0" }, { "means":"Zug (Fernverkehr mit", "value":"15", "selected":"0" }, { "means":"Zug (Fernverkehr mit", "value":"16", "selected":"0" }, { "means":"Schienenersatzverkeh", "value":"17", "selected":"0" }, { "means":"Zug Shuttle", "value":"18", "selected":"0" }, { "means":"Bürgerbus", "value":"19", "selected":"0" } ], "activeImp":"-1", "activeCom":"-1", "activeSec":"-1" }, "itOption": { "active":"1", "itRouter": { "logASCII":"0", "logSVG":"0" }, "pedestrian": { "computeMonomodalTrip":"0", "computationType":"PT_AND_IT", "useElevation":"0", "speedFactor":"100", "speedFactor":"0", "distanceFactor":"50", "traveltimeFactor":"50", "noTunnel":"0", "noBridge":"0", "noFerry":"0", "maxTime":"30", "minTime":"0", "maxLength":"2147483647", "minLength":"0", "ignoreRestrictions":"0", "computeAlternativeRoutes":"0", "level":"connection" }, "itBicycle": { "computeMonomodalTrip":"0", "computationType":"PT_AND_IT", "useElevation":"0", "speedFactor":"100", "speedFactor":"0", "distanceFactor":"50", "traveltimeFactor":"50", "noTunnel":"0", "noBridge":"0", "noFerry":"0", "maxTime":"40", "minTime":"0", "maxLength":"2147483647", "minLength":"0", "ignoreRestrictions":"0", "computeAlternativeRoutes":"0", "level":"unknown" }, "mitCar": { "computeMonomodalTrip":"0", "computationType":"PT_AND_IT", "useElevation":"0", "speedFactor":"100", "speedFactor":"0", "distanceFactor":"10", "traveltimeFactor":"90", "noTunnel":"0", "noBridge":"0", "noFerry":"0", "maxTime":"40", "minTime":"0", "maxLength":"2147483647", "minLength":"0", "ignoreRestrictions":"0", "computeAlternativeRoutes":"0", "level":"unknown", "mitProfileData":"0", "mitIncidentData":"0", "mitOnlineData":"0", "noHighway":"0", "noTollRoad":"0", "prefSerSt":"0" }, "mitTaxi": { "computeMonomodalTrip":"0", "computationType":"PT_AND_IT", "useElevation":"0", "speedFactor":"100", "speedFactor":"0", "distanceFactor":"10", "traveltimeFactor":"90", "noTunnel":"0", "noBridge":"0", "noFerry":"0", "maxTime":"15", "minTime":"0", "maxLength":"2147483647", "minLength":"0", "ignoreRestrictions":"0", "computeAlternativeRoutes":"0", "level":"unknown", "mitProfileData":"0", "mitIncidentData":"0", "mitOnlineData":"0", "noHighway":"0", "noTollRoad":"0", "prefSerSt":"0" } }, "departureTransport": { "meansCode":"100", "value":"10", "speed":"normal" }, "arrivalTransport": { "meansCode":"100", "value":"10", "speed":"normal" } }, "trips": null } diff --git a/test/data/route-pragerstr-postplatz.json b/test/data/route-pragerstr-postplatz.json index 207d8e2..592841e 100644 --- a/test/data/route-pragerstr-postplatz.json +++ b/test/data/route-pragerstr-postplatz.json @@ -1 +1 @@ -{ "parameters": [ { "name":"serverID", "value":"efa.vvo-online.de:8080" }, { "name":"requestID", "value":"1" }, { "name":"sessionID", "value":"1182568638" } ], "origin": { "input": { "input":"pragerstrasse" }, "points": { "point": { "usage":"origin", "type":"stop", "name":"Dresden, Prager Straße", "stateless":"33000003", "ref": { "id":"33000003", "omc":"14612000", "placeID":"1", "place":"Dresden", "coords":"13.737825553,51.047148078" } } } }, "destination": { "input": { "input":"postplatz" }, "points": { "point": { "usage":"destination", "type":"stop", "name":"Dresden, Postplatz", "stateless":"33000037", "ref": { "id":"33000037", "omc":"14612000", "placeID":"1", "place":"Dresden", "coords":"13.733585680,51.050851910" } } } }, "via": { "input": { "input":"" }, "points": null }, , "dateTime": { "deparr":"dep", "ttpFrom":"20151101", "ttpTo":"20161210", "year":"2015", "month":"12", "day":"12", "hour":"7", "minute":"30" }, "dateRange": [ { "day":"12", "month":"12", "year":"2015", "weekday":"7" }, { "day":"13", "month":"12", "year":"2015", "weekday":"1" }, { "day":"14", "month":"12", "year":"2015", "weekday":"2" }, { "day":"15", "month":"12", "year":"2015", "weekday":"3" }, { "day":"16", "month":"12", "year":"2015", "weekday":"4" }, { "day":"17", "month":"12", "year":"2015", "weekday":"5" }, { "day":"18", "month":"12", "year":"2015", "weekday":"6" }, { "day":"19", "month":"12", "year":"2015", "weekday":"7" }, { "day":"20", "month":"12", "year":"2015", "weekday":"1" }, { "day":"21", "month":"12", "year":"2015", "weekday":"2" }, { "day":"22", "month":"12", "year":"2015", "weekday":"3" }, { "day":"23", "month":"12", "year":"2015", "weekday":"4" }, { "day":"24", "month":"12", "year":"2015", "weekday":"5" }, { "day":"25", "month":"12", "year":"2015", "weekday":"6" }, { "day":"26", "month":"12", "year":"2015", "weekday":"7" } ], "option": { "ptOption": { "active":"-1", "maxChanges":"9", "maxTime":"360", "maxWait":"120", "routeType":"LEASTTIME", "changeSpeed":"normal", "lineRestriction":"400", "useProxFootSearch":"0", "useProxFootSearchOrigin":"0", "useProxFootSearchDestination":"0", "bike":"0", "plane":"0", "noCrowded":"0", "noSolidStairs":"0", "noEscalators":"0", "noElevators":"0", "lowPlatformVhcl":"0", "wheelchair":"0", "needElevatedPlt":"0", "assistance":"0", "SOSAvail":"0", "noLonelyTransfer":"0", "illumTransfer":"0", "noInsecurePlaces":"0", "privateTransport":"0", "excludedMeans": [ { "means":"Zug", "value":"0", "selected":"0" }, { "means":"S-Bahn", "value":"1", "selected":"0" }, { "means":"U-Bahn", "value":"2", "selected":"0" }, { "means":"Stadtbahn", "value":"3", "selected":"0" }, { "means":"Straßen-/Trambahn", "value":"4", "selected":"0" }, { "means":"Stadtbus", "value":"5", "selected":"0" }, { "means":"Regionalbus", "value":"6", "selected":"0" }, { "means":"Schnellbus", "value":"7", "selected":"0" }, { "means":"Seil-/Zahnradbahn", "value":"8", "selected":"0" }, { "means":"Schiff", "value":"9", "selected":"0" }, { "means":"AST/Rufbus", "value":"10", "selected":"0" }, { "means":"Sonstige", "value":"11", "selected":"0" }, { "means":"Flugzeug", "value":"12", "selected":"0" }, { "means":"Zug (Nahverkehr)", "value":"13", "selected":"0" }, { "means":"Zug (Fernverkehr)", "value":"14", "selected":"0" }, { "means":"Zug (Fernverkehr mit", "value":"15", "selected":"0" }, { "means":"Zug (Fernverkehr mit", "value":"16", "selected":"0" }, { "means":"Schienenersatzverkeh", "value":"17", "selected":"0" }, { "means":"Zug Shuttle", "value":"18", "selected":"0" }, { "means":"Bürgerbus", "value":"19", "selected":"0" } ], "activeImp":"-1", "activeCom":"-1", "activeSec":"-1" } }, "trips": [ { "duration":"00:21", "interchange":"2", "optValue":"0", "desc":"1", "legs": [ { "timeMinute":"5", "points": [ { "name":"Dresden Prager Straße", "nameWO":"Prager Straße", "place":"Dresden", "nameWithPlace":"Dresden Prager Straße", "usage":"departure", "omc":"14612000", "placeID":"1", "desc":"", "dateTime": { "date":"12.12.2015", "time":"07:17", "rtDate":"12.12.2015", "rtTime":"07:17" }, "stamp": { "date":"20151212", "time":"717", "rtDate":"20151212", "rtTime":"717" }, "links": [ { "name":"RM", "type":"RM", "href":"FILELOAD?Filename=VVO_566BBEFCB.pdf" } ], "ref": { "id":"33000003", "area":"1", "platform":"2", "gid":"de:14612:3", "pointGid":"de:14612:3:1:2", "NaPTANID":"", "attrs": [ ], "coords":"13.738438449,51.047138958" } }, { "name":"Dresden Gret-Palucca-Straße", "nameWO":"Gret-Palucca-Straße", "place":"Dresden", "nameWithPlace":"Dresden Gret-Palucca-Straße", "usage":"arrival", "omc":"14612000", "placeID":"1", "desc":"", "dateTime": { "date":"12.12.2015", "time":"07:22", "rtDate":"12.12.2015", "rtTime":"07:22" }, "stamp": { "date":"20151212", "time":"722", "rtDate":"20151212", "rtTime":"722" }, "links": [ { "name":"RM", "type":"RM", "href":"FILELOAD?Filename=VVO_566BBEFCC.pdf" } ], "ref": { "id":"33000030", "area":"1", "platform":"1", "gid":"de:14612:30", "pointGid":"de:14612:30:1:1", "NaPTANID":"", "attrs": [ ], "coords":"13.739795913,51.038839223" } } ], "mode": { "name":"Straßenbahn 11", "number":"11", "product":"Straßenbahn", "type":"4", "code":"4", "destination":"DD Zschertnitz Münzmeisterstr.", "destID":"33000314", "desc":"Bühlau Ullersdorfer Platz - Kongresszentrum / Haus der Presse", "timetablePeriod":"", "realtime":"0", "diva": { "branch":"11", "line":"11011", "supplement":" ", "dir":"H", "project":"j15", "network":"voe", "stateless":"voe:11011: :H:j15", "operator":"DVB", "opPublicCode":"DVB", "opCode":"16", "attrs": [ ] } }, "hints": null, "stopSeq": [ { "name":"Dresden Prager Straße", "nameWO":"Prager Straße", "place":"Dresden", "nameWithPlace":"", "omc":"14612000", "placeID":"1", "platformName":"", "desc":"", "ref": { "id":"33000003", "area":"1", "platform":"2", "gid":"de:14612:3", "pointGid":"de:14612:3:1:2", "attrs": [ ], "coords":"13.738438449,51.047138958", "depDateTime":"20151212 07:17", "arrDelay":"-1", "arrValid":"0", "depDelay":"-1", "depValid":"0" } }, { "name":"Dresden Walpurgisstraße", "nameWO":"Walpurgisstraße", "place":"Dresden", "nameWithPlace":"", "omc":"14612000", "placeID":"1", "platformName":"", "desc":"", "ref": { "id":"33000029", "area":"1", "platform":"2", "gid":"de:14612:29", "pointGid":"de:14612:29:1:2", "attrs": [ ], "coords":"13.737525351,51.043700498", "arrDateTime":"20151212 07:19", "depDateTime":"20151212 07:19", "arrDelay":"-1", "arrValid":"0", "depDelay":"-1", "depValid":"0" } }, { "name":"Dresden Hauptbahnhof Nord", "nameWO":"Hauptbahnhof Nord", "place":"Dresden", "nameWithPlace":"", "omc":"14612000", "placeID":"1", "platformName":"", "desc":"", "ref": { "id":"33000032", "area":"1", "platform":"2", "gid":"de:14612:32", "pointGid":"de:14612:32:1:2", "attrs": [ ], "coords":"13.734927611,51.041347852", "arrDateTime":"20151212 07:20", "depDateTime":"20151212 07:20", "arrDelay":"-1", "arrValid":"0", "depDelay":"-1", "depValid":"0" } }, { "name":"Dresden Gret-Palucca-Straße", "nameWO":"Gret-Palucca-Straße", "place":"Dresden", "nameWithPlace":"", "omc":"14612000", "placeID":"1", "platformName":"", "desc":"", "ref": { "id":"33000030", "area":"1", "platform":"1", "gid":"de:14612:30", "pointGid":"de:14612:30:1:1", "attrs": [ ], "coords":"13.739795913,51.038839223", "arrDateTime":"20151212 07:22", "arrDelay":"-1", "arrValid":"0", "depDelay":"-1", "depValid":"0" } } ], "footpath": [ { } ], "path":"13.738439795,51.047174896 13.739195898,51.047181620 13.739921136,51.047125870 13.740487227,51.047009560 13.740754670,51.046915677 13.740936255,51.046814084 13.741072047,51.046632266 13.741096509,51.046524025 13.741005597,51.046381544 13.740156009,51.045782905 13.738392148,51.044379807 13.737525351,51.043700498 13.737525351,51.043700498 13.737422222,51.043612135 13.736966279,51.043241349 13.736008636,51.042419544 13.735460152,51.041861343 13.735149446,51.041560309 13.734927611,51.041347852 13.734927611,51.041347852 13.734735625,51.041170909 13.734690184,51.041099667 13.734257757,51.040593675 13.734426759,51.040537227 13.734610013,51.040480567 13.734905598,51.040377290 13.735482177,51.040161961 13.736219210,51.040043131 13.738331321,51.039328496 13.739781326,51.038830451", "interchange": { "desc":"Fussweg", "type":"100", "path":"13.739795913,51.038839223 13.739870198,51.038919024 13.739405643,51.039078769 13.739345946,51.039007740" } }, { "timeMinute":"7", "points": [ { "name":"Dresden Gret-Palucca-Straße", "nameWO":"Gret-Palucca-Straße", "place":"Dresden", "nameWithPlace":"Dresden Gret-Palucca-Straße", "usage":"departure", "omc":"14612000", "placeID":"1", "desc":"", "dateTime": { "date":"12.12.2015", "time":"07:24", "rtDate":"12.12.2015", "rtTime":"07:24" }, "stamp": { "date":"20151212", "time":"724", "rtDate":"20151212", "rtTime":"724" }, "links": [ { "name":"RM", "type":"RM", "href":"FILELOAD?Filename=VVO_566BBEFCC.pdf" } ], "ref": { "id":"33000030", "area":"1", "platform":"2", "gid":"de:14612:30", "pointGid":"de:14612:30:1:2", "NaPTANID":"", "attrs": [ ], "coords":"13.739345946,51.039007740" } }, { "name":"Dresden Bahnhof Mitte", "nameWO":"Bahnhof Mitte", "place":"Dresden", "nameWithPlace":"Dresden Bahnhof Mitte", "usage":"arrival", "omc":"14612000", "placeID":"1", "desc":"", "dateTime": { "date":"12.12.2015", "time":"07:31", "rtDate":"12.12.2015", "rtTime":"07:31" }, "stamp": { "date":"20151212", "time":"731", "rtDate":"20151212", "rtTime":"731" }, "links": [ { "name":"RM", "type":"RM", "href":"FILELOAD?Filename=VVO_566BBEFCD.pdf" } ], "ref": { "id":"33000001", "area":"2", "platform":"2", "gid":"de:14612:1", "pointGid":"de:14612:1:2:2", "NaPTANID":"", "attrs": [ ], "coords":"13.722514215,51.055744273" } } ], "mode": { "name":"Straßenbahn 10", "number":"10", "product":"Straßenbahn", "type":"4", "code":"4", "destination":"Dresden Messe Gleisschleife", "destID":"33000523", "desc":"%Betriebshof Reick%85 - %Wölfnitz%85", "timetablePeriod":"", "realtime":"0", "diva": { "branch":"11", "line":"11010", "supplement":" ", "dir":"H", "project":"j15", "network":"voe", "stateless":"voe:11010: :H:j15", "operator":"DVB", "opPublicCode":"DVB", "opCode":"16", "attrs": [ ] } }, "hints": null, "stopSeq": [ { "name":"Dresden Gret-Palucca-Straße", "nameWO":"Gret-Palucca-Straße", "place":"Dresden", "nameWithPlace":"", "omc":"14612000", "placeID":"1", "platformName":"", "desc":"", "ref": { "id":"33000030", "area":"1", "platform":"2", "gid":"de:14612:30", "pointGid":"de:14612:30:1:2", "attrs": [ ], "coords":"13.739345946,51.039007740", "depDateTime":"20151212 07:24", "arrDelay":"-1", "arrValid":"0", "depDelay":"-1", "depValid":"0" } }, { "name":"Dresden Hauptbahnhof", "nameWO":"Hauptbahnhof", "place":"Dresden", "nameWithPlace":"", "omc":"14612000", "placeID":"1", "platformName":"2", "desc":"", "ref": { "id":"33000028", "area":"3", "platform":"2", "gid":"de:14612:28", "pointGid":"de:14612:28:3:2", "attrs": [ ], "coords":"13.732905385,51.041036264", "arrDateTime":"20151212 07:26", "depDateTime":"20151212 07:26", "arrDelay":"-1", "arrValid":"0", "depDelay":"-1", "depValid":"0" } }, { "name":"Dresden Budapester Straße", "nameWO":"Budapester Straße", "place":"Dresden", "nameWithPlace":"", "omc":"14612000", "placeID":"1", "platformName":"", "desc":"", "ref": { "id":"33000027", "area":"1", "platform":"2", "gid":"de:14612:27", "pointGid":"de:14612:27:1:2", "attrs": [ ], "coords":"13.724920883,51.043743488", "arrDateTime":"20151212 07:27", "depDateTime":"20151212 07:27", "arrDelay":"-1", "arrValid":"0", "depDelay":"-1", "depValid":"0" } }, { "name":"Dresden Hp Freiberger Straße", "nameWO":"Hp Freiberger Straße", "place":"Dresden", "nameWithPlace":"", "omc":"14612000", "placeID":"1", "platformName":"", "desc":"", "ref": { "id":"33000025", "area":"2", "platform":"4", "gid":"de:14612:25", "pointGid":"de:14612:25:2:4", "attrs": [ ], "coords":"13.720434571,51.048897819", "arrDateTime":"20151212 07:29", "depDateTime":"20151212 07:29", "arrDelay":"-1", "arrValid":"0", "depDelay":"-1", "depValid":"0" } }, { "name":"Dresden Bahnhof Mitte", "nameWO":"Bahnhof Mitte", "place":"Dresden", "nameWithPlace":"", "omc":"14612000", "placeID":"1", "platformName":"", "desc":"", "ref": { "id":"33000001", "area":"2", "platform":"2", "gid":"de:14612:1", "pointGid":"de:14612:1:2:2", "attrs": [ ], "coords":"13.722514215,51.055744273", "arrDateTime":"20151212 07:31", "arrDelay":"-1", "arrValid":"0", "depDelay":"-1", "depValid":"0" } } ], "footpath": [ { } ], "path":"13.739331022,51.038989983 13.738331321,51.039328496 13.736219210,51.040043131 13.735482177,51.040161961 13.734905598,51.040377290 13.734610013,51.040480567 13.734426759,51.040537227 13.734257757,51.040593675 13.733553575,51.040828872 13.732905721,51.041045249 13.732905721,51.041045249 13.732243609,51.041261834 13.725484635,51.043564357 13.725174756,51.043667821 13.725019983,51.043724046 13.724935470,51.043752263 13.724935470,51.043752263 13.724668345,51.043855094 13.723908389,51.044127014 13.722470048,51.044948317 13.721942521,51.045720219 13.721602602,51.046552281 13.721286180,51.047249150 13.720726506,51.048309189 13.720567784,51.048644146 13.720420317,51.048898029 13.720420317,51.048898029 13.720380552,51.048979522 13.720221493,51.049305493 13.720245408,51.051489633 13.720397617,51.051748092 13.722120294,51.053970126 13.722356054,51.054173413 13.723488781,51.055100621 13.723433426,51.055146386 13.723127804,51.055366647 13.722862611,51.055523383 13.722484702,51.055717740", "interchange": { "desc":"Fussweg", "type":"100", "path":"13.722514215,51.055744273 13.722484702,51.055717740 13.722862611,51.055523383 13.722890789,51.055513978 13.722876200,51.055505203" } }, { "timeMinute":"4", "points": [ { "name":"Dresden Bahnhof Mitte", "nameWO":"Bahnhof Mitte", "place":"Dresden", "nameWithPlace":"Dresden Bahnhof Mitte", "usage":"departure", "omc":"14612000", "placeID":"1", "desc":"", "dateTime": { "date":"12.12.2015", "time":"07:34", "rtDate":"12.12.2015", "rtTime":"07:34" }, "stamp": { "date":"20151212", "time":"734", "rtDate":"20151212", "rtTime":"734" }, "links": [ { "name":"RM", "type":"RM", "href":"FILELOAD?Filename=VVO_566BBEFCD.pdf" } ], "ref": { "id":"33000001", "area":"2", "platform":"1", "gid":"de:14612:1", "pointGid":"de:14612:1:2:1", "NaPTANID":"", "attrs": [ ], "coords":"13.722876200,51.055505203" } }, { "name":"Dresden Postplatz", "nameWO":"Postplatz", "place":"Dresden", "nameWithPlace":"Dresden Postplatz", "usage":"arrival", "omc":"14612000", "placeID":"1", "desc":"", "dateTime": { "date":"12.12.2015", "time":"07:38", "rtDate":"12.12.2015", "rtTime":"07:38" }, "stamp": { "date":"20151212", "time":"738", "rtDate":"20151212", "rtTime":"738" }, "links": [ { "name":"RM", "type":"RM", "href":"FILELOAD?Filename=VVO_566BBEFCE.pdf" } ], "ref": { "id":"33000037", "area":"7", "platform":"8", "gid":"de:14612:37", "pointGid":"de:14612:37:7:8", "NaPTANID":"", "attrs": [ ], "coords":"13.732537043,51.049887592" } } ], "mode": { "name":"Stadtbus 94", "number":"94", "product":"Stadtbus", "type":"3", "code":"5", "destination":"Dresden Postplatz", "destID":"33000037", "desc":"Niederwartha - Betriebshof Gruna", "timetablePeriod":"", "realtime":"0", "diva": { "branch":"21", "line":"21094", "supplement":" ", "dir":"R", "project":"j15", "network":"voe", "stateless":"voe:21094: :R:j15", "operator":"DVB", "opPublicCode":"DVB", "opCode":"16", "attrs": [ ] } }, "hints": null, "stopSeq": [ { "name":"Dresden Bahnhof Mitte", "nameWO":"Bahnhof Mitte", "place":"Dresden", "nameWithPlace":"", "omc":"14612000", "placeID":"1", "platformName":"", "desc":"", "ref": { "id":"33000001", "area":"2", "platform":"1", "gid":"de:14612:1", "pointGid":"de:14612:1:2:1", "attrs": [ ], "coords":"13.722876200,51.055505203", "depDateTime":"20151212 07:34", "arrDelay":"-1", "arrValid":"0", "depDelay":"-1", "depValid":"0" } }, { "name":"Dresden Schweriner Straße", "nameWO":"Schweriner Straße", "place":"Dresden", "nameWithPlace":"", "omc":"14612000", "placeID":"1", "platformName":"", "desc":"", "ref": { "id":"33000023", "area":"1", "platform":"1", "gid":"de:14612:23", "pointGid":"de:14612:23:1:1", "attrs": [ ], "coords":"13.726187794,51.052885264", "arrDateTime":"20151212 07:36", "depDateTime":"20151212 07:36", "arrDelay":"-1", "arrValid":"0", "depDelay":"-1", "depValid":"0" } }, { "name":"Dresden Postplatz", "nameWO":"Postplatz", "place":"Dresden", "nameWithPlace":"", "omc":"14612000", "placeID":"1", "platformName":"Marienstr.", "desc":"", "ref": { "id":"33000037", "area":"7", "platform":"8", "gid":"de:14612:37", "pointGid":"de:14612:37:7:8", "attrs": [ ], "coords":"13.732537043,51.049887592", "arrDateTime":"20151212 07:38", "arrDelay":"-1", "arrValid":"0", "depDelay":"-1", "depValid":"0" } } ], "path":"13.722890789,51.055513978 13.723127804,51.055366647 13.723433426,51.055146386 13.723488781,51.055100621 13.723530214,51.055064051 13.723818239,51.054754152 13.724290147,51.054019023 13.723606116,51.053651552 13.724678178,51.053330078 13.725397853,51.053121677 13.726187794,51.052885264 13.726187794,51.052885264 13.727006237,51.052648424 13.727203802,51.052591565 13.727443129,51.052507119 13.728204874,51.052280098 13.728543313,51.052176204 13.728924181,51.052062691 13.728997324,51.051728990 13.729106869,51.051223946 13.729152840,51.050926606 13.729162407,51.050800608 13.730805033,51.050866177 13.732419824,51.050950114 13.732353079,51.050690403 13.732316856,51.050484177 13.732444642,51.050086736 13.732483715,51.049987270 13.732522788,51.049887803" } ], "itdFare": { "fares": { "fare": { "net":"voe", "toPR":"2", "fromPR":"0", "currency":"EUR", "unitName":"Preisstufe", "fareAdult":"2.30", "fareChild":"1.60", "unitsAdult":"1", "unitsChild":"1", "fareBikeAdult":"", "fareBikeChild":"", "unitsBikeAdult":"", "unitsBikeChild":"", "levelAdult":"", "levelChild":"", "idChild":"", "note":"" } }, "tickets": { "ticket": { "net":"voe", "toPR":"2", "fromPR":"0", "currency":"Euro", "weekAdult":"", "weekChild":"", "monthAdult":"", "monthChild":"", "weekEducation":"", "monthEducation":"", "yearAdults":"", "yearChildren":"", "yearStudents":"", "dayAdults":"", "dayChildren":"", "dayStudents":"", "levelAdult":"1", "levelChild":"1", "genericTickets": null } }, "tariffZones": { "tariffZone": { "net":"voe", "toPR":"2", "fromPR":"0", "neutralZone":"", "zones": { "zone": { "zoneElems": { "zoneElem": { "zone":"10" } } } } } }, "specialTickets": null }, "attrs": [ { "name":"JourneyDeparture", "value":"elapsed" } ] }, { "duration":"00:02", "interchange":"0", "optValue":"0", "desc":"2", "legs": [ { "timeMinute":"2", "points": [ { "name":"Dresden Prager Straße", "nameWO":"Prager Straße", "place":"Dresden", "nameWithPlace":"Dresden Prager Straße", "usage":"departure", "omc":"14612000", "placeID":"1", "desc":"", "dateTime": { "date":"12.12.2015", "time":"07:37", "rtDate":"12.12.2015", "rtTime":"07:37" }, "stamp": { "date":"20151212", "time":"737", "rtDate":"20151212", "rtTime":"737" }, "links": [ { "name":"RM", "type":"RM", "href":"FILELOAD?Filename=VVO_566BBEFC10.pdf" } ], "ref": { "id":"33000003", "area":"1", "platform":"1", "gid":"de:14612:3", "pointGid":"de:14612:3:1:1", "NaPTANID":"", "attrs": [ ], "coords":"13.737354519,51.047137106" } }, { "name":"Dresden Postplatz", "nameWO":"Postplatz", "place":"Dresden", "nameWithPlace":"Dresden Postplatz", "usage":"arrival", "omc":"14612000", "placeID":"1", "desc":"", "dateTime": { "date":"12.12.2015", "time":"07:39", "rtDate":"12.12.2015", "rtTime":"07:39" }, "stamp": { "date":"20151212", "time":"739", "rtDate":"20151212", "rtTime":"739" }, "links": [ { "name":"RM", "type":"RM", "href":"FILELOAD?Filename=VVO_566BBEFC11.pdf" } ], "ref": { "id":"33000037", "area":"3", "platform":"4", "gid":"de:14612:37", "pointGid":"de:14612:37:3:4", "NaPTANID":"", "attrs": [ ], "coords":"13.733716812,51.050544314" } } ], "mode": { "name":"Straßenbahn 12", "number":"12", "product":"Straßenbahn", "type":"4", "code":"4", "destination":"Dresden Leutewitz", "destID":"33000191", "desc":"%Betriebshof Reick%85 - Postplatz / Webergasse", "timetablePeriod":"", "realtime":"0", "diva": { "branch":"11", "line":"11012", "supplement":" ", "dir":"H", "project":"j15", "network":"voe", "stateless":"voe:11012: :H:j15", "operator":"DVB", "opPublicCode":"DVB", "opCode":"16", "attrs": [ ] } }, "hints": null, "stopSeq": [ { "name":"Dresden Prager Straße", "nameWO":"Prager Straße", "place":"Dresden", "nameWithPlace":"", "omc":"14612000", "placeID":"1", "platformName":"", "desc":"", "ref": { "id":"33000003", "area":"1", "platform":"1", "gid":"de:14612:3", "pointGid":"de:14612:3:1:1", "attrs": [ ], "coords":"13.737354519,51.047137106", "depDateTime":"20151212 07:37", "arrDelay":"-1", "arrValid":"0", "depDelay":"-1", "depValid":"0" } }, { "name":"Dresden Postplatz", "nameWO":"Postplatz", "place":"Dresden", "nameWithPlace":"", "omc":"14612000", "placeID":"1", "platformName":"", "desc":"", "ref": { "id":"33000037", "area":"3", "platform":"4", "gid":"de:14612:37", "pointGid":"de:14612:37:3:4", "attrs": [ ], "coords":"13.733716812,51.050544314", "arrDateTime":"20151212 07:39", "arrDelay":"-1", "arrValid":"0", "depDelay":"-1", "depValid":"0" } } ], "path":"13.737354855,51.047146091 13.736854978,51.047126556 13.735927499,51.047113375 13.735026177,51.047036870 13.734926403,51.047038352 13.734827973,51.047075772 13.734743311,51.047481566 13.734705252,51.047607987 13.734446708,51.048322013 13.734315586,51.048629610 13.734136847,51.049189624 13.734020982,51.049523963 13.733826639,51.050048250 13.733761074,51.050202048 13.733716812,51.050544314" } ], "itdFare": { "fares": { "fare": { "net":"voe", "toPR":"0", "fromPR":"0", "currency":"EUR", "unitName":"Preisstufe", "fareAdult":"2.30", "fareChild":"1.60", "unitsAdult":"1", "unitsChild":"1", "fareBikeAdult":"", "fareBikeChild":"", "unitsBikeAdult":"", "unitsBikeChild":"", "levelAdult":"", "levelChild":"", "idChild":"", "note":"" } }, "tickets": { "ticket": { "net":"voe", "toPR":"0", "fromPR":"0", "currency":"Euro", "weekAdult":"", "weekChild":"", "monthAdult":"", "monthChild":"", "weekEducation":"", "monthEducation":"", "yearAdults":"", "yearChildren":"", "yearStudents":"", "dayAdults":"", "dayChildren":"", "dayStudents":"", "levelAdult":"1", "levelChild":"1", "genericTickets": null } }, "tariffZones": { "tariffZone": { "net":"voe", "toPR":"0", "fromPR":"0", "neutralZone":"", "zones": { "zone": { "zoneElems": { "zoneElem": { "zone":"10" } } } } } }, "specialTickets": null }, "attrs": [ { "name":"JourneyDeparture", "value":"soon" } ] }, { "duration":"00:03", "interchange":"0", "optValue":"0", "desc":"2", "legs": [ { "timeMinute":"3", "points": [ { "name":"Dresden Prager Straße", "nameWO":"Prager Straße", "place":"Dresden", "nameWithPlace":"Dresden Prager Straße", "usage":"departure", "omc":"14612000", "placeID":"1", "desc":"", "dateTime": { "date":"12.12.2015", "time":"07:38", "rtDate":"12.12.2015", "rtTime":"07:38" }, "stamp": { "date":"20151212", "time":"738", "rtDate":"20151212", "rtTime":"738" }, "links": [ { "name":"RM", "type":"RM", "href":"FILELOAD?Filename=VVO_566BBEFC13.pdf" } ], "ref": { "id":"33000003", "area":"1", "platform":"1", "gid":"de:14612:3", "pointGid":"de:14612:3:1:1", "NaPTANID":"", "attrs": [ ], "coords":"13.737354519,51.047137106" } }, { "name":"Dresden Postplatz", "nameWO":"Postplatz", "place":"Dresden", "nameWithPlace":"Dresden Postplatz", "usage":"arrival", "omc":"14612000", "placeID":"1", "desc":"", "dateTime": { "date":"12.12.2015", "time":"07:41", "rtDate":"12.12.2015", "rtTime":"07:41" }, "stamp": { "date":"20151212", "time":"741", "rtDate":"20151212", "rtTime":"741" }, "links": [ { "name":"RM", "type":"RM", "href":"FILELOAD?Filename=VVO_566BBEFC14.pdf" } ], "ref": { "id":"33000037", "area":"3", "platform":"3", "gid":"de:14612:37", "pointGid":"de:14612:37:3:3", "NaPTANID":"", "attrs": [ ], "coords":"13.733790926,51.050237564" } } ], "mode": { "name":"Stadtbus 62", "number":"62", "product":"Stadtbus", "type":"3", "code":"5", "destination":"Dresden Dölzschen", "destID":"33000709", "desc":"%Kretschmerstraße%85 - Postplatz (DVB-Service)", "timetablePeriod":"", "realtime":"0", "diva": { "branch":"21", "line":"21062", "supplement":" ", "dir":"H", "project":"j15", "network":"voe", "stateless":"voe:21062: :H:j15", "operator":"DVB", "opPublicCode":"DVB", "opCode":"16", "attrs": [ ] } }, "hints": null, "stopSeq": [ { "name":"Dresden Prager Straße", "nameWO":"Prager Straße", "place":"Dresden", "nameWithPlace":"", "omc":"14612000", "placeID":"1", "platformName":"", "desc":"", "ref": { "id":"33000003", "area":"1", "platform":"1", "gid":"de:14612:3", "pointGid":"de:14612:3:1:1", "attrs": [ ], "coords":"13.737354519,51.047137106", "depDateTime":"20151212 07:38", "arrDelay":"-1", "arrValid":"0", "depDelay":"-1", "depValid":"0" } }, { "name":"Dresden Postplatz", "nameWO":"Postplatz", "place":"Dresden", "nameWithPlace":"", "omc":"14612000", "placeID":"1", "platformName":"", "desc":"", "ref": { "id":"33000037", "area":"3", "platform":"3", "gid":"de:14612:37", "pointGid":"de:14612:37:3:3", "attrs": [ ], "coords":"13.733790926,51.050237564", "arrDateTime":"20151212 07:41", "arrDelay":"-1", "arrValid":"0", "depDelay":"-1", "depValid":"0" } } ], "path":"13.737354855,51.047146091 13.736854978,51.047126556 13.735927499,51.047113375 13.735026177,51.047036870 13.734926403,51.047038352 13.734827973,51.047075772 13.734324740,51.046966380 13.733550360,51.046852020 13.733604866,51.047165850 13.733527400,51.047382752 13.733396274,51.047690348 13.733227084,51.048124364 13.733084384,51.048504049 13.732758566,51.049326945 13.732614182,51.049661705 13.732483715,51.049987270 13.732444642,51.050086736 13.732316856,51.050484177 13.732353079,51.050690403 13.732419824,51.050950114 13.733156701,51.050822317 13.733681433,51.050742612 13.733762417,51.050237987" } ], "itdFare": { "fares": { "fare": { "net":"voe", "toPR":"0", "fromPR":"0", "currency":"EUR", "unitName":"Preisstufe", "fareAdult":"2.30", "fareChild":"1.60", "unitsAdult":"1", "unitsChild":"1", "fareBikeAdult":"", "fareBikeChild":"", "unitsBikeAdult":"", "unitsBikeChild":"", "levelAdult":"", "levelChild":"", "idChild":"", "note":"" } }, "tickets": { "ticket": { "net":"voe", "toPR":"0", "fromPR":"0", "currency":"Euro", "weekAdult":"", "weekChild":"", "monthAdult":"", "monthChild":"", "weekEducation":"", "monthEducation":"", "yearAdults":"", "yearChildren":"", "yearStudents":"", "dayAdults":"", "dayChildren":"", "dayStudents":"", "levelAdult":"1", "levelChild":"1", "genericTickets": null } }, "tariffZones": { "tariffZone": { "net":"voe", "toPR":"0", "fromPR":"0", "neutralZone":"", "zones": { "zone": { "zoneElems": { "zoneElem": { "zone":"10" } } } } } }, "specialTickets": null }, "attrs": [ { "name":"JourneyDeparture", "value":"soon" } ] }, { "duration":"00:02", "interchange":"0", "optValue":"0", "desc":"2", "legs": [ { "timeMinute":"2", "points": [ { "name":"Dresden Prager Straße", "nameWO":"Prager Straße", "place":"Dresden", "nameWithPlace":"Dresden Prager Straße", "usage":"departure", "omc":"14612000", "placeID":"1", "desc":"", "dateTime": { "date":"12.12.2015", "time":"07:40", "rtDate":"12.12.2015", "rtTime":"07:40" }, "stamp": { "date":"20151212", "time":"740", "rtDate":"20151212", "rtTime":"740" }, "links": [ { "name":"RM", "type":"RM", "href":"FILELOAD?Filename=VVO_566BBEFD1.pdf" } ], "ref": { "id":"33000003", "area":"1", "platform":"1", "gid":"de:14612:3", "pointGid":"de:14612:3:1:1", "NaPTANID":"", "attrs": [ ], "coords":"13.737354519,51.047137106" } }, { "name":"Dresden Postplatz", "nameWO":"Postplatz", "place":"Dresden", "nameWithPlace":"Dresden Postplatz", "usage":"arrival", "omc":"14612000", "placeID":"1", "desc":"", "dateTime": { "date":"12.12.2015", "time":"07:42", "rtDate":"12.12.2015", "rtTime":"07:42" }, "stamp": { "date":"20151212", "time":"742", "rtDate":"20151212", "rtTime":"742" }, "links": [ { "name":"RM", "type":"RM", "href":"FILELOAD?Filename=VVO_566BBEFD2.pdf" } ], "ref": { "id":"33000037", "area":"3", "platform":"4", "gid":"de:14612:37", "pointGid":"de:14612:37:3:4", "NaPTANID":"", "attrs": [ ], "coords":"13.733716812,51.050544314" } } ], "mode": { "name":"Straßenbahn 11", "number":"11", "product":"Straßenbahn", "type":"4", "code":"4", "destination":"Dresden Bühlau Ullersdorfer Platz", "destID":"33000302", "desc":"Betriebshof Gorbitz - %Tolkewitz/Urnenhain%85", "timetablePeriod":"", "realtime":"0", "diva": { "branch":"11", "line":"11011", "supplement":" ", "dir":"R", "project":"j15", "network":"voe", "stateless":"voe:11011: :R:j15", "operator":"DVB", "opPublicCode":"DVB", "opCode":"16", "attrs": [ ] } }, "hints": null, "stopSeq": [ { "name":"Dresden Prager Straße", "nameWO":"Prager Straße", "place":"Dresden", "nameWithPlace":"", "omc":"14612000", "placeID":"1", "platformName":"", "desc":"", "ref": { "id":"33000003", "area":"1", "platform":"1", "gid":"de:14612:3", "pointGid":"de:14612:3:1:1", "attrs": [ ], "coords":"13.737354519,51.047137106", "depDateTime":"20151212 07:40", "arrDelay":"-1", "arrValid":"0", "depDelay":"-1", "depValid":"0" } }, { "name":"Dresden Postplatz", "nameWO":"Postplatz", "place":"Dresden", "nameWithPlace":"", "omc":"14612000", "placeID":"1", "platformName":"", "desc":"", "ref": { "id":"33000037", "area":"3", "platform":"4", "gid":"de:14612:37", "pointGid":"de:14612:37:3:4", "attrs": [ ], "coords":"13.733716812,51.050544314", "arrDateTime":"20151212 07:42", "arrDelay":"-1", "arrValid":"0", "depDelay":"-1", "depValid":"0" } } ], "path":"13.737354855,51.047146091 13.736854978,51.047126556 13.735927499,51.047113375 13.735026177,51.047036870 13.734926403,51.047038352 13.734827973,51.047075772 13.734743311,51.047481566 13.734705252,51.047607987 13.734446708,51.048322013 13.734315586,51.048629610 13.734136847,51.049189624 13.734020982,51.049523963 13.733826639,51.050048250 13.733761074,51.050202048 13.733716812,51.050544314" } ], "itdFare": { "fares": { "fare": { "net":"voe", "toPR":"0", "fromPR":"0", "currency":"EUR", "unitName":"Preisstufe", "fareAdult":"2.30", "fareChild":"1.60", "unitsAdult":"1", "unitsChild":"1", "fareBikeAdult":"", "fareBikeChild":"", "unitsBikeAdult":"", "unitsBikeChild":"", "levelAdult":"", "levelChild":"", "idChild":"", "note":"" } }, "tickets": { "ticket": { "net":"voe", "toPR":"0", "fromPR":"0", "currency":"Euro", "weekAdult":"", "weekChild":"", "monthAdult":"", "monthChild":"", "weekEducation":"", "monthEducation":"", "yearAdults":"", "yearChildren":"", "yearStudents":"", "dayAdults":"", "dayChildren":"", "dayStudents":"", "levelAdult":"1", "levelChild":"1", "genericTickets": null } }, "tariffZones": { "tariffZone": { "net":"voe", "toPR":"0", "fromPR":"0", "neutralZone":"", "zones": { "zone": { "zoneElems": { "zoneElem": { "zone":"10" } } } } } }, "specialTickets": null }, "attrs": [ { "name":"JourneyDeparture", "value":"soon" } ] }, { "duration":"00:07", "interchange":"0", "optValue":"-1", "desc":"-1", "legs": [ { "timeMinute":"7", "points": [ { "name":"Dresden, Prager Straße", "nameWO":"Prager Straße", "place":"Dresden", "nameWithPlace":"Dresden, Prager Straße", "usage":"departure", "omc":"14612000", "placeID":"1", "desc":"", "dateTime": { "date":"12.12.2015", "time":"07:30", "rtDate":"12.12.2015", "rtTime":"07:30" }, "stamp": { "date":"20151212", "time":"730", "rtDate":"20151212", "rtTime":"730" }, "links": [ { "name":"RM", "type":"RM", "href":"FILELOAD?Filename=VVO_566BBEFC9.pdf" } ], "ref": { "id":"33000003", "area":"", "platform":"", "NaPTANID":"", "attrs": [ ], "coords":"13.737203112,51.047283193" } }, { "name":"Dresden, Postplatz", "nameWO":"Postplatz", "place":"Dresden", "nameWithPlace":"Dresden, Postplatz", "usage":"arrival", "omc":"14612000", "placeID":"1", "desc":"", "dateTime": { "date":"12.12.2015", "time":"07:37", "rtDate":"12.12.2015", "rtTime":"07:37" }, "stamp": { "date":"20151212", "time":"737", "rtDate":"20151212", "rtTime":"737" }, "links": [ { "name":"RM", "type":"RM", "href":"FILELOAD?Filename=VVO_566BBEFC9.pdf" } ], "ref": { "id":"33000037", "area":"", "platform":"", "NaPTANID":"", "attrs": [ ], "coords":"13.733690452,51.049456952" } } ], "mode": { "name":"", "number":"", "product":"Fussweg", "type":"100", "code":"-1", "destination":"", "destID":"-1", "desc":"", "timetablePeriod":"", "realtime":"0", "diva": { "branch":"", "line":"", "supplement":" ", "dir":" ", "project":"", "network":"", "stateless":":: : :", "operator":"", "opCode":"", "attrs": [ ] } }, "hints": null, "path":"13.737203112,51.047283193 13.737203112,51.047283193 13.737074495,51.047276116 13.736831515,51.047261750 13.736145669,51.047226998 13.736058330,51.047560915 13.734743311,51.047481566 13.734705252,51.047607987 13.734446708,51.048322013 13.734315586,51.048629610 13.734136847,51.049189624 13.734020982,51.049523963 13.733690787,51.049465937 13.733690452,51.049456952", "turnInst": [ { "dir":"STRAIGHT", "manoeuvre":"ORIGIN", "name":"Dr.-Külz-Ring", "dirHint":"", "place":"", "tTime":"66", "ctTime":"66", "dis":"74", "cDis":"74", "fPLIdx":"0", "tPLIdx":"2", "fPCIdx":"0", "tPCIdx":"3", "attrs": [ ], "coords":"13.737203112,51.047283193" }, { "dir":"RIGHT", "manoeuvre":"TURN", "name":"Webergasse", "dirHint":"", "place":"", "tTime":"33", "ctTime":"99", "dis":"38", "cDis":"112", "fPLIdx":"3", "tPLIdx":"3", "fPCIdx":"3", "tPCIdx":"4", "attrs": [ ], "coords":"13.736145669,51.047226998" }, { "dir":"LEFT", "manoeuvre":"TURN", "name":"Dr.-Külz-Ring", "dirHint":"", "place":"", "tTime":"82", "ctTime":"181", "dis":"93", "cDis":"205", "fPLIdx":"4", "tPLIdx":"4", "fPCIdx":"4", "tPCIdx":"5", "attrs": [ ], "coords":"13.736058330,51.047560915" }, { "dir":"RIGHT", "manoeuvre":"TURN", "name":"Wallstraße", "dirHint":"", "place":"", "tTime":"206", "ctTime":"387", "dis":"232", "cDis":"437", "fPLIdx":"5", "tPLIdx":"9", "fPCIdx":"5", "tPCIdx":"10", "attrs": [ ], "coords":"13.734743311,51.047481566" }, { "dir":"LEFT", "manoeuvre":"DESTINATION", "name":"Antonsplatz", "dirHint":"", "place":"", "tTime":"21", "ctTime":"408", "dis":"24", "cDis":"461", "fPLIdx":"10", "tPLIdx":"10", "fPCIdx":"10", "tPCIdx":"11", "attrs": [ ], "coords":"13.733690787,51.049465937" } ] } ], "itdFare": { "fares": null, "tickets": null, "tariffZones": null, "specialTickets": null }, "attrs": [ ] } ] } +{ "parameters": [ { "name":"serverID", "value":"efa.vvo-online.de:8080" }, { "name":"requestID", "value":"1" }, { "name":"sessionID", "value":"4073250361" } ], "itdMessageList": [ ], "origin": { "input": { "input":"pragerstrasse" }, "points": { "point": { "usage":"origin", "type":"stop", "name":"Dresden, Prager Straße", "stateless":"33000003", "ref": { "id":"33000003", "omc":"14612000", "placeID":"1", "place":"Dresden", "coords":"13.737825553,51.047148078" }, "infos": null } } }, "destination": { "input": { "input":"postplatz" }, "points": { "point": { "usage":"destination", "type":"stop", "name":"Dresden, Postplatz", "stateless":"33000037", "ref": { "id":"33000037", "omc":"14612000", "placeID":"1", "place":"Dresden", "coords":"13.733513736,51.050834998" }, "infos": null } } }, "via": { "input": { "input":"" }, "points": null }, "dateTime": { "deparr":"dep", "ttpFrom":"20161211", "ttpTo":"20171209", "year":"2017", "month":"2", "day":"16", "hour":"17", "minute":"25" }, "dateRange": [ { "day":"16", "month":"02", "year":"2017", "weekday":"5" }, { "day":"17", "month":"02", "year":"2017", "weekday":"6" }, { "day":"18", "month":"02", "year":"2017", "weekday":"7" }, { "day":"19", "month":"02", "year":"2017", "weekday":"1" }, { "day":"20", "month":"02", "year":"2017", "weekday":"2" }, { "day":"21", "month":"02", "year":"2017", "weekday":"3" }, { "day":"22", "month":"02", "year":"2017", "weekday":"4" }, { "day":"23", "month":"02", "year":"2017", "weekday":"5" }, { "day":"24", "month":"02", "year":"2017", "weekday":"6" }, { "day":"25", "month":"02", "year":"2017", "weekday":"7" }, { "day":"26", "month":"02", "year":"2017", "weekday":"1" }, { "day":"27", "month":"02", "year":"2017", "weekday":"2" }, { "day":"28", "month":"02", "year":"2017", "weekday":"3" }, { "day":"01", "month":"03", "year":"2017", "weekday":"4" }, { "day":"02", "month":"03", "year":"2017", "weekday":"5" } ], "option": { "ptOption": { "active":"1", "maxChanges":"9", "maxTime":"360", "maxWait":"120", "routeType":"LEASTTIME", "changeSpeed":"normal", "lineRestriction":"400", "useProxFootSearch":"0", "useProxFootSearchOrigin":"0", "useProxFootSearchDestination":"0", "bike":"0", "plane":"0", "noCrowded":"0", "noSolidStairs":"0", "noEscalators":"0", "noElevators":"0", "lowPlatformVhcl":"0", "wheelchair":"0", "needElevatedPlt":"0", "assistance":"0", "SOSAvail":"0", "noLonelyTransfer":"0", "illumTransfer":"0", "noInsecurePlaces":"0", "privateTransport":"0", "excludedMeans": [ { "means":"Zug", "value":"0", "selected":"0" }, { "means":"S-Bahn", "value":"1", "selected":"0" }, { "means":"U-Bahn", "value":"2", "selected":"0" }, { "means":"Stadtbahn", "value":"3", "selected":"0" }, { "means":"Straßen-/Trambahn", "value":"4", "selected":"0" }, { "means":"Stadtbus", "value":"5", "selected":"0" }, { "means":"Regionalbus", "value":"6", "selected":"0" }, { "means":"Schnellbus", "value":"7", "selected":"0" }, { "means":"Seil-/Zahnradbahn", "value":"8", "selected":"0" }, { "means":"Schiff", "value":"9", "selected":"0" }, { "means":"AST/Rufbus", "value":"10", "selected":"0" }, { "means":"Sonstige", "value":"11", "selected":"0" }, { "means":"Flugzeug", "value":"12", "selected":"0" }, { "means":"Zug (Nahverkehr)", "value":"13", "selected":"0" }, { "means":"Zug (Fernverkehr)", "value":"14", "selected":"0" }, { "means":"Zug (Fernverkehr mit", "value":"15", "selected":"0" }, { "means":"Zug (Fernverkehr mit", "value":"16", "selected":"0" }, { "means":"Schienenersatzverkeh", "value":"17", "selected":"0" }, { "means":"Zug Shuttle", "value":"18", "selected":"0" }, { "means":"Bürgerbus", "value":"19", "selected":"0" } ], "activeImp":"-1", "activeCom":"-1", "activeSec":"-1" }, "itOption": { "active":"1", "itRouter": { "logASCII":"0", "logSVG":"0" }, "pedestrian": { "computeMonomodalTrip":"0", "computationType":"PT_AND_IT", "useElevation":"0", "speedFactor":"100", "speedFactor":"0", "distanceFactor":"50", "traveltimeFactor":"50", "noTunnel":"0", "noBridge":"0", "noFerry":"0", "maxTime":"30", "minTime":"0", "maxLength":"2147483647", "minLength":"0", "ignoreRestrictions":"0", "computeAlternativeRoutes":"0", "level":"connection" }, "itBicycle": { "computeMonomodalTrip":"0", "computationType":"PT_AND_IT", "useElevation":"0", "speedFactor":"100", "speedFactor":"0", "distanceFactor":"50", "traveltimeFactor":"50", "noTunnel":"0", "noBridge":"0", "noFerry":"0", "maxTime":"120", "minTime":"0", "maxLength":"2147483647", "minLength":"0", "ignoreRestrictions":"0", "computeAlternativeRoutes":"0", "level":"unknown" }, "mitCar": { "computeMonomodalTrip":"0", "computationType":"PT_AND_IT", "useElevation":"0", "speedFactor":"100", "speedFactor":"0", "distanceFactor":"10", "traveltimeFactor":"90", "noTunnel":"0", "noBridge":"0", "noFerry":"0", "maxTime":"120", "minTime":"0", "maxLength":"2147483647", "minLength":"0", "ignoreRestrictions":"0", "computeAlternativeRoutes":"0", "level":"unknown", "mitProfileData":"0", "mitIncidentData":"0", "mitOnlineData":"0", "noHighway":"0", "noTollRoad":"0", "prefSerSt":"0" }, "mitTaxi": { "computeMonomodalTrip":"0", "computationType":"PT_AND_IT", "useElevation":"0", "speedFactor":"100", "speedFactor":"0", "distanceFactor":"10", "traveltimeFactor":"90", "noTunnel":"0", "noBridge":"0", "noFerry":"0", "maxTime":"5", "minTime":"0", "maxLength":"2147483647", "minLength":"0", "ignoreRestrictions":"0", "computeAlternativeRoutes":"0", "level":"unknown", "mitProfileData":"0", "mitIncidentData":"0", "mitOnlineData":"0", "noHighway":"0", "noTollRoad":"0", "prefSerSt":"0" } }, "departureTransport": { "meansCode":"100", "value":"15", "speed":"normal" }, "arrivalTransport": { "meansCode":"100", "value":"15", "speed":"normal" } }, "trips": [ { "distance":"0", "duration":"00:02", "interchange":"0", "desc":"1", "optValue":"0", "legs": [ { "timeMinute":"2", "points": [ { "name":"Dresden Prager Straße", "nameWO":"Prager Straße", "platformName":"", "place":"Dresden", "nameWithPlace":"Dresden Prager Straße", "usage":"departure", "omc":"14612000", "placeID":"1", "desc":"", "dateTime": { "date":"16.02.2017", "time":"17:21", "rtDate":"16.02.2017", "rtTime":"17:21" }, "stamp": { "date":"20170216", "time":"1721", "rtDate":"20170216", "rtTime":"1721" }, "links": [ { "type":"RM", "href":"FILELOAD?Filename=VVO_58A5D26D6.pdf" } ], "ref": { "id":"33000003", "area":"1", "platform":"1", "gid":"de:14612:3", "pointGid":"de:14612:3:1:1", "NaPTANID":"", "attrs": [ ], "coords":"13.737355192,51.047155075" } }, { "name":"Dresden Postplatz", "nameWO":"Postplatz", "platformName":"", "place":"Dresden", "nameWithPlace":"Dresden Postplatz", "usage":"arrival", "omc":"14612000", "placeID":"1", "desc":"", "dateTime": { "date":"16.02.2017", "time":"17:23", "rtDate":"16.02.2017", "rtTime":"17:23" }, "stamp": { "date":"20170216", "time":"1723", "rtDate":"20170216", "rtTime":"1723" }, "links": [ { "type":"RM", "href":"FILELOAD?Filename=VVO_58A5D26D7.pdf" } ], "ref": { "id":"33000037", "area":"3", "platform":"4", "gid":"de:14612:37", "pointGid":"de:14612:37:3:4", "NaPTANID":"", "attrs": [ ], "coords":"13.733560349,51.050555626" } } ], "mode": { "name":"Straßenbahn 8", "number":"8", "symbol":"8", "product":"Straßenbahn", "type":"4", "code":"4", "destination":" \"Hellerau\"", "destID":"-1", "desc":"Betriebshof Gorbitz - %Tolkewitz/Urnenhain%85", "timetablePeriod":"", "realtime":"0", "diva": { "branch":"11", "line":"11008", "supplement":" ", "dir":"R", "project":"j17", "network":"voe", "stateless":"voe:11008: :R:j17", "tripCode":"123", "operator":"DVB", "opPublicCode":"DVB", "opCode":"16", "isSTT":"1", "attrs": [ ] } }, "hints": null, "stopSeq": [ { "name":"Dresden Prager Straße", "nameWO":"Prager Straße", "place":"Dresden", "nameWithPlace":"", "omc":"14612000", "placeID":"1", "platformName":"", "desc":"", "ref": { "id":"33000003", "area":"1", "platform":"1", "gid":"de:14612:3", "pointGid":"de:14612:3:1:1", "attrs": [ ], "coords":"13.737355192,51.047155075", "depDateTime":"20170216 17:21", "arrDelay":"-1", "arrValid":"0", "depDelay":"-1", "depValid":"0" } }, { "name":"Dresden Postplatz", "nameWO":"Postplatz", "place":"Dresden", "nameWithPlace":"", "omc":"14612000", "placeID":"1", "platformName":"", "desc":"", "ref": { "id":"33000037", "area":"3", "platform":"4", "gid":"de:14612:37", "pointGid":"de:14612:37:3:4", "attrs": [ ], "coords":"13.733560349,51.050555626", "arrDateTime":"20170216 17:23", "arrDelay":"-1", "arrValid":"0", "depDelay":"-1", "depValid":"0" } } ], "infos": { "info": { "paramList": [ ], "infoLinkText":"Testmeldung DELFIplus", "infoLinkURL":"http://192.168.150.204:8081/ics/XSLT_CM_SHOWADDINFO_REQUEST?infoID=74_VVO&seqID=1", "infoText": { "content":"Testmeldung für DELFIplus - alle Straßenbahnen in Dresden sind Niederflurstraßenbahnen", "subtitle":"Testmeldung DELFIplus", "subject":"Testmeldung", "additionalText":"" } } }, "format":"x,y", "path":"13.737354183,51.047128121 13.736854978,51.047126556 13.735942425,51.047131132 13.735628178,51.047117823 13.735170390,51.047079676 13.735056363,51.047081370 13.734971514,51.047100609 13.734859166,51.047147227 13.734803496,51.047184012 13.734775661,51.047202405 13.734735251,51.047265933 13.734695513,51.047347431 13.734631634,51.047546153 13.734437642,51.048079426 13.734308535,51.048440931 13.733920532,51.049507475 13.733660958,51.050194545 13.733557328,51.050474763 13.733531504,51.050547064", "attrs": [ { "name":"PlanWheelChairAccess", "value":"1" } ] } ], "itdFare": { "fares": { "fare": { "net":"voe", "toPR":"0", "fromPR":"0", "currency":"EUR", "unitName":"Preisstufe", "fareAdult":"2.30", "fareChild":"1.60", "unitsAdult":"1", "unitsChild":"1", "fareBikeAdult":"", "fareBikeChild":"", "unitsBikeAdult":"", "unitsBikeChild":"", "levelAdult":"", "levelChild":"", "idChild":"", "note":"" } }, "tickets": { "ticket": { "net":"voe", "toPR":"0", "fromPR":"0", "currency":"Euro", "weekAdult":"", "weekChild":"", "monthAdult":"", "monthChild":"", "weekEducation":"", "monthEducation":"", "yearAdults":"", "yearChildren":"", "yearStudents":"", "dayAdults":"", "dayChildren":"", "dayStudents":"", "levelAdult":"1", "levelChild":"1", "genericTickets": null } }, "tariffZones": { "tariffZone": { "net":"voe", "toPR":"0", "fromPR":"0", "neutralZone":"", "zones": { "zone": { "zoneElems": { "zoneElem": { "zone":"10" } } } } } }, "specialTickets": null }, "attrs": [ { "name":"JourneyDeparture", "value":"elapsed" } ] }, { "distance":"0", "duration":"00:02", "interchange":"0", "desc":"1", "optValue":"0", "legs": [ { "timeMinute":"2", "points": [ { "name":"Dresden Prager Straße", "nameWO":"Prager Straße", "platformName":"", "place":"Dresden", "nameWithPlace":"Dresden Prager Straße", "usage":"departure", "omc":"14612000", "placeID":"1", "desc":"", "dateTime": { "date":"16.02.2017", "time":"17:28", "rtDate":"16.02.2017", "rtTime":"17:28" }, "stamp": { "date":"20170216", "time":"1728", "rtDate":"20170216", "rtTime":"1728" }, "links": [ { "type":"RM", "href":"FILELOAD?Filename=VVO_58A5D26D9.pdf" } ], "ref": { "id":"33000003", "area":"1", "platform":"1", "gid":"de:14612:3", "pointGid":"de:14612:3:1:1", "NaPTANID":"", "attrs": [ ], "coords":"13.737355192,51.047155075" } }, { "name":"Dresden Postplatz", "nameWO":"Postplatz", "platformName":"", "place":"Dresden", "nameWithPlace":"Dresden Postplatz", "usage":"arrival", "omc":"14612000", "placeID":"1", "desc":"", "dateTime": { "date":"16.02.2017", "time":"17:30", "rtDate":"16.02.2017", "rtTime":"17:30" }, "stamp": { "date":"20170216", "time":"1730", "rtDate":"20170216", "rtTime":"1730" }, "links": [ { "type":"RM", "href":"FILELOAD?Filename=VVO_58A5D26DA.pdf" } ], "ref": { "id":"33000037", "area":"3", "platform":"4", "gid":"de:14612:37", "pointGid":"de:14612:37:3:4", "NaPTANID":"", "attrs": [ ], "coords":"13.733560349,51.050555626" } } ], "mode": { "name":"Straßenbahn 9", "number":"9", "symbol":"9", "product":"Straßenbahn", "type":"4", "code":"4", "destination":" \"Kaditz\"", "destID":"-1", "desc":"Prohlis - Kaditz", "timetablePeriod":"", "realtime":"0", "diva": { "branch":"11", "line":"11009", "supplement":" ", "dir":"H", "project":"j17", "network":"voe", "stateless":"voe:11009: :H:j17", "tripCode":"155", "operator":"DVB", "opPublicCode":"DVB", "opCode":"16", "isSTT":"1", "attrs": [ ] } }, "hints": null, "stopSeq": [ { "name":"Dresden Prager Straße", "nameWO":"Prager Straße", "place":"Dresden", "nameWithPlace":"", "omc":"14612000", "placeID":"1", "platformName":"", "desc":"", "ref": { "id":"33000003", "area":"1", "platform":"1", "gid":"de:14612:3", "pointGid":"de:14612:3:1:1", "attrs": [ ], "coords":"13.737355192,51.047155075", "depDateTime":"20170216 17:28", "arrDelay":"-1", "arrValid":"0", "depDelay":"-1", "depValid":"0" } }, { "name":"Dresden Postplatz", "nameWO":"Postplatz", "place":"Dresden", "nameWithPlace":"", "omc":"14612000", "placeID":"1", "platformName":"", "desc":"", "ref": { "id":"33000037", "area":"3", "platform":"4", "gid":"de:14612:37", "pointGid":"de:14612:37:3:4", "attrs": [ ], "coords":"13.733560349,51.050555626", "arrDateTime":"20170216 17:30", "arrDelay":"-1", "arrValid":"0", "depDelay":"-1", "depValid":"0" } } ], "infos": { "info": { "paramList": [ ], "infoLinkText":"Testmeldung DELFIplus", "infoLinkURL":"http://192.168.150.204:8081/ics/XSLT_CM_SHOWADDINFO_REQUEST?infoID=74_VVO&seqID=1", "infoText": { "content":"Testmeldung für DELFIplus - alle Straßenbahnen in Dresden sind Niederflurstraßenbahnen", "subtitle":"Testmeldung DELFIplus", "subject":"Testmeldung", "additionalText":"" } } }, "format":"x,y", "path":"13.737354183,51.047128121 13.736854978,51.047126556 13.735942425,51.047131132 13.735628178,51.047117823 13.735170390,51.047079676 13.735056363,51.047081370 13.734971514,51.047100609 13.734859166,51.047147227 13.734803496,51.047184012 13.734775661,51.047202405 13.734735251,51.047265933 13.734695513,51.047347431 13.734631634,51.047546153 13.734437642,51.048079426 13.734308535,51.048440931 13.733920532,51.049507475 13.733660958,51.050194545 13.733557328,51.050474763 13.733531504,51.050547064", "attrs": [ { "name":"PlanWheelChairAccess", "value":"1" } ] } ], "itdFare": { "fares": { "fare": { "net":"voe", "toPR":"0", "fromPR":"0", "currency":"EUR", "unitName":"Preisstufe", "fareAdult":"2.30", "fareChild":"1.60", "unitsAdult":"1", "unitsChild":"1", "fareBikeAdult":"", "fareBikeChild":"", "unitsBikeAdult":"", "unitsBikeChild":"", "levelAdult":"", "levelChild":"", "idChild":"", "note":"" } }, "tickets": { "ticket": { "net":"voe", "toPR":"0", "fromPR":"0", "currency":"Euro", "weekAdult":"", "weekChild":"", "monthAdult":"", "monthChild":"", "weekEducation":"", "monthEducation":"", "yearAdults":"", "yearChildren":"", "yearStudents":"", "dayAdults":"", "dayChildren":"", "dayStudents":"", "levelAdult":"1", "levelChild":"1", "genericTickets": null } }, "tariffZones": { "tariffZone": { "net":"voe", "toPR":"0", "fromPR":"0", "neutralZone":"", "zones": { "zone": { "zoneElems": { "zoneElem": { "zone":"10" } } } } } }, "specialTickets": null }, "attrs": [ { "name":"JourneyDeparture", "value":"soon" } ] }, { "distance":"0", "duration":"00:02", "interchange":"0", "desc":"1", "optValue":"0", "legs": [ { "timeMinute":"2", "points": [ { "name":"Dresden Prager Straße", "nameWO":"Prager Straße", "platformName":"", "place":"Dresden", "nameWithPlace":"Dresden Prager Straße", "usage":"departure", "omc":"14612000", "placeID":"1", "desc":"", "dateTime": { "date":"16.02.2017", "time":"17:31", "rtDate":"16.02.2017", "rtTime":"17:31" }, "stamp": { "date":"20170216", "time":"1731", "rtDate":"20170216", "rtTime":"1731" }, "links": [ { "type":"RM", "href":"FILELOAD?Filename=VVO_58A5D26D6.pdf" } ], "ref": { "id":"33000003", "area":"1", "platform":"1", "gid":"de:14612:3", "pointGid":"de:14612:3:1:1", "NaPTANID":"", "attrs": [ ], "coords":"13.737355192,51.047155075" } }, { "name":"Dresden Postplatz", "nameWO":"Postplatz", "platformName":"", "place":"Dresden", "nameWithPlace":"Dresden Postplatz", "usage":"arrival", "omc":"14612000", "placeID":"1", "desc":"", "dateTime": { "date":"16.02.2017", "time":"17:33", "rtDate":"16.02.2017", "rtTime":"17:33" }, "stamp": { "date":"20170216", "time":"1733", "rtDate":"20170216", "rtTime":"1733" }, "links": [ { "type":"RM", "href":"FILELOAD?Filename=VVO_58A5D26D7.pdf" } ], "ref": { "id":"33000037", "area":"3", "platform":"4", "gid":"de:14612:37", "pointGid":"de:14612:37:3:4", "NaPTANID":"", "attrs": [ ], "coords":"13.733560349,51.050555626" } } ], "mode": { "name":"Straßenbahn 8", "number":"8", "symbol":"8", "product":"Straßenbahn", "type":"4", "code":"4", "destination":" \"Hellerau\"", "destID":"-1", "desc":"Betriebshof Gorbitz - %Tolkewitz/Urnenhain%85", "timetablePeriod":"", "realtime":"0", "diva": { "branch":"11", "line":"11008", "supplement":" ", "dir":"R", "project":"j17", "network":"voe", "stateless":"voe:11008: :R:j17", "tripCode":"124", "operator":"DVB", "opPublicCode":"DVB", "opCode":"16", "isSTT":"1", "attrs": [ ] } }, "hints": null, "stopSeq": [ { "name":"Dresden Prager Straße", "nameWO":"Prager Straße", "place":"Dresden", "nameWithPlace":"", "omc":"14612000", "placeID":"1", "platformName":"", "desc":"", "ref": { "id":"33000003", "area":"1", "platform":"1", "gid":"de:14612:3", "pointGid":"de:14612:3:1:1", "attrs": [ ], "coords":"13.737355192,51.047155075", "depDateTime":"20170216 17:31", "arrDelay":"-1", "arrValid":"0", "depDelay":"-1", "depValid":"0" } }, { "name":"Dresden Postplatz", "nameWO":"Postplatz", "place":"Dresden", "nameWithPlace":"", "omc":"14612000", "placeID":"1", "platformName":"", "desc":"", "ref": { "id":"33000037", "area":"3", "platform":"4", "gid":"de:14612:37", "pointGid":"de:14612:37:3:4", "attrs": [ ], "coords":"13.733560349,51.050555626", "arrDateTime":"20170216 17:33", "arrDelay":"-1", "arrValid":"0", "depDelay":"-1", "depValid":"0" } } ], "infos": { "info": { "paramList": [ ], "infoLinkText":"Testmeldung DELFIplus", "infoLinkURL":"http://192.168.150.204:8081/ics/XSLT_CM_SHOWADDINFO_REQUEST?infoID=74_VVO&seqID=1", "infoText": { "content":"Testmeldung für DELFIplus - alle Straßenbahnen in Dresden sind Niederflurstraßenbahnen", "subtitle":"Testmeldung DELFIplus", "subject":"Testmeldung", "additionalText":"" } } }, "format":"x,y", "path":"13.737354183,51.047128121 13.736854978,51.047126556 13.735942425,51.047131132 13.735628178,51.047117823 13.735170390,51.047079676 13.735056363,51.047081370 13.734971514,51.047100609 13.734859166,51.047147227 13.734803496,51.047184012 13.734775661,51.047202405 13.734735251,51.047265933 13.734695513,51.047347431 13.734631634,51.047546153 13.734437642,51.048079426 13.734308535,51.048440931 13.733920532,51.049507475 13.733660958,51.050194545 13.733557328,51.050474763 13.733531504,51.050547064", "attrs": [ { "name":"PlanWheelChairAccess", "value":"1" } ] } ], "itdFare": { "fares": { "fare": { "net":"voe", "toPR":"0", "fromPR":"0", "currency":"EUR", "unitName":"Preisstufe", "fareAdult":"2.30", "fareChild":"1.60", "unitsAdult":"1", "unitsChild":"1", "fareBikeAdult":"", "fareBikeChild":"", "unitsBikeAdult":"", "unitsBikeChild":"", "levelAdult":"", "levelChild":"", "idChild":"", "note":"" } }, "tickets": { "ticket": { "net":"voe", "toPR":"0", "fromPR":"0", "currency":"Euro", "weekAdult":"", "weekChild":"", "monthAdult":"", "monthChild":"", "weekEducation":"", "monthEducation":"", "yearAdults":"", "yearChildren":"", "yearStudents":"", "dayAdults":"", "dayChildren":"", "dayStudents":"", "levelAdult":"1", "levelChild":"1", "genericTickets": null } }, "tariffZones": { "tariffZone": { "net":"voe", "toPR":"0", "fromPR":"0", "neutralZone":"", "zones": { "zone": { "zoneElems": { "zoneElem": { "zone":"10" } } } } } }, "specialTickets": null }, "attrs": [ { "name":"JourneyDeparture", "value":"soon" } ] }, { "distance":"0", "duration":"00:02", "interchange":"0", "desc":"1", "optValue":"0", "legs": [ { "timeMinute":"2", "points": [ { "name":"Dresden Prager Straße", "nameWO":"Prager Straße", "platformName":"", "place":"Dresden", "nameWithPlace":"Dresden Prager Straße", "usage":"departure", "omc":"14612000", "placeID":"1", "desc":"", "dateTime": { "date":"16.02.2017", "time":"17:38", "rtDate":"16.02.2017", "rtTime":"17:38" }, "stamp": { "date":"20170216", "time":"1738", "rtDate":"20170216", "rtTime":"1738" }, "links": [ { "type":"RM", "href":"FILELOAD?Filename=VVO_58A5D26D9.pdf" } ], "ref": { "id":"33000003", "area":"1", "platform":"1", "gid":"de:14612:3", "pointGid":"de:14612:3:1:1", "NaPTANID":"", "attrs": [ ], "coords":"13.737355192,51.047155075" } }, { "name":"Dresden Postplatz", "nameWO":"Postplatz", "platformName":"", "place":"Dresden", "nameWithPlace":"Dresden Postplatz", "usage":"arrival", "omc":"14612000", "placeID":"1", "desc":"", "dateTime": { "date":"16.02.2017", "time":"17:40", "rtDate":"16.02.2017", "rtTime":"17:40" }, "stamp": { "date":"20170216", "time":"1740", "rtDate":"20170216", "rtTime":"1740" }, "links": [ { "type":"RM", "href":"FILELOAD?Filename=VVO_58A5D26DA.pdf" } ], "ref": { "id":"33000037", "area":"3", "platform":"4", "gid":"de:14612:37", "pointGid":"de:14612:37:3:4", "NaPTANID":"", "attrs": [ ], "coords":"13.733560349,51.050555626" } } ], "mode": { "name":"Straßenbahn 9", "number":"9", "symbol":"9", "product":"Straßenbahn", "type":"4", "code":"4", "destination":" \"Kaditz\"", "destID":"-1", "desc":"Prohlis - Kaditz", "timetablePeriod":"", "realtime":"0", "diva": { "branch":"11", "line":"11009", "supplement":" ", "dir":"H", "project":"j17", "network":"voe", "stateless":"voe:11009: :H:j17", "tripCode":"158", "operator":"DVB", "opPublicCode":"DVB", "opCode":"16", "isSTT":"1", "attrs": [ ] } }, "hints": null, "stopSeq": [ { "name":"Dresden Prager Straße", "nameWO":"Prager Straße", "place":"Dresden", "nameWithPlace":"", "omc":"14612000", "placeID":"1", "platformName":"", "desc":"", "ref": { "id":"33000003", "area":"1", "platform":"1", "gid":"de:14612:3", "pointGid":"de:14612:3:1:1", "attrs": [ ], "coords":"13.737355192,51.047155075", "depDateTime":"20170216 17:38", "arrDelay":"-1", "arrValid":"0", "depDelay":"-1", "depValid":"0" } }, { "name":"Dresden Postplatz", "nameWO":"Postplatz", "place":"Dresden", "nameWithPlace":"", "omc":"14612000", "placeID":"1", "platformName":"", "desc":"", "ref": { "id":"33000037", "area":"3", "platform":"4", "gid":"de:14612:37", "pointGid":"de:14612:37:3:4", "attrs": [ ], "coords":"13.733560349,51.050555626", "arrDateTime":"20170216 17:40", "arrDelay":"-1", "arrValid":"0", "depDelay":"-1", "depValid":"0" } } ], "infos": { "info": { "paramList": [ ], "infoLinkText":"Testmeldung DELFIplus", "infoLinkURL":"http://192.168.150.204:8081/ics/XSLT_CM_SHOWADDINFO_REQUEST?infoID=74_VVO&seqID=1", "infoText": { "content":"Testmeldung für DELFIplus - alle Straßenbahnen in Dresden sind Niederflurstraßenbahnen", "subtitle":"Testmeldung DELFIplus", "subject":"Testmeldung", "additionalText":"" } } }, "format":"x,y", "path":"13.737354183,51.047128121 13.736854978,51.047126556 13.735942425,51.047131132 13.735628178,51.047117823 13.735170390,51.047079676 13.735056363,51.047081370 13.734971514,51.047100609 13.734859166,51.047147227 13.734803496,51.047184012 13.734775661,51.047202405 13.734735251,51.047265933 13.734695513,51.047347431 13.734631634,51.047546153 13.734437642,51.048079426 13.734308535,51.048440931 13.733920532,51.049507475 13.733660958,51.050194545 13.733557328,51.050474763 13.733531504,51.050547064", "attrs": [ { "name":"PlanWheelChairAccess", "value":"1" } ] } ], "itdFare": { "fares": { "fare": { "net":"voe", "toPR":"0", "fromPR":"0", "currency":"EUR", "unitName":"Preisstufe", "fareAdult":"2.30", "fareChild":"1.60", "unitsAdult":"1", "unitsChild":"1", "fareBikeAdult":"", "fareBikeChild":"", "unitsBikeAdult":"", "unitsBikeChild":"", "levelAdult":"", "levelChild":"", "idChild":"", "note":"" } }, "tickets": { "ticket": { "net":"voe", "toPR":"0", "fromPR":"0", "currency":"Euro", "weekAdult":"", "weekChild":"", "monthAdult":"", "monthChild":"", "weekEducation":"", "monthEducation":"", "yearAdults":"", "yearChildren":"", "yearStudents":"", "dayAdults":"", "dayChildren":"", "dayStudents":"", "levelAdult":"1", "levelChild":"1", "genericTickets": null } }, "tariffZones": { "tariffZone": { "net":"voe", "toPR":"0", "fromPR":"0", "neutralZone":"", "zones": { "zone": { "zoneElems": { "zoneElem": { "zone":"10" } } } } } }, "specialTickets": null }, "attrs": [ ] }, { "distance":"461", "duration":"00:07", "interchange":"0", "desc":"-1", "legs": [ { "timeMinute":"7", "points": [ { "name":"Dresden, Prager Straße", "nameWO":"Prager Straße", "platformName":"", "place":"Dresden", "nameWithPlace":"Dresden, Prager Straße", "usage":"departure", "omc":"14612000", "placeID":"1", "desc":"", "dateTime": { "date":"16.02.2017", "time":"17:25", "rtDate":"16.02.2017", "rtTime":"17:25" }, "stamp": { "date":"20170216", "time":"1725", "rtDate":"20170216", "rtTime":"1725" }, "links": [ { "type":"RM", "href":"FILELOAD?Filename=VVO_58A5D26D4.pdf" } ], "ref": { "id":"33000003", "area":"", "platform":"", "NaPTANID":"", "attrs": [ ], "coords":"13.737203112,51.047283193" } }, { "name":"Dresden, Postplatz", "nameWO":"Postplatz", "platformName":"", "place":"Dresden", "nameWithPlace":"Dresden, Postplatz", "usage":"arrival", "omc":"14612000", "placeID":"1", "desc":"", "dateTime": { "date":"16.02.2017", "time":"17:32", "rtDate":"16.02.2017", "rtTime":"17:32" }, "stamp": { "date":"20170216", "time":"1732", "rtDate":"20170216", "rtTime":"1732" }, "links": [ { "type":"RM", "href":"FILELOAD?Filename=VVO_58A5D26D4.pdf" } ], "ref": { "id":"33000037", "area":"", "platform":"", "NaPTANID":"", "attrs": [ ], "coords":"13.733690452,51.049456952" } } ], "mode": { "name":"", "number":"", "symbol":"", "product":"Fussweg", "type":"100", "code":"-1", "destination":"", "destID":"-1", "desc":"", "timetablePeriod":"", "realtime":"0", "diva": { "branch":"", "line":"", "supplement":" ", "dir":" ", "project":"", "network":"", "stateless":":: : :", "operator":"", "opCode":"", "attrs": [ ] } }, "hints": null, "infos": null, "format":"x,y", "path":"13.737203112,51.047283193 13.737203112,51.047283193 13.737074495,51.047276116 13.736831515,51.047261750 13.736145669,51.047226998 13.736058330,51.047560915 13.734743311,51.047481566 13.734705252,51.047607987 13.734446708,51.048322013 13.734315586,51.048629610 13.734136847,51.049189624 13.734020982,51.049523963 13.733920532,51.049507475 13.733690787,51.049465937 13.733690452,51.049456952", "turnInst": [ { "dir":"STRAIGHT", "manoeuvre":"ORIGIN", "name":"Dr.-Külz-Ring", "dirHint":"", "place":"", "skyDir":"84", "tTime":"66", "ctTime":"66", "dis":"74", "cDis":"74", "fPLIdx":"0", "tPLIdx":"2", "fPCIdx":"0", "tPCIdx":"3", "attrs": [ ], "coords":"13.737203112,51.047283193" }, { "dir":"RIGHT", "manoeuvre":"TURN", "name":"Webergasse", "dirHint":"", "place":"", "skyDir":"169", "tTime":"33", "ctTime":"99", "dis":"38", "cDis":"112", "fPLIdx":"3", "tPLIdx":"3", "fPCIdx":"3", "tPCIdx":"4", "attrs": [ ], "coords":"13.736145669,51.047226998" }, { "dir":"LEFT", "manoeuvre":"TURN", "name":"Dr.-Külz-Ring", "dirHint":"", "place":"", "skyDir":"83", "tTime":"82", "ctTime":"181", "dis":"93", "cDis":"205", "fPLIdx":"4", "tPLIdx":"4", "fPCIdx":"4", "tPCIdx":"5", "attrs": [ ], "coords":"13.736058330,51.047560915" }, { "dir":"RIGHT", "manoeuvre":"TURN", "name":"Wallstraße", "dirHint":"", "place":"", "skyDir":"168", "tTime":"206", "ctTime":"387", "dis":"232", "cDis":"437", "fPLIdx":"5", "tPLIdx":"9", "fPCIdx":"5", "tPCIdx":"10", "attrs": [ ], "coords":"13.734743311,51.047481566" }, { "dir":"LEFT", "manoeuvre":"DESTINATION", "name":"Antonsplatz", "dirHint":"", "place":"", "skyDir":"74", "tTime":"21", "ctTime":"408", "dis":"24", "cDis":"461", "fPLIdx":"10", "tPLIdx":"11", "fPCIdx":"10", "tPCIdx":"12", "attrs": [ ], "coords":"13.734020982,51.049523963" } ] } ], "itdFare": { "fares": null, "tickets": null, "tariffZones": null, "specialTickets": null }, "attrs": [ ] } ] } diff --git a/test/find.js b/test/find.js new file mode 100644 index 0000000..6c494a4 --- /dev/null +++ b/test/find.js @@ -0,0 +1,66 @@ +'use strict'; + +var Utils = require('./utils'); +var utils = new Utils(); +var assert = require('assert'); + +describe('dvb.find', function () { + describe('dvb.find "Zellescher Weg"', function () { + utils.mockRequest('find-zellescherweg.json'); + + function assertStop(stop) { + assert(stop.stop); + assert(Array.isArray(stop.coords)); + assert.strictEqual(2, stop.coords.length); + assert.strictEqual(51, Math.floor(stop.coords[0])); + assert.strictEqual(13, Math.floor(stop.coords[1])); + } + + it('should return an array', function (done) { + utils.dvb.find('schilling') + .then(function (data) { + assert(Array.isArray(data)); + assert(data.length > 0); + data.forEach(assertStop); + done(); + }) + .catch(function (err) { + done(err); + }); + }); + + it('should find the correct stop', function (done) { + utils.dvb.find('zellesch') + .then(function (data) { + assert.strictEqual('Zellescher Weg', data[0].stop); + done(); + }) + .catch(function (err) { + done(err); + }); + }); + + it('should return a Promise but still accept a callback', function (done) { + utils.dvb.find('zellesch', function (err, data) { + assert(data); + done(); + }).then(assert); + }); + }); + + describe('dvb.find "0"', function () { + utils.mockRequest('find-empty.json'); + + it('should return an empty array', function (done) { + utils.dvb.find('0#') + .then(function (data) { + assert(Array.isArray(data)); + assert.equal(data.length, 0); + done(); + }) + .catch(function (err) { + done(err); + }); + }); + }) +}); diff --git a/test/mocha.opts b/test/mocha.opts index c807f3b..873f95c 100644 --- a/test/mocha.opts +++ b/test/mocha.opts @@ -1,2 +1,2 @@ --reporter spec ---timeout 5000 +--timeout 10000 diff --git a/test/monitor.js b/test/monitor.js new file mode 100644 index 0000000..00efa95 --- /dev/null +++ b/test/monitor.js @@ -0,0 +1,63 @@ +'use strict'; + +var Utils = require('./utils'); +var utils = new Utils(); +var assert = require('assert'); + +describe('dvb.monitor', function () { + describe('dvb.monitor "Postplatz"', function () { + utils.mockRequest('monitor-postplatz.json'); + + function assertTransport(transport) { + assert(transport.line); + assert(transport.direction); + assert.strictEqual('number', typeof transport.arrivalTimeRelative); + assert.strictEqual('object', typeof transport.arrivalTime); + } + + it('should return an array with elements', function (done) { + utils.dvb.monitor('postplatz', 0, 5) + .then(function (data) { + assert(Array.isArray(data)); + assert(data.length > 0); + done() + }) + .catch(function (err) { + done(err); + }); + }); + + it('should contain all four fields', function (done) { + utils.dvb.monitor('postplatz', 0, 5) + .then(function (data) { + data.forEach(assertTransport); + done(); + }) + .catch(function (err) { + done(err); + }); + }); + + it('should return a Promise but still accept a callback', function () { + utils.dvb.monitor('postplatz', 0, 5, function (err, data) { + assert(data); + }).then(assert) + }); + }); + + describe('dvb.monitor "xxx"', function () { + utils.mockRequest('monitor-empty.json'); + + it('should return an empty array', function (done) { + utils.dvb.monitor('xxx', 0, 5) + .then(function (data) { + assert(Array.isArray(data)); + assert.equal(data.length, 0); + done(); + }) + .catch(function (err) { + done(err); + }); + }); + }) +}); diff --git a/test/pins.js b/test/pins.js new file mode 100644 index 0000000..29a5763 --- /dev/null +++ b/test/pins.js @@ -0,0 +1,328 @@ +'use strict'; + +var Utils = require('./utils'); +var utils = new Utils(); +var assert = require('assert'); +var pinTypes = require('../lib/pins').type; + +describe('dvb.pins', function () { + describe('dvb.pins "51.026578, 13.713899, 51.035565, 13.737974, stop"', function () { + utils.mockRequest('pins-stop.json'); + + it('should resolve into an array', function (done) { + utils.dvb.pins(51.026578, 13.713899, 51.035565, 13.737974, pinTypes.STOP, {}) + .then(function (data) { + assert(Array.isArray(data)); + assert.notEqual(0, data.length); + done(); + }) + .catch(function (err) { + done(err); + }); + }); + + it('should contain objects with id, name, coords, type and connections', function (done) { + utils.dvb.pins(51.026578, 13.713899, 51.035565, 13.737974, pinTypes.STOP, {}) + .then(function (data) { + data.forEach(function (elem) { + assert(elem.id); + assert(elem.name); + assert(elem.coords); + assert(elem.type); + assert.strictEqual(2, elem.coords.length); + assert.strictEqual(13, Math.floor(elem.coords[1])); + assert.strictEqual(51, Math.floor(elem.coords[0])); + assert.strictEqual(13, Math.floor(elem.coords[1])); + assert(Array.isArray(elem.connections)); + elem.connections.forEach(function (con) { + assert(con.line); + assert(con.type); + }); + }); + done(); + }) + .catch(function (err) { + done(err); + }); + }); + + it('should return a Promise but still accept a callback', function (done) { + utils.dvb.pins(51.026578, 13.713899, 51.035565, 13.737974, 'stop', {}, function (err, data) { + assert(data); + done(); + }).then(assert); + }); + + describe('test options', function () { + + it('default: connections, not groued, only title of line type', function (done) { + var hasConnections = false; + utils.dvb.pins(51.026578, 13.713899, 51.035565, 13.737974, pinTypes.STOP, {}) + .then(function (data) { + assert.notEqual(0, data.length); + data.forEach(function (elem) { + assert(elem.connections); + if (elem.connections.length > 0) { + hasConnections = true; + } + elem.connections.forEach(function (connection) { + assert(connection.type); + assert(connection.line); + assert.equal(Array.isArray(connection.line), false); + }); + }); + assert(hasConnections); + done(); + }) + .catch(function (err) { + done(err); + }); + }); + + it('showLines: false', function (done) { + utils.dvb.pins(51.026578, 13.713899, 51.035565, 13.737974, pinTypes.STOP, {showLines: false}) + .then(function (data) { + assert.notEqual(0, data.length); + data.forEach(function (elem) { + assert.equal(elem.connections, undefined); + }); + done(); + }) + .catch(function (err) { + done(err); + }); + }); + + it('groupByType: true', function (done) { + utils.dvb.pins(51.026578, 13.713899, 51.035565, 13.737974, pinTypes.STOP, {groupByType: true}) + .then(function (data) { + assert.notEqual(0, data.length); + data.forEach(function (elem) { + assert(elem.connections); + elem.connections.forEach(function (connection) { + assert(connection.type); + assert(connection.lines); + assert(Array.isArray(connection.lines)); + }); + }); + done(); + }) + .catch(function (err) { + done(err); + }); + }); + + it('fullLineType: true', function (done) { + utils.dvb.pins(51.026578, 13.713899, 51.035565, 13.737974, pinTypes.STOP, {fullLineType: true}) + .then(function (data) { + assert.notEqual(0, data.length); + data.forEach(function (elem) { + assert(elem.connections); + elem.connections.forEach(function (connection) { + assert(connection.type); + assert(connection.type.name); + assert(connection.type.title); + assert(connection.type.icon_url); + }); + }); + done(); + }) + .catch(function (err) { + done(err); + }); + }); + + }); + }); + + describe('dvb.pins "51.026578, 13.713899, 51.035565, 13.737974, platform"', function () { + utils.mockRequest('pins-platform.json'); + + it('should contain objects with name, coords, type and platform_nr', function (done) { + utils.dvb.pins(51.026578, 13.713899, 51.035565, 13.737974, pinTypes.PLATFORM, {}) + .then(function (data) { + assert.notEqual(0, data.length); + data.forEach(function (elem) { + assert(elem.name); + assert(elem.coords); + assert(elem.type); + assert.strictEqual(2, elem.coords.length); + assert.strictEqual(13, Math.floor(elem.coords[1])); + assert.strictEqual(51, Math.floor(elem.coords[0])); + assert(elem.platform_nr); + }); + done(); + }) + .catch(function (err) { + done(err); + }); + }); + }); + + describe('dvb.pins "51.026578, 13.713899, 51.035565, 13.737974, POI"', function () { + utils.mockRequest('pins-poi.json'); + + it('should contain objects with name, coords, type and id', function (done) { + var pinType = pinTypes.POI; + utils.dvb.pins(51.026578, 13.713899, 51.035565, 13.737974, pinType, {}) + .then(function (data) { + assert.notEqual(0, data.length); + data.forEach(function (elem) { + assert(elem.id); + assert(elem.name); + assert(elem.coords); + assert(elem.type); + assert.strictEqual(2, elem.coords.length); + assert.strictEqual(13, Math.floor(elem.coords[1])); + assert.strictEqual(51, Math.floor(elem.coords[0])); + }); + done(); + }) + .catch(function (err) { + done(err); + }); + }); + }); + + describe('dvb.pins "51.026578, 13.713899, 51.035565, 13.737974, TICKET_MACHINE"', function () { + utils.mockRequest('pins-ticket-machine.json'); + + it('should contain objects with name, coords, type and id', function (done) { + var pinType = pinTypes.TICKET_MACHINE; + utils.dvb.pins(51.026578, 13.713899, 51.035565, 13.737974, pinType, {}) + .then(function (data) { + assert.notEqual(0, data.length); + data.forEach(function (elem) { + assert(elem.id); + assert(elem.name); + assert(elem.coords); + assert(elem.type); + assert.strictEqual(2, elem.coords.length); + assert.strictEqual(13, Math.floor(elem.coords[1])); + assert.strictEqual(51, Math.floor(elem.coords[0])); + }); + done(); + }) + .catch(function (err) { + done(err); + }); + }); + }); + + describe('dvb.pins "51.026578, 13.713899, 51.035565, 13.737974, CAR_SHARING"', function () { + utils.mockRequest('pins-car-sharing.json'); + + it('should contain objects with name, coords, type and id', function (done) { + var pinType = pinTypes.CAR_SHARING; + utils.dvb.pins(51.026578, 13.713899, 51.035565, 13.737974, pinType, {}) + .then(function (data) { + assert.notEqual(0, data.length); + data.forEach(function (elem) { + assert(elem.id); + assert(elem.name); + assert(elem.coords); + assert(elem.type); + assert.strictEqual(2, elem.coords.length); + assert.strictEqual(13, Math.floor(elem.coords[1])); + assert.strictEqual(51, Math.floor(elem.coords[0])); + }); + done(); + }) + .catch(function (err) { + done(err); + }); + }); + }); + + describe('dvb.pins "51.026578, 13.713899, 51.035565, 13.737974, PARK_AND_RIDE"', function () { + utils.mockRequest('pins-park-and-ride.json'); + + it('should contain objects with name, coords, type and id', function (done) { + var pinType = pinTypes.PARK_AND_RIDE; + utils.dvb.pins(51.005211, 13.736066, 51.067603, 13.598394, pinType, {}) + .then(function (data) { + assert.notEqual(0, data.length); + data.forEach(function (elem) { + assert(elem.id); + assert(elem.name); + assert(elem.coords); + assert(elem.type); + assert.strictEqual(2, elem.coords.length); + assert.strictEqual(13, Math.floor(elem.coords[1])); + assert.strictEqual(51, Math.round(elem.coords[0])); + }); + done(); + }) + .catch(function (err) { + done(err); + }); + }); + }); + + describe('dvb.pins "51.026578, 13.713899, 51.035565, 13.737974, RENT_A_BIKE"', function () { + utils.mockRequest('pins-rent-a-bike.json'); + + it('should contain objects with name, coords, type and id', function (done) { + var pinType = pinTypes.RENT_A_BIKE; + utils.dvb.pins(51.026578, 13.713899, 51.035565, 13.737974, pinType, {}) + .then(function (data) { + assert.notEqual(0, data.length); + data.forEach(function (elem) { + assert(elem.id); + assert(elem.name); + assert(elem.coords); + assert(elem.type); + assert.strictEqual(2, elem.coords.length); + assert.strictEqual(13, Math.floor(elem.coords[1])); + assert.strictEqual(51, Math.floor(elem.coords[0])); + }); + done(); + }) + .catch(function (err) { + done(err); + }); + }); + }); + + describe('dvb.pins "51.026578, 13.713899, 51.035565, 13.737974, POI+PLATFORM"', function () { + utils.mockRequest('pins-poi-and-platform.json'); + + it('should contain objects with pinType of RENT_A_BIKE or PLATFORM', function (done) { + var hasPOI = false, hasSTOP = false; + + utils.dvb.pins(51.026578, 13.713899, 51.035565, 13.737974, [pinTypes.POI, pinTypes.PLATFORM]) + .then(function (data) { + data.forEach(function (elem) { + if (elem.type == pinTypes.POI) + hasPOI = true; + else if (elem.type == pinTypes.PLATFORM) + hasSTOP = true; + else + assert.fail(elem.type, pinTypes.POI + " || " + pinTypes.PLATFORM, "pinType should be '" + pinTypes.POI + " or '" + pinTypes.PLATFORM + "'"); + }); + assert(hasPOI && hasSTOP, "pinTypes should be '" + pinTypes.POI + " and '" + pinTypes.PLATFORM + "'"); + + done(); + }) + .catch(function (err) { + done(err); + }); + }); + }); + + describe('dvb.pins "0, 0, 0, 0, stop"', function () { + utils.mockRequest('pins-empty.json'); + + it('should resolve into an empty array', function (done) { + utils.dvb.pins(0, 0, 0, 0, pinTypes.STOP) + .then(function (data) { + assert(Array.isArray(data)); + assert.equal(0, data.length); + done(); + }) + .catch(function (err) { + done(err); + }); + }); + }); +}); \ No newline at end of file diff --git a/test/route.js b/test/route.js new file mode 100644 index 0000000..aa7abbf --- /dev/null +++ b/test/route.js @@ -0,0 +1,118 @@ +'use strict'; + +var Utils = require('./utils'); +var utils = new Utils(); +var assert = require('assert'); +var _ = require('lodash'); +var route = require('../lib/route'); + +describe('dvb.route', function () { + describe('dvb.route "Prager Straße -> Postplatz"', function () { + utils.mockRequest('route-pragerstr-postplatz.json'); + + function assertTrip(trip) { + assert(trip.departure); + assert(trip.arrival); + assert(trip.duration); + assert.strictEqual('number', typeof trip.interchange); + + assert(Array.isArray(trip.nodes)); + trip.nodes.forEach(assertNode); + } + + function assertNode(node) { + assert(node.mode); + assert(node.line || node.line === ''); + assert(node.direction || node.direction === ''); + + assert.strictEqual('object', typeof node.departure); + assert(node.departure.stop); + assert(node.departure.time); + + assert(Array.isArray(node.departure.coords)); + assert.strictEqual(2, node.departure.coords.length); + + assert.strictEqual('object', typeof node.arrival); + assert(node.arrival.stop); + assert(node.arrival.time); + + assert(Array.isArray(node.arrival.coords)); + assert.strictEqual(2, node.arrival.coords.length); + + assert(Array.isArray(node.path)); + node.path.forEach(function (path) { + assert(Array.isArray(path)); + assert.strictEqual(2, path.length); + assert.strictEqual(51, Math.floor(path[0])); + assert.strictEqual(13, Math.floor(path[1])); + }); + } + + it('should return the correct origin and destination', function (done) { + utils.dvb.route('pragerstrasse', 'postplatz', new Date(), route.DEPARTURE) + .then(function (data) { + assert.strictEqual('Dresden, Prager Straße', data.origin); + assert.strictEqual('Dresden, Postplatz', data.destination); + done(); + }) + .catch(function (err) { + done(err); + }); + }); + + it('should return an array of trips', function (done) { + utils.dvb.route('pragerstrasse', 'postplatz', new Date(), route.DEPARTURE) + .then(function (data) { + assert(Array.isArray(data.trips)); + assert(data.trips.length > 0); + data.trips.forEach(assertTrip); + done(); + }) + .catch(function (err) { + done(err); + }); + }); + + it('should return an times as Date', function (done) { + utils.dvb.route('pragerstrasse', 'postplatz', new Date(), route.DEPARTURE) + .then(function (data) { + assert(Array.isArray(data.trips)); + assert(data.trips.length > 0); + data.trips.forEach(function (trip) { + assert(_.isDate(trip.departure)); + assert(_.isDate(trip.arrival)); + trip.nodes.forEach(function (node) { + assert(_.isDate(node.departure.time)); + assert(_.isDate(node.arrival.time)); + }); + }); + done(); + }) + .catch(function (err) { + done(err); + }); + }); + + it('should return a Promise but still accept a callback', function (done) { + utils.dvb.route('pragerstrasse', 'postplatz', new Date(), route.DEPARTURE, function (err, data) { + assert(data); + done(); + }).then(assert); + }); + }); + + describe('dvb.route "0 -> 0"', function () { + utils.mockRequest('route-empty.json'); + + it('should return null', function (done) { + utils.dvb.route('0', '0', new Date(), route.ARRIVAL) + .then(function (data) { + assert.equal(null, data); + done(); + }) + .catch(function (err) { + done(err); + }); + }); + }); +}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index e007abd..0000000 --- a/test/test.js +++ /dev/null @@ -1,480 +0,0 @@ -'use strict'; - -var fs = require('fs'); -var assert = require('assert'); -var mockery = require('mockery'); -var bluebird = require('bluebird'); -var dvb; - -function mockRequest(filename) { - before(function (done) { - if (process.env.NODE_ENV != 'test_live') { - mockery.enable({ - warnOnReplace: true, - warnOnUnregistered: false, - useCleanCache: true - }); - mockery.registerMock('request-promise', function () { - var response = fs.readFileSync(__dirname + '/data/' + filename, 'utf8'); - return bluebird.resolve(response.trim()); - }); - } - dvb = require('../index'); - done(); - }); - - after(function (done) { - mockery.disable(); - mockery.deregisterAll(); - done(); - }); -} - -describe('dvb.monitor', function () { - describe('dvb.monitor "Postplatz"', function () { - mockRequest('monitor-postplatz.json'); - - function assertTransport(transport) { - assert(transport.line); - assert(transport.direction); - assert.strictEqual('number', typeof transport.arrivalTimeRelative); - assert.strictEqual('object', typeof transport.arrivalTime); - } - - it('should return an array with elements', function (done) { - dvb.monitor('postplatz', 0, 5) - .then(function (data) { - assert(Array.isArray(data)); - assert(data.length > 0); - done() - }) - .catch(function (err) { - done(err); - }); - }); - - it('should contain all four fields', function (done) { - dvb.monitor('postplatz', 0, 5) - .then(function (data) { - data.forEach(assertTransport); - done(); - }) - .catch(function (err) { - done(err); - }); - }); - - it('should return a Promise but still accept a callback', function () { - dvb.monitor('postplatz', 0, 5, function (err, data) { - assert(data); - }) - .then(assert) - }); - }); - - describe('dvb.monitor "xxx"', function () { - mockRequest('empty_json.json'); - - it('should return an empty array', function (done) { - dvb.monitor('xxx', 0, 5) - .then(function (data) { - assert(Array.isArray(data)); - assert.equal(data.length, 0); - done(); - }) - .catch(function (err) { - done(err); - }); - }); - }) -}); - -describe('dvb.route', function () { - describe('dvb.route "Prager Straße -> Postplatz"', function () { - mockRequest('route-pragerstr-postplatz.json'); - - function assertTrip(trip) { - assert(trip.departure); - assert(trip.arrival); - assert(trip.duration); - assert.strictEqual('number', typeof trip.interchange); - - assert(Array.isArray(trip.nodes)); - trip.nodes.forEach(assertNode); - } - - function assertNode(node) { - assert(node.mode); - assert(node.line || node.line === ''); - assert(node.direction || node.direction === ''); - - assert.strictEqual('object', typeof node.departure); - assert(node.departure.stop); - assert(node.departure.time); - - assert(Array.isArray(node.departure.coords)); - assert.strictEqual(2, node.departure.coords.length); - - assert.strictEqual('object', typeof node.arrival); - assert(node.arrival.stop); - assert(node.arrival.time); - - assert(Array.isArray(node.arrival.coords)); - assert.strictEqual(2, node.arrival.coords.length); - - assert(Array.isArray(node.path)); - node.path.forEach(function (path) { - assert(Array.isArray(path)); - assert.strictEqual(2, path.length); - assert.strictEqual(51, Math.floor(path[0])); - assert.strictEqual(13, Math.floor(path[1])); - }); - } - - it('should return the correct origin and destination', function (done) { - dvb.route('pragerstrasse', 'postplatz', new Date(), dvb.route.DEPARTURE) - .then(function (data) { - assert.strictEqual('Dresden, Prager Straße', data.origin); - assert.strictEqual('Dresden, Postplatz', data.destination); - done(); - }) - .catch(function (err) { - done(err); - }); - }); - - it('should return an array of trips', function (done) { - dvb.route('pragerstrasse', 'postplatz', new Date(), dvb.route.DEPARTURE) - .then(function (data) { - assert(Array.isArray(data.trips)); - assert(data.trips.length > 0); - data.trips.forEach(assertTrip); - done(); - }) - .catch(function (err) { - done(err); - }); - }); - - it('should return a Promise but still accept a callback', function (done) { - dvb.route('pragerstrasse', 'postplatz', new Date(), dvb.route.DEPARTURE, function (err, data) { - assert(data); - done(); - }).then(assert); - }); - }); - - describe('dvb.route "0 -> 0"', function () { - mockRequest('empty_json.json'); - - it('should return null', function (done) { - dvb.route('0', '0', new Date(), dvb.route.DEPARTURE) - .then(function (data) { - assert.equal(null, data); - done(); - }) - .catch(function (err) { - done(err); - }); - }); - }); -}); - -describe('dvb.find', function () { - describe('dvb.find "Zellescher Weg"', function () { - mockRequest('find-zellescherweg.json'); - - function assertStop(stop) { - assert(stop.stop); - assert(Array.isArray(stop.coords)); - assert.strictEqual(2, stop.coords.length); - assert.strictEqual(51, Math.floor(stop.coords[0])); - assert.strictEqual(13, Math.floor(stop.coords[1])); - } - - it('should return an array', function (done) { - dvb.find('zellesch') - .then(function (data) { - assert(Array.isArray(data)); - assert(data.length > 0); - data.forEach(assertStop); - done(); - }) - .catch(function (err) { - done(err); - }); - }); - - it('should find the correct stop', function (done) { - dvb.find('zellesch') - .then(function (data) { - assert.strictEqual('Zellescher Weg', data[0].stop); - done(); - }) - .catch(function (err) { - done(err); - }); - }); - - it('should return a Promise but still accept a callback', function (done) { - dvb.find('zellesch', function (err, data) { - assert(data); - done(); - }).then(assert); - }); - }); - - describe('dvb.find "0"', function () { - mockRequest('empty_json.json'); - - it('should return an empty array', function (done) { - dvb.find('0') - .then(function (data) { - assert(Array.isArray(data)); - assert.equal(data.length, 0); - done(); - }) - .catch(function (err) { - done(err); - }); - }); - }) -}); - -describe('dvb.pins', function () { - describe('dvb.pins "51.026578, 13.713899, 51.035565, 13.737974, stop"', function () { - mockRequest('pins-stop.json'); - - it('should resolve into an array', function (done) { - dvb.pins(51.026578, 13.713899, 51.035565, 13.737974, 'stop') - .then(function (data) { - assert(Array.isArray(data)); - assert.notEqual(0, data.length); - done(); - }) - .catch(function (err) { - done(err); - }); - }); - - it('should contain objects with id, name, coords and connections', function (done) { - dvb.pins(51.026578, 13.713899, 51.035565, 13.737974, 'stop') - .then(function (data) { - data.forEach(function (elem) { - assert(elem.id); - assert(elem.name); - assert(elem.coords); - assert.strictEqual(2, elem.coords.length); - assert.strictEqual(13, Math.floor(elem.coords[1])); - assert.strictEqual(51, Math.floor(elem.coords[0])); - assert.strictEqual(13, Math.floor(elem.coords[1])); - assert(Array.isArray(elem.connections)); - elem.connections.forEach(function (con) { - assert(con.line); - assert(con.type); - }); - }); - done(); - }) - .catch(function (err) { - done(err); - }); - }); - - it('should return a Promise but still accept a callback', function (done) { - dvb.pins(51.026578, 13.713899, 51.035565, 13.737974, 'stop', function (err, data) { - assert(data); - done(); - }).then(assert); - }); - }); - - describe('dvb.pins "51.026578, 13.713899, 51.035565, 13.737974, platform"', function () { - mockRequest('pins-platform.json'); - - it('should contain objects with name, coords and platform_nr', function (done) { - dvb.pins(51.026578, 13.713899, 51.035565, 13.737974, 'platform') - .then(function (data) { - assert.notEqual(0, data.length); - data.forEach(function (elem) { - assert(elem.name); - assert(elem.coords); - assert.strictEqual(2, elem.coords.length); - assert.strictEqual(13, Math.floor(elem.coords[1])); - assert.strictEqual(51, Math.floor(elem.coords[0])); - assert(elem.platform_nr); - }); - done(); - }) - .catch(function (err) { - done(err); - }); - }); - }); - - describe('dvb.pins "51.026578, 13.713899, 51.035565, 13.737974, POI"', function () { - mockRequest('pins-poi.json'); - - it('should contain objects with name, coords and id', function (done) { - dvb.pins(51.026578, 13.713899, 51.035565, 13.737974, dvb.pins.type.POI) - .then(function (data) { - assert.notEqual(0, data.length); - data.forEach(function (elem) { - assert(elem.id); - assert(elem.name); - assert(elem.coords); - assert.strictEqual(2, elem.coords.length); - assert.strictEqual(13, Math.floor(elem.coords[1])); - assert.strictEqual(51, Math.floor(elem.coords[0])); - }); - done(); - }) - .catch(function (err) { - done(err); - }); - }); - }); - - describe('dvb.pins "0, 0, 0, 0, stop"', function () { - mockRequest('empty.json'); - - it('should resolve into an empty array', function (done) { - dvb.pins(0, 0, 0, 0, dvb.pins.type.STOP) - .then(function (data) { - assert(Array.isArray(data)); - assert.equal(0, data.length); - done(); - }) - .catch(function (err) { - done(err); - }); - }); - }); -}); - -describe('dvb.address', function () { - describe('dvb.address "51.025451, 13.722943"', function () { - mockRequest('address-51-13.json'); - - it('should resolve into an object with city and address properties', function (done) { - dvb.address(51.025451, 13.722943) - .then(function (data) { - assert.strictEqual("Nöthnitzer Straße 46", data.address); - assert.strictEqual("Dresden", data.city); - done() - }) - .catch(function (err) { - done(err); - }); - }); - - it('should return a Promise but still accept a callback', function (done) { - dvb.address(51.025451, 13.722943, function (err, data) { - assert(data); - done(); - }).then(assert); - }); - }); - - describe('dvb.address "0, 0"', function () { - mockRequest('empty.json'); - - it('should return null', function (done) { - dvb.address(0, 0) - .then(function (data) { - assert.equal(null, data); - done(); - }) - .catch(function (err) { - done(err); - }); - }); - }); -}); - -describe('dvb.coords', function () { - describe('dvb.coords "33000755"', function () { - mockRequest('coords-33000755.json'); - - it('should resolve into a coordinate array [lat, lng]', function (done) { - dvb.coords('33000755') - .then(function (data) { - assert(Array.isArray(data)); - assert.equal(data.length, 2); - assert.strictEqual(13, Math.floor(data[1])); - assert.strictEqual(51, Math.floor(data[0])); - done(); - }) - .catch(function (err) { - done(err); - }); - }); - - it('should return a Promise but still accept a callback', function (done) { - dvb.coords('33000755', function (err, data) { - assert(data); - done(); - }).then(assert); - }); - }); - - describe('dvb.coords "xxx"', function () { - mockRequest('empty.json'); - - it('should return null', function (done) { - dvb.coords("xxx") - .then(function (data) { - assert.equal(null, data); - done(); - }) - .catch(function (err) { - done(err); - }); - }); - }); -}); - -describe('dvb.coords for id from dvb.pins', function () { - - var pins = []; - - describe('dvb.pins "51.026578, 13.713899, 51.035565, 13.737974, POI"', function () { - mockRequest('pins-poi.json'); - - it('should contain objects with name, coords and id', function (done) { - dvb.pins(51.026578, 13.713899, 51.035565, 13.737974, dvb.pins.type.POI) - .then(function (data) { - assert(Array.isArray(data)); - assert.notEqual(0, data.length); - data.forEach(function (elem) { - assert(elem.id); - assert(elem.name); - assert(elem.coords); - assert.strictEqual(2, elem.coords.length); - assert.strictEqual(13, Math.floor(elem.coords[1])); - assert.strictEqual(51, Math.floor(elem.coords[0])); - }); - pins = data; - done(); - }) - .catch(function (err) { - done(err); - }); - }); - }); - - describe('dvb.coords should be equal to first pin coords', function () { - mockRequest('coords-poi.json'); - - it('coordinates should be equal', function (done) { - dvb.coords(pins[0].id) - .then(function (coords) { - assert.deepEqual(coords, pins[0].coords); - done(); - }) - .catch(function (err) { - done(err); - }); - }); - }); -}); \ No newline at end of file diff --git a/test/utils.js b/test/utils.js new file mode 100644 index 0000000..a615416 --- /dev/null +++ b/test/utils.js @@ -0,0 +1,44 @@ +var fs = require('fs'); +var mockery = require('mockery'); +var bluebird = require('bluebird'); +var requestP = require('request-promise'); + +function Utils() { + this.dvb = undefined; +} + +Utils.prototype.mockRequest = function mockRequest(filename) { + var self = this; + before(function (done) { + if (process.env.NODE_ENV && process.env.NODE_ENV.indexOf('live') == -1) { + console.log("use mocks"); + var file_path = __dirname + '/data/' + filename; + mockery.enable({ + warnOnReplace: true, + warnOnUnregistered: false, + useCleanCache: true + }); + mockery.registerMock('request-promise', function (request) { + if (process.env.NODE_ENV == 'test_update') { + return requestP(request).then(function (data) { + fs.writeFileSync(file_path, data + "\n", 'utf8'); + return data; + }); + } else { + var result = fs.readFileSync(file_path, 'utf8'); + return bluebird.resolve(result.trim()) + } + }); + } + self.dvb = require('../index'); + done(); + }); + + after(function (done) { + mockery.disable(); + mockery.deregisterAll(); + done(); + }); +}; + +module.exports = Utils; \ No newline at end of file