Skip to content

raphiniert/osm2tactile

Repository files navigation

osm2tactile

create tactile maps for visually impaired and blind people

a simple web service, generating maps, based on open street map data, using a braille font and suitable for embossed or swellpaper printing

setup

clone repo

git clone https://github.com/raphiniert/osm2tactile.git
cd osm2tactile

optional: create virtual enviornment

this step is only necessary when developing

poetry env use python3.9.9
poetry install

create flask config

create the instance/config.py file and including relevant settings such as:

SECRET_KEY = "your.super.secret.key"
DEBUG = True
TIMEZONE = "Europe/Vienna"
# postgres
POSTGRES_DB = "osm2tactile"
POSTGRES_USER = "postgres"
POSTGRES_PASSWORD = "your.super.secret.password"
POSTGRES_HOST = "db"

# nominatim
NOMINATIM_URL = "https://nominatim.openstreetmap.org"

create .env file

# docker compose
COMPOSE_PROJECT_NAME=osm2tactile
COMPOSE_FILE=docker-compose.yml

# postgres
POSTGRES_DB=osm2tactile
POSTGRES_USER=postgres
POSTGRES_PASSWORD=your.super.secret.password
POSTGRES_HOST=db
POSTGRES_PORT=5432

# flask
FLASK_APP=osm2tactile
FLASK_RUN_HOST=0.0.0.0
FLASK_ENV=development

start (and build) containers

docker compose up -d

import data via osm2pgsql

download the osm data e. g. from https://download.geofabrik.de (using austria for the following examples) and move it to data/osm/austria-latest.osm.pbf

note: go grab yourself a coffe, the next step might take a while...

docker compose exec flask osm2pgsql data/osm/austria-latest.osm.pbf -v --slim --database=osm2tactile --host=db --user=postgres --port=5432 --password

bonus points: self host nominatim

this project uses open street map's nominatim api. if you want to self host nominatim, it is not advised to use the same database for both, the tile server and nominatim. adding the following nominatim section to the docker-compose.yml will import the specified osm dump, setup a postres database with the postgis extension and starts an apache webserver on the specified port:

version: "3.9"

services:
  db:
    # ...
  flask:
    # ...
  nominatim:
    image: mediagis/nominatim:4.4
    ports:
        - "8080:8080"
    environment:
        # see https://github.com/mediagis/nominatim-docker/tree/master/4.0#configuration for more options
        PBF_URL: https://download.geofabrik.de/europe/austria-latest.osm.pbf
        REPLICATION_URL: https://download.geofabrik.de/europe/austria-updates/
        NOMINATIM_PASSWORD: very_secure_password
    volumes:
        - ./data/nominatim-data:/var/lib/postgresql/14/main
    shm_size: 1gb
    logging:
      driver: "json-file"
      options:
        max-size: "200m"
        max-file: "10"
    stdin_open: true
    tty: true
    restart: unless-stopped

You need to update the nominatim url in the instance/config.py to use your instance

# nominatim
NOMINATIM_URL = "http://nominatim:8080"

About

create tactile maps based on open street map

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published