All Projects → tadata-ru → Dtp Stat

tadata-ru / Dtp Stat

Licence: gpl-2.0
Карта ДТП

Programming Languages

javascript
184084 projects - #8 most used programming language
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Dtp Stat

dtp-stat-archive
Карта ДТП v1.0. 👉 База знаний о проекте: https://github.com/dtpstat/dtp-project/wiki
Stars: ✭ 142 (+0.71%)
Mutual labels:  geocoding, leaflet, opendata
kirby-locator
A simple map & geolocation field, built on top of open-source services and Mapbox. Kirby 3 only.
Stars: ✭ 83 (-41.13%)
Mutual labels:  geocoding, leaflet
Leaflet Geosearch
(Leaflet) GeoSearch / GeoCode provider
Stars: ✭ 666 (+372.34%)
Mutual labels:  geocoding, leaflet
leaflet-opencage-search
A Leaflet geocoding control that uses the OpenCage geocoding API
Stars: ✭ 18 (-87.23%)
Mutual labels:  geocoding, leaflet
Expostal
Elixir binding for Libpostal - a library for parsing/normalizing street addresses around the world. Powered by statistical NLP and open geo data.
Stars: ✭ 80 (-43.26%)
Mutual labels:  parser, geocoding
Awesome Italian Public Datasets
A selection of interesting Open dataset from the Italian Public Administration and Civic Data use cases
Stars: ✭ 132 (-6.38%)
Mutual labels:  opendata
To Milliseconds
Convert an object of time properties to milliseconds: `{seconds: 2}` → `2000`
Stars: ✭ 136 (-3.55%)
Mutual labels:  parser
React Json Schema
Configure and build views using JSON schemas mapped to React components
Stars: ✭ 131 (-7.09%)
Mutual labels:  parser
Maps Api For Javascript Examples
Self-contained examples for Maps API for JavaScript v3.
Stars: ✭ 130 (-7.8%)
Mutual labels:  geocoding
Pygdbmi
A library to parse gdb mi output and interact with gdb subprocesses
Stars: ✭ 139 (-1.42%)
Mutual labels:  parser
Nominatim
Open Source search based on OpenStreetMap data
Stars: ✭ 1,896 (+1244.68%)
Mutual labels:  geocoding
Harser
Easy way for HTML parsing and building XPath
Stars: ✭ 135 (-4.26%)
Mutual labels:  parser
Go Vimlparser
⚡️ Vim Script Parser written in Go
Stars: ✭ 132 (-6.38%)
Mutual labels:  parser
Vue2leaflet
Vue 2 components for Leaflet maps
Stars: ✭ 1,809 (+1182.98%)
Mutual labels:  leaflet
Opendatasurvey
The Open Data Survey application.
Stars: ✭ 131 (-7.09%)
Mutual labels:  opendata
Leaflet Choropleth
Choropleth plugin for Leaflet (color scale based on value)
Stars: ✭ 138 (-2.13%)
Mutual labels:  leaflet
Works For Me
Collection of developer toolkits
Stars: ✭ 131 (-7.09%)
Mutual labels:  parser
Entrypoint
Composable CLI Argument Parser for all modern .Net platforms.
Stars: ✭ 136 (-3.55%)
Mutual labels:  parser
Tidygeocoder
Geocoding Made Easy
Stars: ✭ 137 (-2.84%)
Mutual labels:  geocoding
Antlr4 C3
A grammar agnostic code completion engine for ANTLR4 based parsers
Stars: ✭ 135 (-4.26%)
Mutual labels:  parser

Build Status

Карта ДТП

Проект "Карта ДТП" (https://dtp-stat.ru)

Обсуждение проекта - https://t.me/crash_map


Developer Environment (local)

Installation

Requirements

  • Python >=3.6
  • Postgresql >=10.6
  • Nodejs (npm)

Install dependencies

  1. Install node packages
$ npm install -g npx
$ npm install
  1. Install python dependencies
pip install -r requirements.txt

Prepare and Configure Project

  1. Start postgresql server.
  2. Create appropriate database and role:
$ psql -c "CREATE DATABASE django;" -U postgres
$ psql -c "CREATE ROLE django WITH LOGIN PASSWORD 'django';" -U postgres
$ psql -c "ALTER ROLE django CREATEDB;" -U postgres
$ psql -c "GRANT ALL PRIVILEGES ON DATABASE django TO django;" -U postgres
  1. Export DATABASE_URL (used by app for database connection) and DEBUG environment variable with database info according to previous steps:
$ export DATABASE_URL="postgres://django:[email protected]:5432/django"
$ export DEBUG=true
  1. Perform migrations:
$ ./manage.py makemigrations --noinput
$ ./manage.py migrate --noinput
  1. Create default_cache cache table:
$ ./manage.py createcachetable
  1. It`s time to start app:
$ ./manage.py runserver localhost:8000

Authorize on http://127.0.0.1:8000/admin1.

  1. You need to run npm start together with app to generate JavaScript-code:
npm start

Developer Environment (docker)

Installation

Requirements

  • docker
  • docker-compose
  • docker-machine (for win & mac)

Prepare and Configure Project

Project configured by .dockerenv file in docker folder.

Rename docker/.dockerenv.example to docker/.dockerenv and set variables:

  • SECRET_KEY, - secret key, you can generate it with:
    python3 -c "import random, string; print('SECRET_KEY=\"%s\"'%''.join([random.SystemRandom().choice(\"{}{}{}\".format(string.ascii_letters, string.digits, string.punctuation)) for i in range(63)]))"
  • DEBUG, - set it to true

Start project

  1. Build and up containers: docker-compose up -d --build
  2. First time need create superuser

Run this and follow instructions:

$ docker-compose exec app ./manage.py createsuperuser --email [email protected] --username admin
  1. Authorize on http://127.0.0.1:8000/admin1.

Запуск парсера данных со stat.gibdd.ru

Загрузить в базу техническую информацию (названия разделов)

$ ./parser.py tech_data

Загрузить в базу регионы и районы

$ ./parser.py get_regions

Загрузить в базу все ДТП. Для этого нужно предварительно скачать дамп всех ДТП и положить в папку data - https://drive.google.com/file/d/1aUTPLqUX5xZhmtcFODyVb7GpBj3_SHui/view?usp=sharing

$ ./parser.py get_dtp

Чтобы включить отображение региона нужно в базе данных поставить ему status = True.

Развертывание

Запустите эту команду перед развертыванием для генерации JavaScript кода:

$ npm run build-production

Старт без Docker и изменения переменных окружения

Если не хочется выкачивать все данные - вот бекап базы https://drive.google.com/open?id=1SPHyY-802U-USRQh3j4JfzhIO86eAaUp ###Backend:

  • Скопировать dtpmap/.env.tmpl -> dtpmap/.env
  • Отредактировать dtpmap/.env

Frontend:

(самый простой способ)

Выполнить manage.py runserver 8000

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].