Skip to content

data-osm/geosm-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Duplicate DATA OSM

  1. create an environment file .env in settings folder as .env.sample

For dev purpose use docker-compose-dev.yaml, for prod use docker-compose-prod.yaml

  1. build and pull docker images
$ docker-compose -f docker-compose-prod.yaml build
  1. lunch the backend
$ docker-compose -f docker-compose-prod.yaml up -d
  1. Enable custom Style configurations
$ docker-compose -f docker-compose-prod.yaml exec web python manage.py  seedCustomStyle --settings=settings.prod
  1. create a super user, you will use this credentials after
$ docker-compose -f docker-compose-prod.yaml exec web python manage.py  createsuperuser --settings=settings.prod
  1. Setup elasticsearch
$ docker-compose -f docker-compose-prod.yaml exec web python manage.py  search_index --rebuild --settings=settings.prod  
  1. Load icons in prod
$ docker-compose -f docker-compose-prod.yaml exec web python manage.py loaddata --settings=settings.prod  seed/icon.json

At this step your project is ready. To import OSM DATA, jump to Load OSM DATA section describe below

Load OSM data

Import OSM data in database import_osm.MD

Link a foreign database containing osm data with our database

Edit import_foreign_osm_table.sql with the connection parameters of the foreign database and execute it :

$  docker-compose -f docker-compose-prod.yaml exec --user postgres db psql -d postgres -f /import_foreign_osm_table.sql 

For kibana use

https://stackoverflow.com/questions/42385977/accessing-a-docker-container-from-another-container

docker run --network host --name kibana -e "ELASTICSEARCH_HOSTS=http://172.17.0.1:9200" -p 5601:5601 kibana:7.10.1

Backup database and files:

Dabase

pg_dump --clean --exclude-schema osm_tables --exclude-schema sigfile --exclude-table 'planet_osm*' --no-acl --no-owner -d <database_name> -U <database_user> -h <database_host> -W | gzip > /path/to_store/data_osm_dump_$(date '+%Y-%m-%d_%H_%M_%S').sql.gz

Files to backup

icons/group/ icons/layer/ icons/picto/ icons/pictoQgis/ icons/Autres/ icons/sig-file/

Maintenance

To regenerate a layer

$ docker-compose -f docker-compose-prod.yaml exec web python manage.py  reGenerateQgisProject <vector_id_of_the_layer>  --settings=settings.prod  

To regenerate all layers (can take much time)

$ docker-compose -f docker-compose-prod.yaml exec web python manage.py  reGenerateQgisProject --settings=settings.prod  

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages