Skip to content

aelmekeev/crash_map

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mari El Republic Crash Map 2015

This project contains back-end and front-end code written for visualization of crashes on the roads of Mari El republic.

Usage

There are two parts of this project: back-end and front-end. Back-end is written on Python and front-end is on Javascript + a little bit of Ruby.

Also there is an data.csv file which was created from data provided by GIBDD of Mari El Republic and contains information about road accidents in Mari El Republic in 2015. This file can be used:

  • to generate json that is used by frontend (json is also included)
  • to build any other set of data

Back-end

End-to-end process for preparation data for front-end looks like this:

  1. Run geocoding.py.
  2. Run data_verification.py.
  3. Run generate_data.py.

Geocoding

Geocoding process is added in order visualize data based on address information from input data. Script is using Yandex Geocoder to create temporary storage of geocoding data for the sole purpose of improving the functionality and performance capacity of crash map visualization.

To run it simply use:

python geocoding.py

Input data is input.scv from data directory. Output is input_geocoded.csv which will be added also into data directory.

Data verification

Verification consists of:

  • verification of date and time values;
  • checking of confused latitude and longitude in input data (with fixing of them);
  • verification of coordinates based on bounderies of Mari El republic and Yoshkar-Ola;
  • verification of coordinates based on coordinates recieved from geocoder;
  • etc.

In order to identify quality of the data before visualization you should run:

python data_verification.py

Input data is input_geocoded.csv from data directory generated by geocoding.py. Output is input_verified.csv which will be added also into data directory.

Generation of data

Once geocoding and data verification processes are completed you should be able to generate data.js file which will be used by front-end part by simple:

python generate_data.py

Input data is input_verified.csv from data directory generated by data_verification.py. Output is data.js which will be added also into data directory.

Generation of statistics

After data verification process there is a possibility to generate some crashes statistics by running:

python generate_statistics.py

Input data is input_verified.csv from data directory generated by data_verification.py. Statistics will be printed to output as a plain test in Russian with details on road accidents for Mari El republic and Yoshkar-Ola. Statistics includes for example:

  • statistics on crashes broken by administrative district;
  • statistics on crashes broken by types;
  • statistics of injuries and deaths in road accidents;
  • data validation statistics;
  • etc.

Front-end

Frontend uses Yandex Maps API + some additional libraries to visualize input data.

The result is deployed on: https://crash-map-yo.herokuapp.com/.

About

Map of road incidents for Mari El republic 2015

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published