Skip to content
MJAsadi72 edited this page Aug 6, 2023 · 6 revisions

osrm-backend-nginx

This repo combining osrm-backend APIs with nginx based on docker

Requirement

  • docker
  • docker-build
  • docker-compose
  • jq

Quick Start

To deploy this project first download map file for example

  ./run.sh download -g "http://download.geofabrik.de/asia/iran-latest.osm.pbf"

after downloading map file run

  ./run.sh setup

for getting duration(secon) and distance(metre) between two points run

  ./run.sh get -s 51.42838,35.80697 -d 51.42088,35.68590

option "-s" is first point and "-d" means second point with format ","

Usage

Usage:
    run.sh setup -m <MAP> # setup project 
    run.sh start #start containers
    run.sh stop #stop containers
    run.sh destroy #stop and delete all containers
    run.sh download -g <URL> #download MAP file
    run.sh list #list all map files
    run.sh status #get status of containers
    run.sh get -s <FIRST_Longitude,FIRST_Latitude> -d <SECOND_Longitude,SECOND_Latitude> #get distance and duration between two point based on mode

Manual

setup the project. option "-m" is optinal. default map is iran-latest.

  ./run.sh setup -m <MAP>

  #example
  ./run.sh setup -m iraq-latest

start all containers

  ./run.sh start 

stop all containers

  ./run.sh stop 

stop and delete all containers

  ./run.sh destroy

download MAP file

  ./run.sh download -g <URL> 
  
  #example
  ./run.sh download -g "http://download.geofabrik.de/asia/iraq-latest.osm.pbf"

list all map files

  ./run.sh list

  #output
  iran-latest
  iraq-latest

get status of containers

  ./run.sh status

  #output
  running

get distance and duration between two point based on mode. option "-s" is first point and "-d" means second point with format ","

  ./run.sh get -s <FIRST_Longitude,FIRST_Latitude> -d <SECOND_Longitude,SECOND_Latitude>

  #output
  driving
  duration: 1055.5
  distance: 15175.7
  -----------------------
  walking
  duration: 10373.9
  distance: 14378.1
  -----------------------
  cycling
  duration: 3922.9
  distance: 15768.3
  -----------------------

License

BSD 2-Clause "Simplified" License

Clone this wiki locally