This repo contains scripts and data necessary to visualize on a map the interventions given by Municipal Police of Poznań. Statistics are presented for 2013-06-17 - 2013-10-09.
Update
I moved some results to Tableau. The packaged workbook file (v10.2) is stored in Releases. The online version is available on Tableau Public. Here is a screeshot of a generated dashboard:
Generated interventions heatmaps for districts:
- no. interventions in districts,
- log no. interventions in districts,
- no. interventions per citizens in districts,
- log no. interventions per citizens in districts.
Final maps are stored in QGIS format. Generated images of QGIS interventions heatmaps for districts:
Generated statistics are stored as XLSX.
Time of reports:
- R 3.x with vwr library
- Python 2.6 with requests library
I assume you have your own raw copy of the list of MP interventions, i.e. db/poznan-mp-interventions-2013-06-17-2013-10-09.csv
.
Execution goes as follows:
extract_streets_and_places.R
- looks for name of street or place in description of intervention,add_lat_lon.py
- performs reverse geocoding using Google Maps API,clean_csv.py
- removes unnecessary columns,add_district.py
- adds name of district to intervention,create_html_visualizations.py
- generates nice html heat-maps for districts (in Polish).
add_lat_lon.py
- sometimes Google returns that there is no lon/lat for given address; then just re-run the script.add_district.py
- some of coordinates given by Google may lay outside the districts boundaries; the script will output ids of such interventions.
- list of streets in Poznań - Poznań API
- list of streets, parks, bridges in Poznań - GEOPOZ
- list of districts in Poznań with their boundaries (an example for Jeżyce)
- number of citizens in districts of Poznań - GEOPOZ