====== Open Cycling Data [#RARITAN] ====== ===== Group members ===== * Ashraf Abdo * Dimitar Minovski * Niklas Kolbe ===== Idea and Motivation ===== The idea is to crowd source bicycling data in terms of the cycling routes and times to improve biking conditions in cities. With the help of this data, the city, municipality or region could maintain and provide biking routes that correspond to the demand and enhance services on busy routes. Also analysis in terms of traffic (e.g. traffic lights) could consider the cycling data. The user just needs to run a mobile application while he is biking to track the route. The tracked routes will then be sent to the server. The anonymously gathered data will be accessible via an open REST API. ===== Concept ===== {{ :opendata2015:group3:code_camp.png?600 |}} ===== Features ===== === Mobile Application === The mobile application will provide this set of features: {{ :opendata2015:group3:raritantracker2.png?200|}} {{ :opendata2015:group3:raritantracker1.png?200|}} ^ Feature ^ Details ^ Goal ^ Implemented ^ ^ Record Cycling Route | Tracking the GPS coordinates of the mobile phone and saving them on the phone | Must-have | YES | ^ Upload Tracked Data | Sending the trip information to the server | Must-have | YES | ^ Provide Cycling Information | Providing information to the user about the tracked routes | As time allows | YES, but only basic tracked data | ^ Integrate external data | Sending the trip information to the server | Optional | Dummies | === Webserver === The webserver allows to store and retrieve data through the REST API which provides: ^ Feature ^ Details ^ Goal ^ Implemented ^ ^ Query data | Querying the gathered data in terms of date and location with different granularities to make it accessible for the public. | Must-have | YES | ^ Add data | Adding new routes with GPS and time information sent by the mobile application | Must-have | YES | ^ Add meta data to GPS route data | For good searches the GPS data has to be enhanced with meta information like time, country or city. | Must-have | YES | ^ Different Respond Formats | Providing different formats like GEOJSON or just coordinates as respond | Optional | YES | === External Webservice === To demonstrate what could be done with the data we implemented an example service which accesses the Open Bicycling Data: ^ Feature ^ Details ^ Goal ^ Implemented ^ ^ Bicycling Density Route Usage Map | A map that visualises the Open Bike Data to show busy routes. | Optional | YES | ^ Focus map and filter data | Focus map by URL params and only request the data of the specified country/region | Optional | YES | ===== Platforms and Technologies ===== Some details about the implementation. === Android Application === * IDE: Android Studio * Android phone for testing (Android OS 5) * Location sensor, network connection === Webserver === * IDE: Cloud9 * Node JS framework: Express JS * MongoDB, Mongoose for access * Google Maps API for geocoding === "External" Webservice === * Open Cycling Data API (developed by us) * Google Maps API ===== RESTful Open Cycling Data API ===== === Documentation === The complete Open Cycling Data API Documentation is available in .json and .yaml format: {{:opendata2015:group3:open_cycling_data_api.zip|}} A short summary: The API can be accessed via https://lutcodecamp-niklaskolbe.c9.io/biketracks/{datarequest}/{country}/{region}?{parameters} * datarequest = all|geojson|coordinates. Defines the respond format. Available: all the date, GEOJSON format or just coordinates. * country = the country name or country code (e.g. finland or fi) * region = city or area in a country (e.g. lappeenranta) It allows following optional parameters: * year * month * day * limit (to limit respond to x datasets) === Example Requests === Request: https://lutcodecamp-niklaskolbe.c9.io/biketracks/all/finland/lappeenranta?year=2015&month=3&day=5&limit=100 Example response: [ { "_id":"54f873dd8a87341d583aa4d2", "country":"finland", "country_code":"fi", "administrative_area_level_1":"", "administrative_area_level_2":"lappeenranta", "locality":"", "postal_code":"53850", "__v":0, "timestamps":[ "2015-03-05T15:17:10.487Z", "2015-03-05T15:17:18.831Z", "2015-03-05T15:17:30.220Z" ], "coordinates":[ { "latitude":61.04799, "longitude":28.08706, "_id":"54f873dd8a87341d583aa4d5" }, { "latitude":61.04657, "longitude":28.09506, "_id":"54f873dd8a87341d583aa4d4" }, { "latitude":61.04767, "longitude":28.09706, "_id":"54f873dd8a87341d583aa4d3" } ] } ] Request: https://lutcodecamp-niklaskolbe.c9.io/biketracks/geojson/finland?year=2015&month=3 Example response: { "type":"FeatureCollection", "features":[ { "type":"Feature", "geometry":{ "type":"LineString", "coordinates":[ [ 61.04767, 28.09706 ], [ 61.04767, 28.09706 ], [ 61.04767, 28.09706 ] ] } } ] } Request: https://lutcodecamp-niklaskolbe.c9.io/biketracks/coordinates/finland/lappeenranta?year=2015 Example respond: [ [ 61.06173, 28.10345 ], [ 61.05953, 28.10354 ], [ 61.05568, 28.10794 ] ] ===== "External" Webservice ===== The "external" webservice is accessible via http://lutcodecamp-niklaskolbe.c9.io/{country}/{region} The web service accesses the Open Cycling Data API and creates a google heat map. By specifying a country and/or a region the map will be centered and the data filtered accordingly. As for the API, the website accepts the optional parameters year, month and day and also filters the data accordingly. {{ :opendata2015:group3:webservice2.png?600 |}} ===== Project Source Code Presentation and Report ===== Presentation: http://bit.ly/OpenCyclingData Report: {{:opendata2015:group3:codecampreport.pdf|}} Poster: {{:opendata2015:group3:raritan_poster.pdf|}} Source code API + webservice: {{:opendata2015:group3:opencyclingdata_heatmap.zip|}} Source code mobile application: {{:opendata2015:group3:gpstracker-master.7z|}}