Skip to content

Crawled OpenData from a Bikesharing-Company and analysed it with the Help of Python osmnx and folium

Notifications You must be signed in to change notification settings

BenSchr/Bikesharing-Geoanalysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bikesharing-Geoanalysis

Analysing crawled OpenData from a Bikesharing-Company with the help of Python osmnx and folium

You will need the Pythonmodule OSMnx to perform the geolocation and calculate the routes.

Overview

We crawled the Nextbike-Api for the GPS Data of the Bikesharing Bikes in Cologne. You can find a sample csvfile in this repository with data from one day.

With the help of OSMnx we can analyse the geolocations of the bikes and calculate the routes they are driving.

Also we can save the calculated routes into a database to make later analysis on a bigger timerange.


The functions used in the main.ipynb are stored in processes.py

So after loading the csvfile as a dataframe we can calculate the routes with transform() which returns a python dictionary giving us a lot of freedom to process the data in further steps. This will take some minutes since the calculating of the routes is very timeintensive.

routes = ps.transform(df)

The funcion pltfromdoc() reads the dictonary and plots the graph of cologne and paints the routes from the dictionary. The image will be saved into /images/graphbikes.png

ps.pltfromdoc(routes)

The function heatfromdoc() creates a heatmap with timeseries, the stepwidth is set to an hour. You can change the stepwidth by adjusting the cnt (6=1h, 12=2h) inside the function. Check also the index.html for the interactive map.

ps.heatfromdoc(routes)

The function pltStreetCount() is a sample analysis on the data that counts the used streets in the route data and displays the top 10

ps.pltStreetCount(routes)

About

Crawled OpenData from a Bikesharing-Company and analysed it with the Help of Python osmnx and folium

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages