maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Railway Time table (https://talk.maemo.org/showthread.php?t=64028)

vivmak 2010-10-19 10:17

Railway Time table
 
Today I saw my fellow train traveler taking out his spanking new iphone and with a couple of taps on his phone he had the railway timmings on his screen from his setting station to the destination , he took 5 seconds to show me how many trains are from our station to where we were going and how long each would take..... I was jealous and bit unhappy as well.

So, I decided to find out how to build an application similar to that and came across a bunch of xml files that are in Transportexchange format.... now my lack of knowledge in programming on Qt or Pythoin is limiting me to write such an application .... so I need some help from experts.

I wish to write it in Qt 4.7 if possible and please suggest where to start...how to read the xpaths etc...

Thanks in advance.

Diph 2010-10-19 11:00

Re: Railway Time table
 
Quote:

Originally Posted by vivmak (Post 844903)
I wish to write it in Qt 4.7 if possible and please suggest where to start...how to read the xpaths etc..

Qt 4.7 doc: http://doc.qt.nokia.com/4.7/qxmlquer...th-expressions

gunni 2010-10-19 11:31

Re: Railway Time table
 
There is an app for maemo called "fahrplan" that should be similar, but for german routes as far as i know.
But maybe a good starting point to look at.

And this one can be helpful, too:
http://labs.qt.nokia.com/2009/02/11/...gain-reloaded/

smurfy 2010-10-19 11:32

Re: Railway Time table
 
@vivmak:

i created a similar app for europe, called "fahrplan", it supports different "backends" so it should be quite easy to implement another backend.

if you want to create an app of your own feel free to look at my source. i use xpath aswell.

if you want to contribute to fahrplan simple create a garage account and send a request for access to the fahrplan project.

Netweaver 2010-10-19 11:35

Re: Railway Time table
 
Fahrplan also allows other European routes to be returned, I happily used it in Belgum and UK. It uses the DB (Deutsche Bahn) web backend for all of this.

vivmak 2010-10-19 20:40

Re: Railway Time table
 
Quote:

Originally Posted by smurfy (Post 844950)
@vivmak:

i created a similar app for europe, called "fahrplan", it supports different "backends" so it should be quite easy to implement another backend.

if you want to create an app of your own feel free to look at my source. i use xpath aswell.

if you want to contribute to fahrplan simple create a garage account and send a request for access to the fahrplan project.

Does it support TransportExchange format or it doesn't matter so long as its in a XML format?

I am in Australia and have downloaded a sample data from the local transport authority website in xml format, all files put together are 851 MB.

smurfy 2010-10-20 06:58

Re: Railway Time table
 
Quote:

Originally Posted by vivmak (Post 845407)
Does it support TransportExchange format or it doesn't matter so long as its in a XML format?

I am in Australia and have downloaded a sample data from the local transport authority website in xml format, all files put together are 851 MB.

I'm not familiar with that format, i currently parsing html and xml i download live over the internet.

But it should be possible to create an offline solution aswell.

I think the main think is to determine if the way fahrplan displays the journey is the same you like/the data you have allowes.

Currently farplan only support a journey planner, no departure monitor.

You can select the from and to station and a time/date. then it searchs for the connections and displays them.
If you need details about the connection you can click one of the connections and receive a detail view.

is there a way to get hold of the xml data, to check them out?

vivmak 2010-10-20 10:10

Re: Railway Time table
 
Quote:

Originally Posted by smurfy (Post 845762)
I'm not familiar with that format, i currently parsing html and xml i download live over the internet.

But it should be possible to create an offline solution aswell.

I think the main think is to determine if the way fahrplan displays the journey is the same you like/the data you have allowes.

Currently farplan only support a journey planner, no departure monitor.

You can select the from and to station and a time/date. then it searchs for the connections and displays them.
If you need details about the connection you can click one of the connections and receive a detail view.

is there a way to get hold of the xml data, to check them out?

Just need the train departure /arrival time from station A to B . No need for departure monitor as it is no available publicly anyways. There is a website but the idea is offline time table.

http://131500.info/

Sample XML is available at almost end of the following link, its huge, some of the file cant even be loaded to a normal edito on my laptop :

http://www.131500.com.au/transport-d...ge-tdx-program

smurfy 2010-10-20 11:04

Re: Railway Time table
 
Quote:

Originally Posted by vivmak (Post 845931)
Just need the train departure /arrival time from station A to B . No need for departure monitor as it is no available publicly anyways. There is a website but the idea is offline time table.
http://131500.info/

The steps on the website to get the trip informations looks like the same fahrplan uses. (3 step thing, like i described in my last post)

Quote:

Originally Posted by vivmak (Post 845931)
Sample XML is available at almost end of the following link, its huge, some of the file cant even be loaded to a normal edito on my laptop :

http://www.131500.com.au/transport-d...ge-tdx-program

I have to take a look to the xml format specs and ways to read the xml's with an good performance.

i hope i find time on the next weekend.

Diph 2010-10-20 11:05

Re: Railway Time table
 
Did you read this?

The files made available via these links are provided for development and testing purposes only. They do not contain complete up to date information on public transport services and should not be used for production applications or services.

jinx 2010-10-20 11:11

Re: Railway Time table
 
Quote:

Originally Posted by Diph (Post 845962)
Did you read this?

The files made available via these links are provided for development and testing purposes only. They do not contain complete up to date information on public transport services and should not be used for production applications or services.

you better check if they continously provide up to date information. however, I suppose they put this on their site as a disclaimer, should the service be down or not working correctly some time.

jinx

vivmak 2010-10-20 11:12

Re: Railway Time table
 
@smurfy , what you have built is really good and useful but I as not too sure how to prase the HTML and submit request back ( I suppose its creating a URL template and passing the station name or something like that?).

thank you for looking at this, meanwhile I will spend time reading Qt documents and links in this post :)

