-
Notifications
You must be signed in to change notification settings - Fork 47
Installation and Setup
This sets up the release version of MOTIS. MOTIS release distribution is downloaded, not built locally. For a developer setup see the other wiki pages.
There are different options to start MOTIS:
- Docker (on any system that supports Docker)
- Linux binary
- Windows binary
- Mac OS X binary
Best practice is to setup MOTIS with two separate folders (aka "volumes" for Docker):
-
data
folder/volume (MOTIS needsread+write
access), this folder will contain preprocessed data, logs and temporary files -
input
folder/volume (MOTIS needsread-only
access), this folder will contain input data such as OpenStreetMap data, timetables, coastline data, SRTM data, etc.
For each target platfrom (Docker, Linux, Windows, Mac OS), the first step is to create an input
folder with the data you want to use for your server. This is typically
- an OpenStreetMap file in the
*.osm.pbf
format (region extracts can be downloaded from Geofabrik. - one or more timetables (ZIP files can be used as is and extracted). Supported timetable formats, are at the moment, GTFS and HAFAS Rohdaten.
- and a
config.ini
pointing MOTIS to the data in the input folder as well as configuring MOTIS
You can save one of the following scripts as setup.sh
and run it with sh setup.sh
(or chmod +x setup.sh && ./setup.sh
). Note: the following scripts delete files from previous runs (see first section). So make sure you run this script in a fresh folder.
The following script demonstrates a simple intermodal routing setup with MOTIS on Linux using the MOTIS executable. Make sure you have wget
installed (preinstalled on many systems).
#!/bin/sh
# TARGET="macos-x86_64"
# TARGET="macos-x86_64-noavx2"
# TARGET="macos-arm64"
TARGET="linux-amd64"
# TARGET="linux-amd64-noavx"
# TARGET="linux-arm"
# TARGET="linux-arm64"
# TARGET="linux-x86"
# Download and extract MOTIS.
wget https://github.com/motis-project/motis/releases/latest/download/motis-${TARGET}.tar.bz2
tar xf motis-${TARGET}.tar.bz2
# Download a small test dataset from Aachen, Germany
wget https://github.com/motis-project/test-data/raw/aachen/aachen.osm.pbf
wget https://opendata.avv.de/current_GTFS/AVV_GTFS_Masten_mit_SPNV.zip
# Write config.ini
cat <<EOT >> config.ini
modules=intermodal
modules=address
modules=tiles
modules=osrm
modules=ppr
modules=parking
modules=nigiri
intermodal.router=nigiri
server.static_path=motis/web
[import]
paths=schedule-avv:AVV_GTFS_Masten_mit_SPNV.zip
paths=osm:aachen.osm.pbf
[nigiri]
num_days=7
[osrm]
profiles=motis/osrm-profiles/car.lua
profiles=motis/osrm-profiles/bike.lua
[ppr]
profile=motis/ppr-profiles/default.json
[tiles]
profile=motis/tiles-profiles/background.lua
EOT
# Start MOTIS
./motis/motis
# Clear data from previous runs.
Remove-Item -Recurse -Force -Confirm:$false motis
Remove-Item -Recurse -Force -Confirm:$false test-data-aachen
Remove-Item -Recurse -Force -Confirm:$false input
Remove-Item -Recurse -Force -Confirm:$false motis-windows.zip
Remove-Item -Recurse -Force -Confirm:$false aachen.zip
Remove-Item -Recurse -Force -Confirm:$false data
# Download and extract MOTIS. Change URL for other CPU architecture / OS.
Invoke-WebRequest https://github.com/motis-project/motis/releases/latest/download/motis-windows.zip -OutFile motis-windows.zip
Expand-Archive motis-windows.zip -DestinationPath motis
# Download a small test dataset from Aachen, Germany
# This includes the timetable + OSM region extract for the core-city only.
Invoke-WebRequest https://github.com/motis-project/test-data/archive/refs/heads/aachen.zip -OutFile aachen.zip
Expand-Archive aachen.zip -DestinationPath .
# Create input folder.
New-Item -Type Directory input
Invoke-WebRequest https://github.com/motis-project/test-data/raw/aachen/aachen.osm.pbf -OutFile input/aachen.osm.pbf
Invoke-WebRequest https://opendata.avv.de/current_GTFS/AVV_GTFS_Masten_mit_SPNV.zip -OutFile input/AVV_GTFS_Masten_mit_SPNV.zip
# Create config file
$Config = @"
modules=intermodal
modules=address
modules=tiles
modules=osrm
modules=ppr
modules=parking
modules=nigiri
intermodal.router=nigiri
server.static_path=motis/web
[import]
paths=schedule-avv:input/AVV_GTFS_Masten_mit_SPNV.zip
paths=osm:input/aachen.osm.pbf
[nigiri]
num_days=7
[osrm]
profiles=motis/osrm-profiles/car.lua
profiles=motis/osrm-profiles/bike.lua
[ppr]
profile=motis/ppr-profiles/default.json
[tiles]
profile=motis/tiles-profiles/background.lua
"@
# For PowerShell 6 and newer '-Encoding UTF8NoBOM' can be used instead
Out-File -FilePath input/config.ini -InputObject $Config -Encoding ASCII -Force
# Start MOTIS
./motis/motis -c input/config.ini
Ensure a valid timetable is used. If the timetable is outdated, it will not contain any trips to consider for upcoming dates.