Swisstrains v2 kickoff

http://www.vasile.ch/hacks/swisstrains-v2/

There are 4 years since I didn’t update www.swisstrains.ch project but nevertheless it was good thing because I used this interval to learn more about SBB railway infrastructure + more understanding of their website(which I am still crawling to get the project data from) but it was also an opportunity to polish my programming skills, to learn new technologies and to master various maps APIs; so now it’s time to move the project to the next level.
The current progress can be seen under hacks section of my website and in the following you can see what changed in this version.

These are from the G+ post that I posted shortly after publishing my hack.

Changes

  • usage of GMaps JS API v3 + google.maps.geometry.spherical library; before I used v2 + home-made geo helpers
  • cleaner, less and highly optimized JS code; if you want to have fun just read the (JS) source code of swisstrains.ch
  • carefully reviewed HTTP headers and started to cache and GZIP always when I had the chance
  • map interaction improved; there are no more ‘Loading’, ‘Zoom beyond level x forbidden’ annoying dialogs. Maps are also styled now (thanks GMaps v3 !) so the unnecessary elements (like roads) are dimmed.
  • straightforward export process of the SBB trains network line; 4 years ago I used several (commercial) GIS tools, today I am using only open source tools
  • storing of the railroad network(2000+ polylines and 1800 points=stations) is done using Fusion Tables; before painted them one by one (so 2000 GPolyline objects + 1800+ GMarkers=DIVs)
  • ability to plot ALL the running vehicles (which are up to 700, depends on time of day) and visualize them in one map.
  • GMaps API v3 is designed for mobile; guess what, this version runs smoothly and loads pretty fast on iPhone, Android. Tablets too !

Next steps

Depending on my availability (remember I am doing this in my free time), I will try to:

  • push this project to you via Github
  • review/port other features of the current swisstrains.ch
  • update the romanian version http://cfr.webgis.ro
  • improve the mobile version, maybe try native

Make sure you watch this space for the next updates !
Also please add your comments about the project, i.e. if you miss any train lines, vehicles or you want to see new features.

Sep 28th, 2011 | Posted in Hobbies
  1. Martin
    Oct 12th, 2011 at 15:51 | #1

    V2 provides less information on running trains than V1. What causes the difference?

    • Oct 12th, 2011 at 21:05 | #2

      V2 provides less information on running trains than V1. What causes the difference?

      Hello Martin, the v2 is for now work-in-progress, some features from v1 will be ported to this version but don’t know yet when.

      Can you please tell me which feature do you miss ?

  2. Martin
    Oct 13th, 2011 at 14:44 | #3

    Can you please tell me which feature do you miss ?

    Origin/destination/line. Speed is shown in V1 too but was only calculated I guess.

  3. Oct 15th, 2011 at 23:42 | #4

    Martin :
    Origin/destination/line. Speed is shown in V1 too but was only calculated I guess.

    Acknowledged, I plan to add it ASAP, watch this space :)
    And yes, the speed it’s the average one, computed from timetables and distance.

  4. mihai
    Oct 25th, 2011 at 11:11 | #5

    cool

  5. Aug 14th, 2012 at 11:35 | #6

    Would be nice to see informations about all the freight trains – that would complete your work!

    • Aug 14th, 2012 at 12:47 | #7

      @Marcel – I will do it if you give me a data feed that I can scrape :)

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>