vivmak 2010-10-20 11:14

Re: Railway Time table
 
Quote:

Originally Posted by jinx (Post 845966)
you better check if they continously provide up to date information. however, I suppose they put this on their site as a disclaimer, should the service be down or not working correctly some time.

jinx

yes, but the timetable is only updated once a year in October, its pretty static other than any train delay information.

Once I sign the licnse agreement the information provided will be from production database.

smurfy 2010-10-20 11:38

Re: Railway Time table
 
@vivmak:

About the license and the up2date availability of the offline data files.
I not had the time yet to look at the license but we must find a way to give the user an easy way to get the xml data.

So maybe you can get the information about the license informations and if we can ship (more likely provide a download routine for the data) inside an app. or if there are licensing issues with that.

if you not already know, you can find the latest source of fahrplan here:
https://garage.maemo.org/plugins/scm...?root=fahrplan, it contains parser_*.cpp files which contains my parsing code. (xpath querys on xml and html).

vivmak 2010-10-20 20:39

Re: Railway Time table
 
I will get the code.

I am also thinking that loading xml files on the device is not really needed, since app allows to save the searched results one can store favourite route data and recall as needed, so i think will add online search instead of downloading the complete set.

there is a mobile version which can be easily used as backend i suppose

TomJ 2010-10-21 12:02

Re: Railway Time table
 
For any UKians (or those visiting who are interested), can I point out that the browser acts as railway timtable app straight from the location bar if you follow the instructions in the wikipage linked to in my sig...

smurfy 2010-10-22 18:01

Re: Railway Time table
 
@vivmak:

i started looking for a way to parse the 131500 website. it should be quite easy with the exception, the website seams to need cookies to work. but its possible that we still don't need them.

i just released 0.0.18 of fahrplan with some bugfixes, but i have time to start implementing a new backend.

smurfy 2010-11-04 11:20

Re: Railway Time table
 
just to inform you guys, i worked on the 131500 backend last weekend and its in svn now. i try to release a new version of fahrplan the upcoming weekend with this changes.

vivmak 2010-11-06 07:15

Re: Railway Time table
 
Quote:

Originally Posted by smurfy (Post 863102)
just to inform you guys, i worked on the 131500 backend last weekend and its in svn now. i try to release a new version of fahrplan the upcoming weekend with this changes.

Awsome ! it works but has a bug. In the result it shows is incorrect, it shows result 'to' station to 'from' station

smurfy 2010-11-10 18:23

Re: Railway Time table
 
thanks for the info, i noticed also some minor glitches. i will fix the bugs in the next couple of days.

vivmak 2010-11-22 10:54

Re: Railway Time table
 
Quote:

Originally Posted by smurfy (Post 869482)
thanks for the info, i noticed also some minor glitches. i will fix the bugs in the next couple of days.

This is fixed now, great job.


All times are GMT. The time now is 22:15.

vBulletin® Version 3.8.8