Click here to Skip to main content
Click here to Skip to main content

Transport Tracker

By , 30 Nov 2012
 

Please note

This article is an entry in our AppInnovation Contest. Articles in this sub-section are not required to be full articles so care should be taken when voting.

Introduction   

Transport Tracker is an idea I thought up a long time ago, when portable devices with sensors which provided location-awareness first came onto the scene. The AppInnovation Contest has given me a much-needed push to bring a solution to portable Windows 8 devices.  

The basic idea of the application is to provide simple tracking of transport services in and around your current location using telemetry from available sensors, static timetables and live departure data.

Unlike a lot of transport applications, I’ve chosen to create a transport network aggregation service in the cloud, which essentially pulls from a whole host of transport networks and provides a common interface for the client device. The client will query the cloud service for both static and live data and present each of the available stops and stations using a common user interface.

I’ll be using both the Location and Compass sensors to show the distance and direction of nearby stations and stops, plus the departure times of any vehicles departing. There will also be a favorites feature so you can mark particular stations or stops that you use frequently; these will then always be displayed on the main screen.

Components

As briefly mentioned in the previous section, the application will be split into two main components, Transport Tracker (which runs on the client device) and Transport Exchange (which will run as a web service and be hosted in the cloud). A visual representation of these components is shown below.

Transport Tracker (Client) 

The client component is written in C# and adopts a WPF user interface atop .NET 4.5. I’ll also be referencing WinRT to take advantage of the sensor APIs built into Windows 8.

It’s split into three main sub-components:

  • User Interface – Self-explanatory; contains the WPF components, controls and event hooks necessary to drive the UI.
  • Core - Keeps track of sensor data, maintains the cache and requests updated stations, timetables and departure data based on the current location.
  • Cache - Stores long-term station location data and timetables and short-term live departure data. Cache data will be stored in a local SQlite database via System.Data.SQlite (a managed ADO.NET compatible library for SQlite).

It was key to separate the UI layer from the core as I’m planning on releasing a Windows Store version of the application once this version has been fully completed.

Transport Exchange (Server)

The server component is written as an ASP.NET web service and runs in Azure, providing aggregated station location data, timetables and live departure data in JSON to the client.

There are four sub-components to the server:

  • Common Web API - Provides structured JSON data from the cache in response to web requests.
  • Cache - Stores all of the global station location data, timetables and live departure data. This is all maintained in a standard SQL Server database in Azure.
  • Core - Routinely updates the cache by querying external web services via the aggregator.
  • Aggregator - The crux of the server component; essentially queries a series of plugins that each provide an interface to a transport network web service. Data is collected by the aggregator from each of the web services and sent to the core to be cached. In some cases, these plugins will query fully-fledged web APIs, in other cases they may implement a more basic scraping technique (where no web API exists). The beauty of doing this scraping on the server-side is that it can be easily updated if the target interface is changed, without any changes to the client.  

This design allows for superb scalability in the future, as the Azure instance can easily be scaled up to serve more clients (or even scaled out using a load-balancer and several Azure instances). It’s also highly extensible as I can simply add additional transport network plugins and serve this new data out to existing clients without requiring re-deployment.

User Interface

I’ve gone for a fairly simple “Metro” interface by using the “Segoe UI light” font and a variety of crisp, high-contrast imagery. This allows for consistency when I come to port the application to Windows Store in the future (not part of my AppInnovation submission).

There are three main elements to the display:

  • Nearby Stations / Stops - Shows you all of the nearest stations and stops to your current location, sorted by distance. This is great when you’re commuting to cities for conferences where you don’t know the transport network.
  • Favorites - Any stations or stops that have been added to favorites using the heart button will be listed here and always shown regardless of distance. Useful for trips regularly undertaken.
  • Map - Pressing the map image will resize the map control to the full size of the window, allowing you to find additional stops or stations by visualizing them on the map, selecting and adding to favorites.

The device sensors are showcased by displaying the distance the user is from each stop and the compass direction of the stop based on the bearing of the device. As the device is re-orientated, the compass will rotate in real-time to show the new direction. 

If you have too many stations listed in favorites, a scroll-bar will appear. If the window is resized vertically and your favorites list has been exhausted, the nearby stations element will grow vertically and include a larger number of stations.

A “set location” button is also in the works, which allow you to set your current location by entering a postal code or full address details. This is useful when the device you are using doesn’t have a location sensor, or the determined location is inaccurate. 

Status and Further Work 

I've developed an initial version of the application which is mostly fully featured.  The only important feature that's still missing is to have information on stops / stations on the map control, at the moment only your current location is shown. I'm finishing this off as we speak.  Full client-server communication is enabled and the server-side aggregator is working beautifully.  Once I've finished off the GUI, I'm going to expand the transport networks that are available. At the present time, only Edinburgh is supported. But other transport networks will follow very soon! Be under no illusion that development will stop here, I'm committed to expanding the reach of the application as much as possible.  

Full source code may also be released after I’ve thought through the commercial implications (I’m hoping to release the application on the store for a tiny fee). 

AppUp® Store and Contest Details 

I've submitted the application for entry into the AppUp Store, and despite Intel and my own best efforts it doesn't appear to be validated or listed there yet, which is a little disappointing. My contribution could still be judged by downloading the installer from the link at the top of the article, however, submitted under the productivity category. 

History   

1st December, 2012 - Updated current status and added download links and app-up store information.  

22nd October, 2012 – Initial Version 

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Joe Brock
Software Developer (Senior) Sigma Seven
United Kingdom United Kingdom
Member
I've been designing and developing software at Sigma Seven for the last four years, specializing in spatial workflow solutions. I hold an MSc in Software Engineering and have a whole bunch of passion for C#, WPF, web services and anything that looks particularly complex and nerdy.
 
I also love to blog about beer and collect copious quantities of movies and television series, without actually bothering to watch most of them.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralGood PostmemberShahriar Iqbal Chowdhury22 Oct '12 - 22:25 
GeneralMy vote of 5memberSperneder Patrick22 Oct '12 - 21:29 
GeneralMy vote of 5memberSavalia Manoj M22 Oct '12 - 20:50 
QuestionPlease registeradminChris Maunder22 Oct '12 - 20:07 
AnswerRe: Please registermemberJoe Brock22 Oct '12 - 20:46 
QuestionRe: Please registermemberJoe Brock23 Oct '12 - 5:43 
AnswerRe: Please registeradminChris Maunder23 Oct '12 - 7:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web02 | 2.6.130516.1 | Last Updated 1 Dec 2012
Article Copyright 2012 by Joe Brock
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid