All Projects → dtpstat → dtp-stat-archive

dtpstat / dtp-stat-archive

Licence: GPL-2.0 license
Карта ДТП v1.0. 👉 База знаний о проекте: https://github.com/dtpstat/dtp-project/wiki

Programming Languages

python
139335 projects - #7 most used programming language
javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects
Dockerfile
14818 projects
shell
77523 projects

Projects that are alternatives of or similar to dtp-stat-archive

Dtp Stat
Карта ДТП
Stars: ✭ 141 (-0.7%)
Mutual labels:  geocoding, leaflet, opendata
Leaflet Geosearch
(Leaflet) GeoSearch / GeoCode provider
Stars: ✭ 666 (+369.01%)
Mutual labels:  geocoding, leaflet
kirby-locator
A simple map & geolocation field, built on top of open-source services and Mapbox. Kirby 3 only.
Stars: ✭ 83 (-41.55%)
Mutual labels:  geocoding, leaflet
leaflet-opencage-search
A Leaflet geocoding control that uses the OpenCage geocoding API
Stars: ✭ 18 (-87.32%)
Mutual labels:  geocoding, leaflet
solidata frontend
first draft for solidata_frontend : vue+nuxt+vuetify+i18n+axios
Stars: ✭ 15 (-89.44%)
Mutual labels:  opendata
react-leaflet-bing
Bing layer as React component for Leaflet | This repo is obsolete. Plz, use https://github.com/TA-Geoforce/react-leaflet-bing
Stars: ✭ 13 (-90.85%)
Mutual labels:  leaflet
OoT-Interactive-Map
Interactive Map for the world of Zelda: Ocarina of Time
Stars: ✭ 22 (-84.51%)
Mutual labels:  leaflet
google maps
🗺 An unofficial Google Maps Platform client library for the Rust programming language.
Stars: ✭ 40 (-71.83%)
Mutual labels:  geocoding
django-mapbox-location-field
Simple in use location model and form field with MapInput widget for picking some location. Uses mapbox gl js, flexible map provider API. Fully compatible with bootstrap framework. Can be used with spatial or plain databases.
Stars: ✭ 60 (-57.75%)
Mutual labels:  geocoding
databases-w-r
Databases with R, the latest - rstudio::conf2019
Stars: ✭ 33 (-76.76%)
Mutual labels:  leaflet
nagmapReborn
Nagmap Reborn - Standalone integration with some server monitoring systems providing a user-friendly interface through geographic visualization.
Stars: ✭ 19 (-86.62%)
Mutual labels:  leaflet
leaflet-layerJSON
Build dynamic JSON Layer via Ajax/JSONP with caching
Stars: ✭ 82 (-42.25%)
Mutual labels:  leaflet
Leaflet.streetlabels
Display the street labels following polylines for Leaflet
Stars: ✭ 58 (-59.15%)
Mutual labels:  leaflet
covid19-time-series-utilities
several utilities to help wrangle COVID-19 data into a time-series format
Stars: ✭ 34 (-76.06%)
Mutual labels:  opendata
open.undp.org
[DEPRECATED]: UNDP Project Portal
Stars: ✭ 21 (-85.21%)
Mutual labels:  opendata
h3-r
R bindings for H3, a hierarchical hexagonal geospatial indexing system
Stars: ✭ 57 (-59.86%)
Mutual labels:  geocoding
cbsodataR
Statistics Netherlands (CBS) OpenData API Client for R
Stars: ✭ 27 (-80.99%)
Mutual labels:  opendata
react-native-leaflet
A LeafletView component using WebView and Leaflet map for React Native applications
Stars: ✭ 53 (-62.68%)
Mutual labels:  leaflet
Leaflet.TileLayer.Fallback
Replaces missing Tiles by scaled lower zoom Tiles
Stars: ✭ 29 (-79.58%)
Mutual labels:  leaflet
GeoNature
Application de saisie et de synthèse des observations faune et flore
Stars: ✭ 81 (-42.96%)
Mutual labels:  leaflet

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:django@localhost: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 admin@localhost --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].