How to Install Open Source Routing Machine (OSRM) on OpenSUSE Latest

Open Source Routing Machine (OSRM) is a powerful and flexible open-source routing engine that can be used for many different applications. In this tutorial, we will go over how to install OSRM on a machine running OpenSUSE Latest.

Prerequisites

Before we start, make sure your machine meets the following requirements:

Step 1: Install Dependencies

First, we need to install some dependencies required by OSRM. Open up a terminal window and run the following command to install the necessary packages:

sudo zypper install git cmake make gcc-c++ boost-devel bzip2 libbz2-devel libstxxl-devel libstxxl1 libxml2-devel libzip-devel libboost_filesystem-mt libboost_iostreams-mt libboost_program_options-mt libboost_regex-mt libboost_system-mt

Step 2: Download and Build OSRM

After installing the necessary dependencies, we can proceed to download and build OSRM. Follow these steps to do so:

  1. Open up a terminal window and navigate to a directory where you want to download OSRM. For example:

    cd ~/Downloads
    
  2. Clone the OSRM repository from GitHub using the following command:

    git clone https://github.com/Project-OSRM/osrm-backend.git
    
  3. Once the repository is cloned, navigate into the cloned directory and create a build directory:

    cd osrm-backend
    mkdir -p build
    cd build
    
  4. Configure the build with cmake:

    cmake ..
    
  5. Build OSRM:

    make
    

    Note: This step may take some time, depending on your machine's hardware.

Step 3: Install OSRM

After building OSRM, we can install it on our machine. Run the following command from within the build directory:

sudo make install

This will install the OSRM binaries and libraries on your machine.

Step 4: Test OSRM

Now that OSRM is installed, we can test it to make sure everything is working as expected. Follow these steps to do so:

  1. Download some sample data to use for testing. You can find sample data files on the OSRM GitHub repository:

    cd ~/Downloads/osrm-backend
    wget http://download.geofabrik.de/europe/germany/baden-wuerttemberg-latest.osm.pbf
    
  2. Extract a portion of the data to use for testing:

    osrm-extract baden-wuerttemberg-latest.osm.pbf
    
  3. Run the osrm-routed server:

    osrm-routed baden-wuerttemberg-latest.osrm
    
  4. In another terminal window, run the following command:

    curl 'http://localhost:5000/route/v1/driving/8.681495,49.41461;8.687872,49.420318?steps=true'
    

    This will send a request to the OSRM server to calculate a route between two points in Baden-Württemberg, Germany.

    If everything is working correctly, you should see a response from the server containing the calculated route.

Conclusion

Congratulations! You have successfully installed and tested Open Source Routing Machine (OSRM) on OpenSUSE Latest. You can now use OSRM in your own projects and applications to calculate routes and perform other routing-related tasks.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!