Giter VIP home page Giter VIP logo

roaddanger.org's Introduction

roaddanger.org

A website and database for news reports about traffic crashes around the world.

Website: roaddanger.org

Requirements

  • Webserver with PHP support
  • MySQL/MariaDB with full text search support

Installation

  • Put all files on a webserver with PHP support.
  • Import de database on a MySQL/MariaDB server with full text search capability. The database creation script is located in admin/createdatabase.sql
  • Read the config.php file. It tells you to create a configsecret.php file with your database connection info. Never check this one into git.
<?php

// *** Do not fill in the database settings ***
// - Create a new file named configsecret.php and fill these settings there.
// - Exclude configsecret.php from checking into your source code repository. 
// - This is to prevent passwords from entering the source code repository.
const DB_HOST     = '';
const DB_NAME     = '';
const DB_USER     = '';
const DB_PASSWORD = '';
  • Register yourself as a user on the website. Make yourself an administrator in MySQL by setting the permission for yourself field to 1 in the users table.

License

This software is made available under the MIT license.

roaddanger.org's People

Contributors

digitaldutch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

roaddanger.org's Issues

Data export seems incomplete, limited at 10000 crashes

Sorry, another issue... (I think).

It seems as if not all data is exported in the gzip JSON file.

When exporting the data via https://nl.roaddanger.org/export/ I get:

However, when I visit https://nl.roaddanger.org/statistics/general I see there are approximately 14k crashes (this corresponds with the current crash ID's):

image

Due to the neat amount of 10000 items I suspect there is some limiting going on. I don't know PHP, but the export function does mention $maxRows = 10000; and this variable is used later in the SQL query. Could this be the culprit?

Editing accident returns database error

Fietsster overleden na verkeersongeval

I wanted to change unknown vehicle to something that represents a mobile home as best as possible. But the it returned the following error:

SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: '' for column `hetongeluk`.`crashpersons`.`child` at row 1

I changed something. But the old unknown vehicle is deleted, and the new vehicle is not added.

On further inspection, I cannot add an accident. I Added the HAR file as txt.
nl.roaddanger.org.har.txt.

It is possible to reproduce this in my Vivaldi (chromium) and Firefox browser.

Can't add people on iPad with keyboard

Ik zie dat je deze in het Engels doet...

I was trying to add an article on my iPad, but adding people does not seem to work there. Without adding people, I can't submit the article, so I had to switch to my laptop.

After submitting I had some more debugging:

  • it works on my iPhone, so that's weird.
  • when I unplug the keyboard to my iPad it works again.

I think this is because of the use of <span> and onclick. When there is no keyboard connected, iPad will be compatible and fire onclicks for tabs. But when the keyboard is connected, some keyboards will have a mouse, so it will probably distinguish between onclick and ontab. (Mine has no mouse, but it seems like it still distinguishes.)

One could think the bug is with Apple, but the better way is not to use a <span> when you want to use it to click on. The accessible option would be to use a <input type="radio">, which does what you want out of the box, plus has advantages for screenreaders and different devices :)

Regional statistics

Is there any chance to extend thecrashes.org to provide a regional analysis of the data? I'm adding news articles from Aachen/Germany at the moment and at some point there could be enough data that a regional analysis could make sense.

Add new transportation mode "speed pedelec"

Hello,

It would be helpful if there would be a new transportation mode "speed pedelec"/"high speed e-bike". I think this could be a valuable addition because:

  1. They sometimes get a bad reputation of being dangerous because they, in Belgium at least, are oftentimes allowed to make use of the cycle path, which is often not build with the higher average speed of the pedelec in mind. It would be interesting to see data about how often they are involved in an accident vs. a "normal" bicycle.

  2. Currently it is not clear how they should be categorised. Some instances view them as mopeds (for example the Belgian traffic code), while other see them as bicycles (for example the Flemish citizen science project Straatvinken). It is not good for the data if in some collisions the speed pedelecs involved are categorised as bicycles and other as mopeds.

In my humble opinion, a new category would be very helpful.
An other possibility would be to classify the pedelec as a bicycle or a moped and then changing the name of the category to bicycle/pedelec for example so it is clear where they need to be placed.

Thank you very much!

If summary cannot be scraped it remains empty, but filling it is required to close out form

Example URL: https://regio15.nl/nieuws/ongevallen/36619/wegvervoer-ongeval-letsel-neherkade-2980-den-haag/

Steps to reproduce:

  1. Go to https://nl.roaddanger.org/
  2. Add new article via + sign in the upper right
  3. Add this URL: https://regio15.nl/nieuws/ongevallen/36621/spoorvervoer-ongeval-letsel-scheveningseweg-den-haag-lijn-1/ and press on "Artikel ophalen"
  4. Note that the "Samenvatting" field remains empty, it cannot be scraped for this URL
  5. Fill in the "Tekst" field under "Ongeluk" to create a manual summary
  6. Fill in the rest of the fields ("Datum", "Betrokken mensen", "Locatie", etc...)
  7. Press "Opslaan"

Expected result: the article is saved and text from the "Tekst" field is used as the summary.

Actual result: error message is shown with the text: "Artikel samenvatting niet ingevuld".

Workaround: in the browser inspector I can remove the data-readonlyhelper attribute of the editArticleText element and paste in my own summary, then I can save it. But this quite cumbersome.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.